Command reference
Exhaustive flag, environment-variable, and exit-code reference for every `lem` command. For task-oriented walkthroughs, see Querying Safe data and Proposing, signing & executing.
Synopsis
lem [GLOBAL OPTIONS] <command> [SUBCOMMAND] [OPTIONS]Top-level commands: connect, config, safe, tx.
You can always append --help (or -h) at any level for inline help, for example lem safe --help or lem tx propose --help.
Global options
Apply to every command.
--debug
bool
false
Verbose logs to stderr.
--timestamps
bool
false
Prefix log lines with ISO-8601 timestamps.
--pretty
bool
false
Pretty-print JSON output on stdout.
--version, -v
bool
false
Print the CLI version and exit.
--env <path>
string
.env
Env file to load before running.
--help, -h
bool
false
Display help.
Signer flags
Accepted by every command that produces a signature: connect, tx propose, tx sign, tx execute.
(none)
USB Ledger hardware wallet (default; required for mainnet).
--seed "<mnemonic>"
Software signer from a BIP-39 mnemonic. Mutually exclusive with --salt/--index.
--salt <string> --index <number>
Software signer derived deterministically from salt + index. Both flags are required together.
See Configuring a signer for security guidance.
Commands
lem connect
Pair a signing device and cache the resulting signer address + derivation path in ~/.config/les-multisig/config.json.
No command-specific options. Accepts the signer flags above.
lem config show
Print the cached signer config and the env vars lem has loaded.
Output: { "config": { "address", "derivationPath" }, "env": { ... } }. Mnemonics are never printed.
lem config path
Print the absolute path of the config file.
lem safe scan
List Safes owned by the connected signer across every supported chain. Requires lem connect to have run first.
lem safe info
Fetch on-chain configuration for a Safe (owners, threshold, nonce, version, modules, fallback handler, guard).
--address
yes
Safe address.
--chain-id
yes
Numeric EVM chain ID.
lem safe balances
Fetch native + ERC-20 token balances for a Safe.
Same options as lem safe info.
lem safe nonce
Return the next nonce to use when proposing a new transaction. Accounts for both executed and pending transactions.
Output is a single integer printed to stdout (not wrapped in JSON).
lem tx list
List transactions for a Safe. Defaults to pending only.
--address
yes
n/a
Safe address.
--chain-id
yes
n/a
Numeric chain ID.
--all
no
false
Include executed + rejected transactions.
--limit
no
n/a
Max results per page.
--offset
no
n/a
Initial offset for pagination.
lem tx show
Fetch a single transaction by safeTxHash.
--safe-tx-hash is also the default positional argument, so this form works too:
lem tx propose
Build, sign, and submit a new Safe transaction. Today this command is scoped to native ETH transfers. For richer payloads, use the Ledger Multisig UI or the API Kit.
--address
yes
Safe address.
--chain-id
yes
Numeric chain ID.
--to
yes
Destination address.
--value
yes
Amount to send, in wei.
lem tx sign
Add a signature to an existing Safe transaction.
The safeTxHash is the default positional argument and can also be passed as --safe-tx-hash.
Refuses to run when the transaction is already executed, the threshold is already met, or the connected signer has already confirmed.
lem tx execute
Submit a Safe transaction on-chain once the signature threshold is met. The executing signer pays gas.
The safeTxHash is the default positional argument and can also be passed as --safe-tx-hash.
Output:
Environment variables
lem ships with sane defaults for Ledger-hosted services in the distributed binary. You only need to set env vars when pointing the CLI at self-hosted or custom endpoints. Set them in your shell or in the file passed via --env.
SAFE_CLIENT_GATEWAY_URL
Safe Client Gateway endpoint (used by lem safe scan, lem safe info, and lem safe balances).
SAFE_TRANSACTION_SERVICE_MAINNET_URL
Transaction Service for Ethereum Mainnet (chainId 1).
SAFE_TRANSACTION_SERVICE_OPTIMISM_URL
Transaction Service for Optimism (chainId 10).
SAFE_TRANSACTION_SERVICE_BSC_URL
Transaction Service for BSC (chainId 56).
SAFE_TRANSACTION_SERVICE_BASE_URL
Transaction Service for Base (chainId 8453).
SAFE_TRANSACTION_SERVICE_ARBITRUM_URL
Transaction Service for Arbitrum (chainId 42161).
SAFE_TRANSACTION_SERVICE_SEPOLIA_URL
Transaction Service for Sepolia (chainId 11155111).
RPC_NODE_MAINNET_URL
RPC node for Ethereum Mainnet.
RPC_NODE_OPTIMISM_URL
RPC node for Optimism.
RPC_NODE_BSC_URL
RPC node for BSC.
RPC_NODE_BASE_URL
RPC node for Base.
RPC_NODE_ARBITRUM_URL
RPC node for Arbitrum.
RPC_NODE_SEPOLIA_URL
RPC node for Sepolia.
Exit codes
Every command exits with one of these codes. lem also emits a structured JSON error to stdout on failure, which makes agent integrations straightforward. See Building agent workflows.
0
SUCCESS
Command succeeded.
1
GENERAL_ERROR
Runtime failure (RPC error, signature rejected on device, transaction already executed, etc.).
2
VALIDATION_ERROR
Invalid or missing flags. Suggestion: Check '--help' for usage.
3
CONFIG_ERROR
No paired signer / corrupt config. Suggestion: Run connect to initialize a signing identity.
4
ENV_ERROR
Required env var missing or malformed.
Example failure payload on stdout:
Aliases
The CLI ships with two binary names. They are identical:
Next steps
Building agent workflows
Last updated