You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`bootstrap`| Composition root + process lifecycle (`runner.ts`, `composition.ts`, `argv.ts`, `families/`) | all areas | — (assembly only) |
47
+
48
+
Key points:
49
+
-**Ports live in `application/ports/`** (e.g. `wallet-repository`, `tron-gateway`, `ledger-device`,
50
+
`price-provider`); outbound adapters implement them (dependency inversion).
51
+
-**Chain-family differences** are isolated in the `tron` family — `application/use-cases/tron/`,
52
+
`adapters/outbound/chain/tron/`, and the family plugin under `bootstrap/families/`. EVM is planned,
53
+
not yet public.
54
+
-**A single Zod schema per command** drives validation, yargs arity, help text, and JSON Schema.
55
+
-**Secrets** (private keys, mnemonics, BIP39 passphrases) are encrypted at rest and never accepted
56
+
from argv or env — only a dedicated stdin channel or hidden TTY prompt.
57
+
58
+
### Adding a TypeScript command
59
+
60
+
1. Add the command module under `adapters/inbound/cli/commands/` with its Zod schema.
61
+
2. Route it to an application use case (`application/use-cases/…`, e.g. `tron/transaction-service.ts`);
62
+
do not put I/O or chain logic in the inbound layer.
63
+
3. If it needs new I/O, define a **port** in `application/ports/` and implement it in
64
+
`adapters/outbound/`. Wire it in `bootstrap/composition.ts`.
65
+
4. Add co-located `*.test.ts` and run `npm run depcruise && npm run typecheck && npm test`.
66
+
5
67
## Build & Run
6
68
7
69
```bash
@@ -49,7 +111,7 @@ This is a **TRON blockchain CLI wallet** built on the [Trident SDK](https://gith
49
111
50
112
### Two CLI Modes
51
113
52
-
1.**REPL 交互模式** (human-friendly) — `Client` class with JCommander `@Parameters` inner classes. Entry point: `org.tron.walletcli.Client`. Features tab completion, interactive prompts, and conversational output. This is the largest file (~4700 lines). Best for manual exploration and day-to-day wallet management by humans.
114
+
1.**REPL 交互模式** (human-friendly) — `Client` class with JCommander `@Parameters` inner classes. Entry point: `org.tron.walletcli.Client`. Features tab completion, interactive prompts, and conversational output. This is the largest file (~4900 lines). Best for manual exploration and day-to-day wallet management by humans.
53
115
2.**Standard CLI 模式** (AI-agent-friendly) — `StandardCliRunner` with `CommandRegistry`/`CommandDefinition` pattern in `org.tron.walletcli.cli.*`. Supports `--output json`, `--network`, `--quiet` flags. Commands are registered in `cli/commands/` classes (e.g., `WalletCommands`, `TransactionCommands`, `QueryCommands`). Designed for automation: deterministic exit codes, structured JSON output, no interactive prompts, and env-var-based authentication — ideal for AI agents, scripts, and CI/CD pipelines.
54
116
55
117
The standard CLI suppresses all stray stdout/stderr in JSON mode to ensure machine-parseable output. Authentication is automatic via `MASTER_PASSWORD` env var + keystore files in `Wallet/`.
@@ -59,7 +121,7 @@ The standard CLI suppresses all stray stdout/stderr in JSON mode to ensure machi
59
121
Before changing parser behavior, auth flow, JSON output, command success/failure semantics, or `qa/` expectations for
60
122
the standard CLI, read:
61
123
62
-
-`docs/standard-cli-contract-spec.md`
124
+
-`java/docs/standard-cli-contract-spec.md`
63
125
64
126
Treat that file as the source of truth for the standard CLI contract unless the repository owner explicitly decides to
0 commit comments