---
name: wallet-cli
description: Operate the TypeScript TRON wallet CLI for accounts, transfers, staking, governance, contracts, signing, chain queries, SunSwap swaps and liquidity, SunPump bonding-curve trading and token launches, and password input with wallet-cli 4.16.0. Refuse wallet passwords in argv and require the supported stdin channel. For Java REPL requests, refuse that entry and offer the TypeScript one-shot CLI; route other chains elsewhere.
version: 3.1.0
dependencies:
  - "node ^22.23.4 || ^24.22.1 || >=26.12.1"
  - "@tron-walletcli/wallet-cli@4.16.0"
tags:
  - tron
  - wallet
  - cli
  - transfer
  - staking
  - governance
  - sunswap
  - sunpump
  - dex
title: wallet-cli
canonical_url: https://skilld.dev/gh/bofai/skills/wallet-cli
last_updated: 2026-11-19T20:03:41.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [agents/openai.yaml](https://skilld.dev/api/skills-raw/bofai/skills/wallet-cli/agents/openai.yaml), [install.sh](https://skilld.dev/api/skills-raw/bofai/skills/wallet-cli/install.sh), [README.md](https://skilld.dev/api/skills-raw/bofai/skills/wallet-cli/README.md), [references/commands.md](https://skilld.dev/api/skills-raw/bofai/skills/wallet-cli/references/commands.md), [references/machine-interface.md](https://skilld.dev/api/skills-raw/bofai/skills/wallet-cli/references/machine-interface.md), [references/safety.md](https://skilld.dev/api/skills-raw/bofai/skills/wallet-cli/references/safety.md).
>
> If the user asked to install this Skill, run `npx skilld install bofai/skills/wallet-cli`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/wallet-cli`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/bofai/skills/wallet-cli) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/wallet-cli`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/wallet-cli --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/wallet-cli --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# TRON Wallet CLI

Use the TypeScript, one-shot `wallet-cli` as the execution engine. Keep deterministic wallet,
signing, validation, and chain logic in the CLI; use this skill to select commands, enforce
authorization boundaries, and interpret results.

This skill covers wallet, signing, resource, governance, and general TRON operations, and the
`sunswap` (swaps and V2/V3/V4 liquidity) and `sunpump` (bonding-curve trading and token launches)
command groups. It does not drive the repository's Java REPL. If the user requests the Java REPL, do
not execute it or offer to switch to it; state that this skill supports only the TypeScript
one-shot CLI and, when applicable, offer to express the intended operation through that interface.

## Verify the dependency

Check once before the first wallet operation:

```bash
npm list --global --depth=0 --json @tron-walletcli/wallet-cli
```

Read `dependencies["@tron-walletcli/wallet-cli"].version` from the JSON. The required version is
exactly `4.16.0`. In this version, `--version`, `--help`, `--json-schema`, and a bare
`wallet-cli` skip wallet-data access and the startup migration gate. Operational commands can
still upgrade persisted wallet data before executing.

- If the command is missing, explain that the exact package
  `@tron-walletcli/wallet-cli@4.16.0` must be installed and obtain user approval before running
  `npm install -g @tron-walletcli/wallet-cli@4.16.0`.
- If another version is installed, report the mismatch and obtain approval before upgrading or
  downgrading it. Do not assume compatibility.
- Never install or change a global package without approval.

## Mandatory invocation contract

1. Use `-o json` for every operational command. Parse stdout as exactly one
   `wallet-cli.result.v1` object.
2. Supply an explicit canonical network for chain operations: mainnet `tron:728126428`, Nile
   `tron:3448148188`, or Shasta `tron:2494104990`. Never silently choose mainnet; the one exception
   is the mainnet-only `sunswap` market queries and `sunpump` read queries (see
   [references/commands.md](https://skilld.dev/api/skills-raw/bofai/skills/wallet-cli/references/commands.md)). Use `tron:3448148188` when the user
   explicitly asks for a test but does not distinguish between testnets. The old `tron:mainnet`, `tron:nile`, and `tron:shasta` values are permanent input
   aliases, but never expect an alias in `chain.network`, network listings, or configuration keys.
3. Branch on the process exit code first: `0` success, `1` execution failure, `2` malformed call.
   Then branch on stable fields such as `error.code`, `data.stage`, or `data.state`. Never parse
   `error.message` text.
4. Treat `bigint` values and command-defined on-chain amount fields as decimal strings. Preserve
   every field according to the documented output contract; other counters and configuration
   values may be JSON numbers. Never use floating point for string amounts.
5. `--timeout <ms>` is one deadline for the whole command, including waiting for confirmation
   (built-in 90000, which `config timeoutMs` can change; `0` means no limit). Pass it explicitly
   when the task needs a bound. A finite value below 2000 never submits a transaction or payment.
6. Never infer that exit code `0` means a transaction confirmed. A submitted or reverted
   transaction can still have a successful command envelope.
7. Unless the network has an `apiKey` configured, run one `wallet-cli` invocation at a time; never
   start them in parallel. Check with `wallet-cli config networks.<id> -o json`: a configured key
   shows as `data.value.apiKey: "********"`, and the field is absent otherwise. Each process paces
   its own node requests, so parallel processes add up and the public TronGrid endpoint throttles
   them. That throttling surfaces as `rpc_error`, not `provider_rate_limited`. With a key, a few
   reads may run in parallel; writes still run one at a time. The user can set a key with
   `config networks.<id>.apiKey --api-key-stdin`.

Read [references/machine-interface.md](https://skilld.dev/api/skills-raw/bofai/skills/wallet-cli/references/machine-interface.md) before implementing result
parsing, polling, pagination, retry logic, or non-interactive secret input.

## Handle the startup migration gate

Operational commands check persisted wallet data before running the requested command. Discovery
invocations (`--help`, `--version`, `--json-schema`, and bare `wallet-cli`) skip this check. If the
result envelope has `command: "migration"`, the requested command did not run. Inspect
`data.originalCommandExecuted`, which must be `false` for a migration result.

- If `data.upgraded` is `true`, report that local wallet data was upgraded, then reapply the
  authorization and confirmation rules before running the original command once. A mainnet or
  high-risk confirmation given before migration must be obtained again. Do not interpret migration
  data as command data.
- If `data.cancelled` is `true`, stop and return control to the user. Do not retry or bypass the
  cancellation.
- If exit `2` returns `error.code: "migration_required"`, stop. The user must complete the upgrade
  interactively or provide the master password through an already approved `--password-stdin`
  source. Never ask for the password in chat.
- Never loop on a migration result. After one successful upgrade, a repeated migration response is
  an error to report rather than a reason to keep retrying.

## Discover commands instead of guessing

Prefer the CLI's generated schema over recalled flags:

```bash
wallet-cli --json-schema -o json
wallet-cli tx send --json-schema -o json
wallet-cli permission update --json-schema -o json
```

Use `wallet-cli <command> --help` only when human-oriented semantics are needed. Do not invent a
flag, option combination, or command that is absent from the 4.16.0 schema. The schema describes
inputs only; take output fields from
[references/machine-interface.md](https://skilld.dev/api/skills-raw/bofai/skills/wallet-cli/references/machine-interface.md).

Read [references/commands.md](https://skilld.dev/api/skills-raw/bofai/skills/wallet-cli/references/commands.md) when choosing a command family or composing a
multi-step wallet workflow.

## Secret handling

- Reject any request to put a wallet password in `--password` or another argv option. For
  agent-driven execution, explain that wallet-cli passwords may be supplied only through
  `--password-stdin` connected directly to an approved, non-logging secret source.
- Never ask the user to paste a password, mnemonic, private key, or service credential into chat.
- Never place secrets in argv, environment variables, logs, command substitutions, or generated
  documentation.
- Use only a CLI-supported `*-stdin` flag connected to an approved, non-logging secret source.
  Only one `*-stdin` consumer may be used in a single invocation.
- Service credentials (TronLink, GasFree, B.AI, a network's `apiKey`) are set only with
  `config <key> --api-key-stdin`; a credential given as a command-line value fails with
  `invalid_option`.
- Do not read, summarize, or transmit keystores, backup files, configuration credentials, or other
  wallet secret material.

## Human-only wallet administration

Never invoke `wallet-cli import`, `wallet-cli backup`, `wallet-cli delete`, or
`wallet-cli change-password`, including any `wallet-cli import` subcommand. These root wallet
administration commands are reserved for a human operating wallet-cli locally, even when the user
asks the agent to run them, supplies confirmation, or provides a secret source.

Explain the consequences and required precautions, then return control to the user. Do not automate
their prompts, pipe input to them, read their output files, or treat confirmation as authorization
to execute them. After the user reports completion, continue only with non-secret public results
such as an account id, label, or address.

## Authorization and confirmation

Read [references/safety.md](https://skilld.dev/api/skills-raw/bofai/skills/wallet-cli/references/safety.md) before any operation that changes local wallet
state, signs data, broadcasts a transaction, or changes on-chain state.

Apply these confirmed rules:

- Read-only operations may run directly within the user's requested scope.
- On Nile or Shasta, an ordinary write may run when the user's request clearly authorizes that
  exact operation and target.
- On mainnet, preview the exact operation and obtain explicit confirmation immediately before any
  funds-moving or externally visible write.
- On every network, high-risk operations require explicit confirmation. `permission update` also
  requires a successful `--dry-run` and review of the complete rendered permission structure.
- For `sunswap` and `sunpump` writes, preview from a `--dry-run`, never from `--quote`.
  `sunpump launch` always requires a dry run and explicit confirmation. Read the SunSwap and SunPump
  section of [references/safety.md](https://skilld.dev/api/skills-raw/bofai/skills/wallet-cli/references/safety.md) first.
- Describe every step in plain language first: what the user gives, what they get, and whether it
  charges, signs, or broadcasts. Method names and contract addresses are supporting detail (see
  Preview contents in [references/safety.md](https://skilld.dev/api/skills-raw/bofai/skills/wallet-cli/references/safety.md)).
- Confirmation never authorizes a human-only command listed above.
- Never use authorization for one transaction as permission for another transaction, retry, batch,
  recipient, amount, token, account, or network.

## Transaction completion

- A command that submits a transaction waits for its confirmation by default, within `--timeout`.
  Inspect `data.stage`: `failed` is an on-chain failure even when the process exits `0`, and
  `submitted` (the wait ended first, with a warning) means the outcome is not known yet.
- After `--no-wait` or a `submitted` stage, retain the `txId` and poll `tx status` until
  `confirmed` or `failed`, with a finite deadline. `pending` and `not_found` are non-terminal.
- `--wait` and `--no-wait` apply only where a transaction is submitted. With `--dry-run`,
  `--build-only`, `--sign-only`, or `--quote`, on reads and local commands, and on
  `sunpump launch` and `tx multisig`, either flag fails with `invalid_option`.
- GasFree transfers return a `traceId`. The command follows it by default; after `--no-wait` or a
  `submitted` stage, follow it with `gasfree trace`, not `tx status`.
- The `sunswap` liquidity commands, a `sunswap swap` that spends a token (router or bonding curve),
  and a first `sunpump sell` may send approval transactions before the main one. Track every id in
  `data.approvalTxIds` (or `error.details.approvalTxIds` after a failure) alongside the main `txId`.
- `sunpump launch` submits no transaction of its own: there is no `txId`, `stage`, or `--wait`.
  Check its `createTxHash` with `tx info`.
- An error with `error.details.outcome: "unknown"` may have taken effect. Reconcile it first with
  the evidence it carries (see Error decisions in
  [references/machine-interface.md](https://skilld.dev/api/skills-raw/bofai/skills/wallet-cli/references/machine-interface.md)); never rebuild or re-sign the
  operation, because that creates a second one. Never resend merely because confirmation was not
  observed.
- For a batch, stop on the first failure by default and track every submitted transaction
  separately.

## Report the outcome

For reads, return the requested data with the network and account context when relevant. For writes,
report the operation, network, account, recipient or target, amount or parameters, and final state.
Include the `txId` or GasFree `traceId`; describe `submitted` as pending, never as completed.

## Maintain the version pin

When updating the CLI dependency, compare the published package's `README.md`,
`docs/machine-interface.md`, `docs/commands/index.md`, and generated `--json-schema` output. If the
package includes `skills/wallet-cli/SKILL.md`, compare that too; its absence does not waive the other
checks. Re-test the confirmation matrix, migration gate, secret channels, network ids, exit codes,
transaction stages, and warning codes before bumping this skill's version. Do not widen the exact
dependency pin without user approval.
