> For the complete documentation index, see [llms.txt](https://help.multisig.ledger.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.multisig.ledger.com/guides/cli-guides/command-reference.md).

# Command reference

### 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.

| Flag          | Type   | Default | Description                                |
| ------------- | ------ | ------- | ------------------------------------------ |
| --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.

| Flag                               | Description                                                                                    |
| ---------------------------------- | ---------------------------------------------------------------------------------------------- |
| *(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.

```
lem connect [SIGNER FLAGS]
```

No command-specific options. Accepts the signer flags above.

#### `lem config show`

Print the cached signer config and the env vars `lem` has loaded.

```
lem config show [--pretty]
```

Output: { "config": { "address", "derivationPath" }, "env": { ... } }. Mnemonics are never printed.

#### `lem config path`

Print the absolute path of the config file.

```
lem config path
```

#### `lem safe scan`

List Safes owned by the connected signer across every supported chain. Requires `lem connect` to have run first.

```
lem safe scan [--pretty]
```

#### `lem safe info`

Fetch on-chain configuration for a Safe (owners, threshold, nonce, version, modules, fallback handler, guard).

```
lem safe info --address <safe> --chain-id <id> [--pretty]
```

| Flag       | Required | Description           |
| ---------- | -------- | --------------------- |
| --address  | yes      | Safe address.         |
| --chain-id | yes      | Numeric EVM chain ID. |

#### `lem safe balances`

Fetch native + ERC-20 token balances for a Safe.

```
lem safe balances --address <safe> --chain-id <id> [--pretty]
```

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.

```
lem safe nonce --address <safe> --chain-id <id>
```

Output is a single integer printed to stdout (not wrapped in JSON).

#### `lem tx list`

List transactions for a Safe. Defaults to **pending only**.

```
lem tx list \
  --address <safe> \
  --chain-id <id> \
  [--all] [--limit <n>] [--offset <n>] [--pretty]
```

| Flag       | Required | Default | Description                               |
| ---------- | -------- | ------- | ----------------------------------------- |
| --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.

```
lem tx show --safe-tx-hash <hash> [--pretty]
```

\--safe-tx-hash is also the default positional argument, so this form works too:

```
lem tx show <hash> --chain-id <id>
```

#### `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.

```
lem tx propose \
  --address <safe> \
  --chain-id <id> \
  --to <recipient> \
  --value <wei> \
  [SIGNER FLAGS]
```

| Flag       | Required | Description                 |
| ---------- | -------- | --------------------------- |
| --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.

```
lem tx sign --chain-id <id> <safeTxHash> [SIGNER FLAGS]
```

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.

```
lem tx execute --chain-id <id> <safeTxHash> [SIGNER FLAGS]
```

The safeTxHash is the default positional argument and can also be passed as --safe-tx-hash.

Output:

```
{
  "safeTxHash": "0x...",
  "transactionHash": "0x...",
  "status": "submitted"
}
```

### 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`.

| Variable                                  | Purpose                                                                                           |
| ----------------------------------------- | ------------------------------------------------------------------------------------------------- |
| 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**.

| Code | Name              | Meaning                                                                                        |
| ---- | ----------------- | ---------------------------------------------------------------------------------------------- |
| 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:

```
{
  "error": {
    "code": "CONFIG_ERROR",
    "message": "No session found. Please run `device` first.",
    "suggestion": "Run connect to initialize a signing identity."
  }
}
```

### Aliases

The CLI ships with two binary names. They are identical:

```
lem                          # short form, recommended
ledger-enterprise-multisig   # long form, for environments where `lem` collides
```

### Next steps

* **Building agent workflows**
