Ledger wallet cli

From LedgerHQ/ledger-live · View interactive version

Ledger wallet cli is an AI agent skill from the GitHub repository LedgerHQ/ledger-live. Official Ledger wallet-cli. Send, pay or transfer crypto from the user's Ledger hardware wallet: ETH, USDC, USDT and other ERC-20 tokens, BTC and SOL to an address. Works without the device on this machine too (cloud agent, VPS, container): Agent Intent proposes Ethereum and Solana payments (ETH, ER

How to use this skill

Skill file

wallet-cli

Networks: bitcoin, ethereum, solana (mainnets and testnets).

Run from repo root: pnpm --silent wallet-cli start <command> [flags]

When this skill disagrees with pnpm --silent wallet-cli start <command> --help, the help output wins.

Capabilities

| Command | Device (USB) | OS keychain | Network | Human step |

|---|---|---|---|---|

| session view | no | no | no | no |

| session reset | no | yes (writes the state dir, may check the ring credential) | no | no |

| account discover | yes | no | yes | approve app on device |

| receive | yes (no with --no-verify) | no | yes | compare address on device |

| balances, operations | no | no | yes | no |

| send | yes (no with --dry-run) | no | yes | approve on device |

| genuine-check | yes | no | yes | device on dashboard |

| swap quote | no | optional (API auth key) | yes | no |

| swap status | no | no | yes | no |

| swap execute | yes | optional (API auth key) | yes | approve on device |

| assets token / token-by-id | no | no | yes (Ledger crypto-assets service) | no |

| earn yields / positions | no | no | yes | no |

| earn deposit / withdraw | yes (no with --dry-run) | no | yes | approve on device |

| ring init | yes | yes | yes | user provides WALLET_PASS, approve on device |

| ring encrypt / decrypt | no | yes | yes | no |

| ring keys | no | no | no | no |

| ring destroy | no | yes | yes | typed destroy |

| agent-intent enroll / recover | no | yes (recover: no for a plaintext-file profile) | yes | open link, compare fingerprint, approve on device; a background listener waits (enroll --detach) or the command itself (recover) |

| agent-intent list / show / wait | no | no | no | no |

| agent-intent sync / intents / status | no | yes (no for a plaintext-file profile) | yes | no |

| agent-intent send | no | yes (no with --dry-run or for a plaintext-file profile) | yes (dry run: looks up the token) | human approves or rejects the intent via the review link |

| agent-intent swap | no | yes (no with --dry-run or for a plaintext-file profile), plus optional API auth key | yes (dry run: fetches quotes) | human approves or rejects the intent via the review link |

| agent-intent cancel | no | yes (no for a plaintext-file profile) | yes | the human asks to cancel that intent; pass --yes only then |

A plaintext-file profile has keyStore "plaintext-file" in agent-intent show: its agent key is in a file, not the OS keychain (agent-intent.md, step 2).

API auth key. Every command that fetches swap quotes (swap quote, swap execute, agent-intent swap, dry run included) reads Ledger's API auth key from the OS keychain. Without a usable keychain it still quotes, unauthenticated, and prints a Ledger API auth key warning on stderr; on macOS the keychain may show an access prompt. Optional means it runs inside the host sandbox too.

Safety rules

Otherwise the human typed every value in this conversation, so run the command directly: the device screen, or the Agent Intent review link, is the confirmation, and a second prompt only adds fatigue. swap execute has no --dry-run: its quote is the preview (swap.md). For a first-time Ethereum vault deposit, the dry run validates only the approve (earn.md).

No USB on this machine

On a remote box or container (a cloud agent such as Grok Bot, a VPS, CI), the Ledger is never attached to your machine. Run only rows with Device = no.

Payments and swaps go through Agent Intent. Load references/agent-intent.md and start at its status gate when the human asks to send, pay or transfer ETH or an ERC-20 token on Ethereum mainnet, or SOL or an SPL token on Solana mainnet (a payment proposal, step 7), or to swap between ETH and ERC-20 tokens on Ethereum mainnet (agent-intent swap, step 8). For any other asset, network or swap, hand the human the command as below.

For any other Device = yes row, hand the human a command: the exact wallet-cli ... line to run on their own computer with the Ledger plugged in, and ask them to report the result. Labels are per machine: use the label their own pnpm --silent wallet-cli start session view shows (ask them for it, or have them run session view first). When the dry-run rule applies, hand over the --dry-run line first.

[✖] Ledger not detected. Plug in, unlock, retry. (exit code 3) means this machine has no usable Ledger: tell the human the device was not detected, apply Payments and swaps go through Agent Intent first, and hand them the command only for what it does not cover. Re-run the device command yourself only after the human confirms the Ledger is plugged into this machine and unlocked, and after any intent you proposed for the same payment reads cancelled (agent-intent.md step 9): otherwise the human can approve both and pay twice. Leave USB discovery to wallet-cli; the exit code already answers whether a device is attached.

