LEDGERCOMM-SEND(1)
π 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 is127.0.0.1. π--port PORTβ tell it the port of the Speculos server. default is9999. πͺ--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 πΈ
- Full documentation at:
<https://github.com/LedgerHQ/ledgercomm> - Speculos emulator:
<https://github.com/LedgerHQ/speculos> - APDU specification:
<https://en.wikipedia.org/wiki/Smart_card_application_protocol_data_unit>
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
- ubuntu questing: ledgercomm 1.2.1-2
- ubuntu resolute: ledgercomm 1.2.1-3 Β· MIT
- ubuntu stonking: ledgercomm 1.2.1-4 Β· MIT
- Copyright 2025 Soren Stoutner <soren@debian.org> and Manuel Guerra <ar.manuelguerra@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms