-
Notifications
You must be signed in to change notification settings - Fork 20
feat: add wallet-cli skill #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c70cd1f
feat: add wallet-cli skill
roger-gan cddadf0
feat: add optional wallet-cli installer
roger-gan ad7aa89
docs: require password input via stdin
roger-gan 15f0f96
docs: make wallet administration human-only
roger-gan 4f27010
docs: refine wallet-cli agent guidance
roger-gan c3a36e6
fix(wallet-cli): clarify interface and installer requirements
roger-gan 84ed6d6
feat(wallet-cli): streamline skill installation
roger-gan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # TRON Wallet CLI Skill | ||
|
|
||
| Agent instructions for operating the TypeScript `wallet-cli` safely through its machine-readable | ||
| interface. The Skill covers TRON accounts, transfers, staking, governance, contracts, signing, and | ||
| chain queries and is pinned to `@tron-walletcli/wallet-cli@4.12.0`. | ||
|
|
||
| ## Installation | ||
|
|
||
| Choose either method below. Both install Skill version `1.0.0` and use | ||
| `@tron-walletcli/wallet-cli@4.12.0`. | ||
|
|
||
| ### Method 1: Install the CLI, then the Skill | ||
|
|
||
| Install the pinned npm CLI first, then install the Skill through the standard Skills CLI: | ||
|
|
||
| ```bash | ||
| npm install --global --no-fund --no-audit @tron-walletcli/wallet-cli@4.12.0 | ||
| npx skills add BofAI/skills --skill wallet-cli --global --yes | ||
| ``` | ||
|
|
||
| The `npx skills` command installs only the Skill; it does not install or update the `wallet-cli` | ||
| npm package. | ||
|
|
||
| ### Method 2: Install both with one script | ||
|
|
||
| On macOS, Linux, Git Bash, or WSL, run the repository installer: | ||
|
|
||
| ```bash | ||
| curl -fsSL https://raw.githubusercontent.com/BofAI/skills/main/wallet-cli/install.sh | sh | ||
| ``` | ||
|
|
||
| The script installs or verifies the pinned CLI and installs the Skill without prompting by default. | ||
| It requires a POSIX shell and standard utilities such as `mktemp`, `cp`, `mv`, and `mkdir`. | ||
|
|
||
| Use `--ask` to show the complete plan and require one confirmation, `--skill-only` to leave npm | ||
| packages unchanged, or `--dry-run` to preview the operation: | ||
|
|
||
| ```bash | ||
| curl -fsSL https://raw.githubusercontent.com/BofAI/skills/main/wallet-cli/install.sh | sh -s -- --ask | ||
| curl -fsSL https://raw.githubusercontent.com/BofAI/skills/main/wallet-cli/install.sh | sh -s -- --skill-only | ||
| curl -fsSL https://raw.githubusercontent.com/BofAI/skills/main/wallet-cli/install.sh | sh -s -- --dry-run | ||
| ``` | ||
|
|
||
| After either method, verify the CLI version: | ||
|
|
||
| ```bash | ||
| wallet-cli --version | ||
| ``` | ||
|
|
||
| ## Contents | ||
|
|
||
| - [SKILL.md](SKILL.md) — operational rules and version boundary | ||
| - [install.sh](install.sh) — one-command Skill and pinned CLI setup | ||
| - [references/commands.md](references/commands.md) — command-family routing | ||
| - [references/machine-interface.md](references/machine-interface.md) — JSON, exit-code, and transaction-state contract | ||
| - [references/safety.md](references/safety.md) — authorization, confirmation, secret, and retry rules | ||
|
|
||
| ## Requirements | ||
|
|
||
| - Node.js 20 or newer when installing the npm CLI | ||
| - Git, a POSIX shell, and standard POSIX utilities for the one-command installer | ||
| - Explicit network selection for chain operations | ||
|
|
||
| The Skill never authorizes an installer or Agent to collect wallet passwords, mnemonics, or private | ||
| keys. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| --- | ||
| name: wallet-cli | ||
| description: Operate the TypeScript TRON wallet CLI for accounts, transfers, staking, governance, contracts, signing, chain queries, and password input with wallet-cli 4.12.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 and SunSwap/DEX workflows elsewhere. | ||
| version: 1.0.0 | ||
| dependencies: | ||
| - "@tron-walletcli/wallet-cli@4.12.0" | ||
| tags: | ||
| - tron | ||
| - wallet | ||
| - cli | ||
| - transfer | ||
| - staking | ||
| - governance | ||
| --- | ||
|
|
||
| # 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 does not drive the repository's Java REPL and does not replace protocol-specific skills | ||
| such as SunSwap. Use a DEX skill for swaps or liquidity workflows and this skill for the wallet, | ||
| signing, resource, governance, and general TRON operations beneath them. 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 | ||
| wallet-cli --version | ||
| ``` | ||
|
|
||
| The required version is exactly `4.12.0`. | ||
|
|
||
| - If the command is missing, explain that the exact package | ||
| `@tron-walletcli/wallet-cli@4.12.0` must be installed and obtain user approval before running | ||
| `npm install -g @tron-walletcli/wallet-cli@4.12.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: `tron:mainnet`, `tron:nile`, or | ||
| `tron:shasta`. Never silently choose mainnet. Use `tron:nile` when the user explicitly asks for | ||
| a test but does not distinguish between testnets. | ||
| 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 leaf schema; other counters and configuration values may be JSON | ||
| numbers. Never use floating point for string amounts. | ||
| 5. Set `--timeout <ms>` when the surrounding task has a tighter deadline than the CLI's 60-second | ||
| default. | ||
| 6. Never infer that exit code `0` means a transaction confirmed. A submitted or reverted | ||
| transaction can still have a successful command envelope. | ||
|
|
||
| Read [references/machine-interface.md](references/machine-interface.md) before implementing result | ||
| parsing, polling, pagination, retry logic, or non-interactive secret input. | ||
|
|
||
| ## Discover commands instead of guessing | ||
|
|
||
| Prefer the CLI's generated schema over recalled flags: | ||
|
|
||
| ```bash | ||
| wallet-cli --json-schema | ||
| wallet-cli tx send --json-schema | ||
| wallet-cli permission update --json-schema | ||
| ``` | ||
|
|
||
| Use `wallet-cli <command> --help` only when human-oriented semantics are needed. Do not invent a | ||
| flag, option combination, output field, or command that is absent from the 4.12.0 schema. | ||
|
|
||
| Read [references/commands.md](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. | ||
| - 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](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. | ||
| - 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 | ||
|
|
||
| - Prefer `--wait` when the command supports it and the task can tolerate waiting. After it returns, | ||
| inspect `data.stage`; `failed` is an on-chain failure even when the process exits `0`. | ||
| - Otherwise retain the `txId` and poll `tx status` until `confirmed` or `failed`, with a finite | ||
| deadline. `pending` and `not_found` are non-terminal. | ||
| - GasFree transfers return a `traceId`; follow them with `gasfree trace`, not `tx status`. | ||
| - After a timeout or ambiguous submission, reconcile the transaction before retrying. 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 new package's bundled `skills/wallet-cli/SKILL.md`, | ||
| `docs/machine-interface.md`, `docs/commands/index.md`, and generated `--json-schema` output. Re-test | ||
| the confirmation matrix, secret channels, exit codes, transaction stages, and warning codes before | ||
| bumping this skill's version. Do not widen the exact dependency pin without user approval. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| interface: | ||
| display_name: "TRON Wallet CLI" | ||
| short_description: "Operate TRON wallets safely with wallet-cli" | ||
|
|
||
| policy: | ||
| allow_implicit_invocation: true |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think is better to warn the high risk commands in SKILL
these four commands are high risk operations which are designed for human only is not allowed to be invoked by agent.