File: ledgercomm-send.1

package info (click to toggle)
python-ledgercomm 1.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 164 kB
  • sloc: python: 297; makefile: 2
file content (117 lines) | stat: -rw-r--r-- 3,779 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
.\" Copyright 2025 Soren Stoutner <soren@debian.org> and Manuel Guerra <ar.manuelguerra@gmail.com>.
.\" Licensed under the MIT License.
.TH LEDGERCOMM\-SEND 1 "May 2025" "version 1.2.1" "LedgerCOMM CLI Manual"
.SH NAME
ledgercomm\-send \- CLI tool to send APDUs to Ledger devices or Speculos emulator
.SH SYNOPSIS
.B ledgercomm\-send
[\fI\,OPTIONS\/\fR] \fI\,SUBCOMMAND\/\fR [\fI\,ARGUMENTS\/\fR]
.SH DESCRIPTION
.B ledgercomm\-send
is a command-line tool provided by the
.B python-ledgercomm
package for sending APDU (Application Protocol Data Unit) commands to Ledger Nano S/X hardware wallets (via HID interface) or the Speculos emulator (via TCP socket). It is part of the
.B ledgercomm
Python library, which facilitates communication with Ledger devices and the Speculos emulator for sending and receiving APDUs.

The tool supports sending APDUs from text files, standard input, or Ledger Live log files. APDUs can be sent in raw format (hexadecimal strings or bytes) or using structured parameters (e.g.,
.B cla
,
.B ins
,
.B p1
,
.B p2
,
.B cdata
). It is designed for developers and users testing or interacting with Ledger devices or emulators.

When using the HID interface for physical Ledger devices, the
.B python3-hidapi
package is required, and appropriate udev rules must be configured for the Ledger Nano S/X. For TCP communication with Speculos, no additional dependencies are needed.
.SH OPTIONS
.TP
\fB\-\-hid\fR
Use the HID interface to communicate with physical Ledger Nano S/X devices instead of the default TCP interface for Speculos.
.TP
\fB\-\-server \fISERVER\fR
Specify the IP address of the Speculos server (default: 127.0.0.1).
.TP
\fB\-\-port \fIPORT\fR
Specify the port of the Speculos server (default: 9999).
.TP
\fB\-\-startswith \fIPREFIX\fR
Filter APDUs to only send those starting with the specified prefix (e.g., "=>"). Useful for parsing files with mixed content.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display the help message and exit.
.SH SUBCOMMANDS
.TP
\fBfile \fIFILE\fR
Send APDUs from a text file. The file can contain APDUs as hexadecimal strings, optionally prefixed with a string like "=>".
.TP
\fBstdin\fR
Read APDUs from standard input (e.g., via a pipe).
.TP
\fBlog \fILOGFILE\fR
Send APDUs extracted from a Ledger Live log file.
.SH EXAMPLES
.PP
Send an APDU to the Speculos emulator via standard input:
.PP
.nf
.RS
echo "E003000000" | ledgercomm\-send stdin
.RE
.fi
.PP
Send an APDU to a Ledger Nano S/X device via HID:
.PP
.nf
.RS
ledgercomm\-send \-\-hid stdin
.RE
.fi
.PP
Send APDUs from a file, filtering by a prefix:
.PP
.nf
.RS
ledgercomm\-send \-\-startswith "=>" file apdus.txt
.RE
.fi
.PP
Example content of
.B apdus.txt
:
.PP
.nf
.RS
# this line won't be sent if --startswith "=>" is used
=> E003000000
# another APDU to send
=> E004000000
.RE
.fi
.SH DEPENDENCIES
For TCP communication with the Speculos emulator, no additional dependencies are required. For HID communication with Ledger Nano S/X devices, the
.B python3-hidapi
package must be installed. Additionally, appropriate udev rules must be configured for the Ledger device to be accessible.
.SH NOTES
When using
.B ledgercomm\-send
with a physical Ledger device, ensure the device is connected and the correct udev rules are set up (see Ledger documentation for details). For Speculos, ensure the emulator is running and accessible at the specified
.B --server
and
.B --port
.
.SH AUTHORS
Ledger <hello@ledger.fr> (upstream)
.br
Debian packagers: Manuel Guerra <ar.manuelguerra@gmail.com>, Soren Stoutner <soren@debian.org>
.SH SEE ALSO
Full documentation at: <https://github.com/LedgerHQ/ledgercomm>
.br
Speculos emulator: <https://github.com/LedgerHQ/speculos>
.br
APDU specification: <https://en.wikipedia.org/wiki/Smart_card_application_protocol_data_unit>