Commands that set up the machine they run on are the exception: account discover stores labels in that machine's session, and ring init stores a credential in that machine's keychain. Handing them over sets up the human's computer, not yours. On a remote box, skip them: for a proposal, agent-intent.md steps 7 and 8 find the sender. When any other command needs an account or address the human did not give, offer their accounts to pick from (session view labels, and on an enrolled profile the Ledger Sync import, agent-intent.md step 6) before asking them to type an address. Tell them the Ledger Key Ring cannot be set up on this machine.

Speculos

When SPECULOS_API_PORT is set, device commands talk to a Speculos emulator over HTTP instead of a USB Ledger (SPECULOS_DEVICE names the model). Use it only when the user set it up. Speculos cannot approve on-device prompts, so stick to flows like account discover: a prompt to open the app gives up after --device-timeout (exit code 6), and an unanswered signing or address verification prompt blocks for about 5 minutes before it exits with code 1 (GeneralDmkError); genuine-check refuses to run on it. The sandbox lets HTTP to a local Speculos through, but account discover still needs dangerouslyDisableSandbox: true: it saves the found accounts to session.yaml in the user state dir, which the sandbox cannot write. Inside the sandbox the scan still exits 0, but the accounts are not saved (⚠ Found accounts were NOT saved to the session).

Session first and labels

With no specific task, run pnpm --silent wallet-cli start session view immediately, show the result, then ask what to do next. When labels already exist, skip account discover.

account discover stores each account under a label <network>[-derivation]-<n>, e.g. ethereum-1, bitcoin-native-1, ethereum_sepolia-1. Every --account flag takes a label.

Intent map

| User says | Do |

|---|---|

| no specific task, "show me my wallet", "let's get started" | session view, immediately |

| "find my accounts", "set up Ethereum/Bitcoin" | account discover <network> |

| "give me my address", "deposit address" | receive <label> |

| "what's my ETH balance" | balances <label> |

| "transaction history", "recent activity" | operations <label> |

| "send 0.1 BTC to ...", "transfer", "pay" from their own Ledger | send <label> --to <address> --amount '<n> <TICKER>', dry run per Safety rules; on a machine with no USB, see No USB on this machine |

| "swap A to B", "convert", "trade" | swap quote, swap execute, swap status; load references/swap.md; on a machine with no USB, see No USB on this machine |

| "staking rates", "stake my SOL", "unstake", "my positions" | earn yields, positions, deposit, withdraw; load references/earn.md |

| "is my Ledger genuine", "verify authenticity" | genuine-check, device on the dashboard |

| "which token is this contract", token id for a swap | assets token <network> <address> or assets token-by-id <id> |

| "encrypt this file with my Ledger", "my ring keys", "wipe my key ring" | ring init, encrypt, decrypt, keys, destroy; load references/ring.md |

| "enroll this agent", "show my agent-intent profiles", "import my Ledger Wallet accounts", "propose a payment for my approval", "propose a swap for my approval", "recover this agent" | load references/agent-intent.md and start at its status gate |

| "is my payment approved", "what did the agent propose", "cancel that proposal" | load references/agent-intent.md, pass its status gate, then step 9 |

| "start over", "clear my session", "I switched devices" | session reset |

Out of scope

When asked for any of these, tell the human wallet-cli does not support it yet:

Core commands

Exact flags: pnpm --silent wallet-cli start <command> --help. Add --output json when you parse the result.

pnpm --silent wallet-cli start session view
pnpm --silent wallet-cli start account discover ethereum      # also bitcoin, solana, ethereum_sepolia, bitcoin_testnet, solana_devnet
pnpm --silent wallet-cli start receive ethereum-1             # --no-verify skips the device check
pnpm --silent wallet-cli start balances ethereum-1 --output json
pnpm --silent wallet-cli start operations ethereum-1 --limit 20 --cursor <cursor>
pnpm --silent wallet-cli start send ethereum-1 --to 0xDEF... --amount '0.5 ETH' --dry-run

References: load when

The paths are relative to this skill's folder. If you read this skill through skill retrieve rather than from disk, load a reference with pnpm --silent wallet-cli start skill retrieve wallet-cli-usage --file references/<name>.md.

| Reference | Load when |

|---|---|

| CODE0 | the request is about enrolling or recovering an agent, agent-intent profiles, importing accounts from Ledger Sync, proposing a payment or swap for approval, or checking or cancelling a proposal; or you are about to run any pnpm --silent wallet-cli start agent-intent command |

| CODE0 | before any pnpm --silent wallet-cli start ring command |

| CODE0 | before any pnpm --silent wallet-cli start swap command |

| CODE0 | before any pnpm --silent wallet-cli start earn command |

| CODE0 | a command outside agent-intent exits non-zero or prints [✖], before you retry it |

| CODE0 | the human asks why something works the way it does, or you need to justify a safety rule |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.