cli-structure

cli-structure is a cursor rule for Cursor from hiromaily/go-crypto-wallet. It costs 5 tokens per session (574 once invoked), scanned A, original, MIT.

Rules for arranging command-line commands in a cryptocurrency wallet. Commands use a consistent hierarchy of wallet type, action, and target, such as creating a key or sending a transaction.

In plain words
What is it for?
Use it when adding or reorganizing CLI commands for key generation, signing, importing, sending, or chain-node API calls. It also explains where special targets such as multisig belong.
Why use it?
It stops new commands from being placed inconsistently or becoming difficult to discover. A predictable structure makes the command interface easier to extend and use.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/hiromaily/go-crypto-wallet/cli-structure
Clone the repo
git clone --depth 1 https://github.com/hiromaily/go-crypto-wallet

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cli-structure

README.md
[![agentmods](https://agentmods.dev/badge/rules/hiromaily/go-crypto-wallet/cli-structure.svg)](https://agentmods.dev/rules/hiromaily/go-crypto-wallet/cli-structure)
Your own site
<a href="https://agentmods.dev/rules/hiromaily/go-crypto-wallet/cli-structure"><img src="https://agentmods.dev/badge/rules/hiromaily/go-crypto-wallet/cli-structure.svg" alt="Measured on agentmods" height="20"></a>
Per session 5 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 574 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00005 $0.00574
Opus 5 $0.00003 $0.00287
Sonnet 5 $0.00001 $0.00115
Haiku 4.5 $0.00001 $0.00057

Measured yesterday against content hash 5e7b8aa7f472, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cli-structure scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/internal/cli-structure.mdc · 72 lines

How it starts

The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLI Subcommand Structure Rules

Current command tree: internal/interface-adapters/cli/README.md

Rule 1: Command Hierarchy Order

CLI subcommands follow the order: [wallet type] → [verb] → [target]

<wallet>  <verb>     <target>
keygen    create     key
keygen    sign       tx
watch     import     address
watch     send       tx

Verb Layer contains action-oriented subcommands (e.g., create, sign, import, send).

Target Layer contains the object of the action (e.g., key, tx, address, multisig).

  • multisig is a target — it lives at the target layer under a verb (e.g., watch send multisig), not as a top-level verb.
  • Chain-specific API calls (e.g., api btc, api eth) are an exception: they are allowed as verbs to directly invoke chain node RPC commands. This exception applies only to low-level node API wrappers that do not fit naturally into the generic verb/target hierarchy.
# Standard pattern
keygen  create  key
keygen  create  multisig   ← multisig is a target

# Exception: chain API commands act as verbs
keygen  api  btc  <rpc-command>
watch   api  eth  <rpc-command>

Rule 2: Unsupported Coin Type Handling

Some CLI commands are only valid for specific chains. When a command is called with an unsupported coin type, do not silently skip — output a human-readable message indicating the command is recognized but not supported for that chain.

// ✅ GOOD: explicit unsupported message
switch coinType {
case coin.BTC, coin.BCH:
    cmd.AddCommand(newDescriptorCmd(btcClient))
default:
    fmt.Printf("[WARN] descriptor command is not supported for coin type: %s\n", coinType)
}
// ❌ BAD: silent no-op
switch coinType {
case coin.BTC, coin.BCH:
    cmd.AddCommand(newDescriptorCmd(btcClient))
// other coins simply get nothing — no feedback
}

The message format should follow the pattern:

[WARN] <command> command is not supported for coin type: <coinType>

Read the full file on GitHub · 72 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 72 lines · 5 tokens per session scan A 5e7b8aa7f472

Subscribe to this mod's changes

cli-structure is a cursor rule published in the GitHub repository hiromaily/go-crypto-wallet (127 stars, last pushed 4mo ago), licensed MIT. It adds 5 tokens to every session and 574 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.