LEDGERCOMM-SEND(1)

πŸ“¦ version 1.2.1, in ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– LEDGERCOMM-SEND πŸ’–

okay bestie, gather round, because this is the ledgercomm-send page from the LedgerCOMM CLI Manual and it's genuinely such a useful little tool. let's get into it ✨

🌸 NAME 🌸

ledgercomm-send β€” a CLI tool that sends APDUs to Ledger devices or to the Speculos emulator. that's the whole vibe. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

ledgercomm-send [OPTIONS] SUBCOMMAND [ARGUMENTS]

✨ DESCRIPTION ✨

so ledgercomm-send is a command-line tool that ships with the python-ledgercomm package, and what it does is send APDU (Application Protocol Data Unit) commands to Ledger Nano S/X hardware wallets β€” over the HID interface β€” or to the Speculos emulator β€” over a TCP socket. it's part of the ledgercomm Python library, which is the thing that handles talking back and forth with Ledger devices and the Speculos emulator, sending and receiving APDUs. 🫢

the tool can send APDUs from text files, from standard input, or from Ledger Live log files. and you can send them either in raw format (hexadecimal strings or bytes) or with structured parameters β€” like cla, ins, p1, p2, cdata. it's made for developers and users who are testing or interacting with Ledger devices or emulators. πŸ‘‘

quick heads up: when you're using the HID interface for actual physical Ledger devices, you need the python3-hidapi package, and the right udev rules have to be configured for the Ledger Nano S/X. but for TCP communication with Speculos? no extra dependencies needed at all, we love a low-effort queen. πŸ’…


πŸŽ€ OPTIONS πŸŽ€

  • --hid β€” use the HID interface to talk to physical Ledger Nano S/X devices instead of the default TCP interface that's meant for Speculos. πŸ”Œ
  • --server SERVER β€” tell it the IP address of the Speculos server. default is 127.0.0.1. 🌐
  • --port PORT β€” tell it the port of the Speculos server. default is 9999. πŸšͺ
  • --startswith PREFIX β€” filter APDUs so it only sends the ones starting with the prefix you specify (like "=>"). super useful when you're parsing a file with mixed content in it. πŸ”
  • -h, --help β€” shows the help message and dips. classic. πŸ’–

🧚 SUBCOMMANDS 🧚

  • file FILE β€” send APDUs from a text file. the file can hold APDUs as hexadecimal strings, optionally prefixed with a string like "=>". πŸ“„
  • stdin β€” read APDUs from standard input (like, through a pipe, bestie). πŸ“
  • log LOGFILE β€” send APDUs that get extracted from a Ledger Live log file. πŸ“œ

πŸ”₯ EXAMPLES πŸ”₯

send an APDU to the Speculos emulator via standard input:

echo "E003000000" | ledgercomm-send stdin

send an APDU to a Ledger Nano S/X device via HID:

ledgercomm-send --hid stdin

send APDUs from a file, filtering by a prefix:

ledgercomm-send --startswith "=>" file apdus.txt

and here's what the content of apdus.txt might look like:

# this line won't be sent if --startswith "=>" is used
=> E003000000
# another APDU to send
=> E004000000

🌈 DEPENDENCIES 🌈

for TCP communication with the Speculos emulator, no additional dependencies are required β€” nothing, zero, nada. ✨ for HID communication with Ledger Nano S/X devices though, the python3-hidapi package must be installed. and on top of that, the appropriate udev rules must be configured so your Ledger device is actually accessible.


πŸ’œ NOTES πŸ’œ

when you're running ledgercomm-send against a physical Ledger device, make sure the device is connected and the correct udev rules are set up (peep the Ledger documentation for the deets). and for Speculos? make sure the emulator is running and reachable at the --server and --port you specified. 🫑


πŸ‘‘ AUTHORS πŸ‘‘

  • Ledger <hello@ledger.fr> (upstream)
  • Debian packagers: Manuel Guerra <ar.manuelguerra@gmail.com>, Soren Stoutner <soren@debian.org>

🌸 SEE ALSO 🌸


and that's the whole page bestie!! this was version 1.2.1, dated May 2025 β€” tysm for reading, mwah, go send some APDUs πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from