@aura-protocol/cli 0.1.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/README.md +84 -53
  2. package/bin/aura.js +0 -0
  3. package/dist/commands/confidential.d.ts +1 -1
  4. package/dist/commands/confidential.js +280 -325
  5. package/dist/commands/confidential.js.map +1 -1
  6. package/dist/commands/config.d.ts +1 -1
  7. package/dist/commands/config.js +26 -8
  8. package/dist/commands/config.js.map +1 -1
  9. package/dist/commands/dashboard.d.ts +1 -1
  10. package/dist/commands/dashboard.js +6 -7
  11. package/dist/commands/dashboard.js.map +1 -1
  12. package/dist/commands/dwallet.d.ts +1 -1
  13. package/dist/commands/dwallet.js +52 -41
  14. package/dist/commands/dwallet.js.map +1 -1
  15. package/dist/commands/execution.d.ts +1 -1
  16. package/dist/commands/execution.js +111 -175
  17. package/dist/commands/execution.js.map +1 -1
  18. package/dist/commands/features.d.ts +1 -1
  19. package/dist/commands/features.js +15 -10
  20. package/dist/commands/features.js.map +1 -1
  21. package/dist/commands/generated.d.ts +20 -0
  22. package/dist/commands/generated.js +61 -0
  23. package/dist/commands/generated.js.map +1 -0
  24. package/dist/commands/governance.d.ts +1 -1
  25. package/dist/commands/governance.js +113 -99
  26. package/dist/commands/governance.js.map +1 -1
  27. package/dist/commands/helpers.d.ts +5 -2
  28. package/dist/commands/helpers.js +79 -16
  29. package/dist/commands/helpers.js.map +1 -1
  30. package/dist/commands/instruction-exec.d.ts +27 -0
  31. package/dist/commands/instruction-exec.js +171 -0
  32. package/dist/commands/instruction-exec.js.map +1 -0
  33. package/dist/commands/instruction.d.ts +9 -0
  34. package/dist/commands/instruction.js +81 -0
  35. package/dist/commands/instruction.js.map +1 -0
  36. package/dist/commands/pda.d.ts +1 -1
  37. package/dist/commands/pda.js +15 -7
  38. package/dist/commands/pda.js.map +1 -1
  39. package/dist/commands/treasury.d.ts +1 -1
  40. package/dist/commands/treasury.js +201 -186
  41. package/dist/commands/treasury.js.map +1 -1
  42. package/dist/core/config.d.ts +35 -0
  43. package/dist/core/config.js +97 -0
  44. package/dist/core/config.js.map +1 -0
  45. package/dist/core/context.d.ts +51 -0
  46. package/dist/core/context.js +60 -0
  47. package/dist/core/context.js.map +1 -0
  48. package/dist/core/errors.d.ts +38 -0
  49. package/dist/core/errors.js +138 -0
  50. package/dist/core/errors.js.map +1 -0
  51. package/dist/core/network.d.ts +18 -0
  52. package/dist/core/network.js +38 -0
  53. package/dist/core/network.js.map +1 -0
  54. package/dist/core/runner.d.ts +45 -0
  55. package/dist/core/runner.js +219 -0
  56. package/dist/core/runner.js.map +1 -0
  57. package/dist/core/security.d.ts +28 -0
  58. package/dist/core/security.js +83 -0
  59. package/dist/core/security.js.map +1 -0
  60. package/dist/core/wallet.d.ts +2 -0
  61. package/dist/core/wallet.js +21 -0
  62. package/dist/core/wallet.js.map +1 -0
  63. package/dist/index.js +56 -13
  64. package/dist/index.js.map +1 -1
  65. package/dist/lib/domain.d.ts +16 -0
  66. package/dist/lib/domain.js +88 -0
  67. package/dist/lib/domain.js.map +1 -0
  68. package/dist/lib/ika.d.ts +81 -0
  69. package/dist/lib/ika.js +192 -0
  70. package/dist/lib/ika.js.map +1 -0
  71. package/dist/lib/instructions.d.ts +79 -0
  72. package/dist/lib/instructions.js +421 -0
  73. package/dist/lib/instructions.js.map +1 -0
  74. package/dist/lib/protocol.d.ts +99 -0
  75. package/dist/lib/protocol.js +327 -0
  76. package/dist/lib/protocol.js.map +1 -0
  77. package/dist/lib/treasury-view.d.ts +11 -0
  78. package/dist/lib/treasury-view.js +126 -0
  79. package/dist/lib/treasury-view.js.map +1 -0
  80. package/dist/program-instructions.d.ts +1 -1
  81. package/dist/ui/dashboard.d.ts +7 -0
  82. package/dist/ui/dashboard.js +99 -0
  83. package/dist/ui/dashboard.js.map +1 -0
  84. package/dist/ui/format.d.ts +9 -0
  85. package/dist/ui/format.js +92 -0
  86. package/dist/ui/format.js.map +1 -0
  87. package/dist/ui/output.d.ts +58 -0
  88. package/dist/ui/output.js +208 -0
  89. package/dist/ui/output.js.map +1 -0
  90. package/dist/ui/theme.d.ts +52 -0
  91. package/dist/ui/theme.js +110 -0
  92. package/dist/ui/theme.js.map +1 -0
  93. package/dist/vendor/encrypt/generated/grpc/encrypt_service.d.ts +1 -1
  94. package/dist/vendor/encrypt/generated/grpc/encrypt_service.js +36 -13
  95. package/dist/vendor/encrypt/generated/grpc/encrypt_service.js.map +1 -1
  96. package/dist/vendor/encrypt/grpc.d.ts +2 -2
  97. package/dist/vendor/encrypt/grpc.js +1 -3
  98. package/dist/vendor/encrypt/grpc.js.map +1 -1
  99. package/dist/vendor/ika/bcs-types.js +107 -50
  100. package/dist/vendor/ika/bcs-types.js.map +1 -1
  101. package/dist/vendor/ika/generated/grpc/ika_dwallet.d.ts +1 -1
  102. package/dist/vendor/ika/generated/grpc/ika_dwallet.js +14 -4
  103. package/dist/vendor/ika/generated/grpc/ika_dwallet.js.map +1 -1
  104. package/dist/vendor/ika/grpc.d.ts +1 -1
  105. package/dist/vendor/ika/grpc.js +49 -24
  106. package/dist/vendor/ika/grpc.js.map +1 -1
  107. package/package.json +15 -12
  108. package/dist/ascii.d.ts +0 -1
  109. package/dist/ascii.js +0 -2
  110. package/dist/ascii.js.map +0 -1
package/README.md CHANGED
@@ -2,7 +2,10 @@
2
2
 
3
3
  # @aura-protocol/cli
4
4
 
5
- > **AURA is under active development. Program instructions, account layouts, policy semantics, SDK APIs, and deployment behavior may still change quickly. Do not use this code to secure production funds or serious treasury operations until a stable release and audit are published.**
5
+ **Docs:** https://docs-auraprotocol.vercel.app/docs/cli
6
+
7
+ > [!WARNING]
8
+ > AURA is under active development. Program instructions, account layouts, policy semantics, SDK APIs, and deployment behavior may still change. Do not use this code to secure production funds until a stable release and audit are published.
6
9
 
7
10
  Terminal interface for the AURA autonomous treasury program on Solana.
8
11
 
@@ -15,12 +18,16 @@ including automatic FHE ciphertext creation, policy decryption, and dWallet co-s
15
18
  ## Features
16
19
 
17
20
  - Config-driven wallet and RPC resolution via `~/.aura/config.json`
18
- - Interactive prompts when flags are omitted; fully scriptable with flags
21
+ - Complete coverage of every `aura-core` instruction through generated, IDL-backed
22
+ per-domain commands (`aura <domain> <instruction>`) — always in sync with the program
23
+ - Ergonomic verb commands for the common treasury, dWallet, confidential, execution,
24
+ and governance flows
25
+ - A secure send pipeline on every write: a transaction preview, preflight simulation,
26
+ a mainnet guard, and confirmations for sensitive (authority/governance/closure) actions
27
+ - Interactive prompts when flags are omitted; fully scriptable with flags and `--yes`
19
28
  - Auto-encryption of guardrail and transaction amounts via `@encrypt.xyz/pre-alpha-solana-client`
20
- - Automatic dWallet presign + sign via `@ika.xyz/pre-alpha-solana-client`
21
- - Readable tables, spinners, and actionable error messages
22
- - `--json` output for piping and scripting
23
- - `--dry-run` to preview instructions without sending
29
+ - Readable color-blocked output, spinners, and actionable error messages with tips
30
+ - `--json` output for piping and scripting; `--dry-run` to preview without sending
24
31
  - PDA derivation for treasury, CPI, dWallet message approval, and policy-control records
25
32
  - Full-screen `ink` dashboard for live treasury monitoring
26
33
 
@@ -68,6 +75,7 @@ aura config set --wallet ~/.config/solana/id.json
68
75
  ```
69
76
 
70
77
  Config resolution order (highest wins):
78
+
71
79
  1. CLI flags (`--rpc-url`, `--wallet`, `--program-id`)
72
80
  2. Environment variables (`AURA_RPC_URL`, `AURA_WALLET_PATH`, `AURA_PROGRAM_ID`)
73
81
  3. Config file (`~/.aura/config.json`)
@@ -77,41 +85,44 @@ Config resolution order (highest wins):
77
85
 
78
86
  ## Commands
79
87
 
80
- ### Feature and Instruction Surface
88
+ ### Instruction Surface (full coverage)
81
89
 
82
- The CLI exposes the full current AURA program surface through SDK/IDL-backed
83
- commands. Use these when a new policy, account, or control instruction does not
84
- need a bespoke workflow.
90
+ Every program instruction is reachable two ways: a generated per-domain command
91
+ (`aura <domain> <instruction>`) and the raw `aura ix` surface (alias of
92
+ `aura instruction`). Both are driven directly by the program IDL, so coverage
93
+ never drifts from the deployed program.
85
94
 
86
95
  ```bash
87
- # Show all domains and instruction coverage
88
- aura features
89
- aura features --domain policy-control
90
- aura features --maturity wallet
91
-
92
- # List every current aura-core instruction grouped by domain
93
- aura instruction list
94
-
95
- # Inspect one instruction's account and argument schema
96
- aura instruction schema configure_budget_envelope
97
-
98
- # Build a serialized instruction without sending it
99
- aura instruction build configure_budget_envelope \
100
- --accounts @accounts.json \
101
- --args @args.json
102
-
103
- # Send any wallet-compatible instruction using the configured keypair
104
- aura instruction send transition_agent_state \
96
+ # Discover the surface
97
+ aura features # domains + maturity summary
98
+ aura features --domain policy # filter to one domain
99
+ aura ix list # every instruction grouped by domain
100
+
101
+ # Inspect an instruction's accounts and arguments
102
+ aura ix schema configure_budget_envelope
103
+ aura budget configure-budget-envelope --schema # same, via the generated command
104
+
105
+ # Build a serialized instruction without sending (offline)
106
+ aura ix build configure_budget_envelope --accounts @accounts.json --args @args.json
107
+
108
+ # Send any instruction through the secure pipeline (preview + simulate + confirm)
109
+ aura policy create-policy-template \
110
+ --account owner='$wallet' \
111
+ --account policy_template=<pda> \
112
+ --arg name=conservative --arg shared=false
113
+
114
+ # Equivalent via the raw surface
115
+ aura ix send transition_agent_state \
105
116
  --account treasury=<treasury-pda> \
106
- --account authority=<wallet-pubkey> \
107
- --arg newState=active \
108
- --compute-units 600000
117
+ --account authority='$wallet' \
118
+ --arg newState=active
109
119
  ```
110
120
 
111
- `aura instruction send` enforces signer requirements before broadcast. If an
112
- instruction needs extra signers, pass one or more `--extra-signer <keypair>`
113
- paths. Instructions that require external Encrypt or dWallet CPI state still
114
- need those accounts to exist on devnet before the transaction can succeed.
121
+ Signer accounts accept the literal `$wallet` (the configured keypair). When an
122
+ instruction needs additional signers, pass one or more `--extra-signer <keypair>`
123
+ paths; the CLI verifies all required signers are present before broadcasting.
124
+ Use `--account key=value` / `--arg key=value` for individual fields, or
125
+ `--accounts @file.json` / `--args @file.json` for whole objects.
115
126
 
116
127
  ### Treasury
117
128
 
@@ -214,13 +225,14 @@ aura confidential confirm-decryption --agent-id my-agent
214
225
  ### Execution
215
226
 
216
227
  ```bash
217
- # Execute the pending proposal
218
- # For approved proposals: submits execute_pending, then automatically drives
219
- # the dWallet presign + sign flow via the Ika dWallet gRPC network
228
+ # Execute the pending proposal.
229
+ # Approved proposals submit execute_pending, which requests dWallet co-signing
230
+ # through the message-approval account; the dWallet signature itself is produced
231
+ # by the backend / Ika dWallet network.
220
232
  aura execution execute --agent-id my-agent
221
233
 
222
234
  # --wait: waits for the message approval account to be created
223
- # --wait-signed: waits for the full dWallet signature
235
+ # --wait-signed: waits until the message approval reaches signed status
224
236
  aura execution execute --agent-id my-agent --wait
225
237
  aura execution execute --agent-id my-agent --wait-signed
226
238
 
@@ -317,18 +329,13 @@ aura confidential propose \
317
329
  --agent-id my-agent --amount 250 --chain ethereum \
318
330
  --recipient 0xdeadbeef... --wait
319
331
 
320
- # Vector guardrails use the matching vector proposal flow instead:
321
- aura confidential propose-vector \
322
- --agent-id my-agent --amount 250 --chain ethereum \
323
- --recipient 0xdeadbeef... --wait
324
-
325
332
  # 6. Request decryption
326
333
  aura confidential request-decryption --agent-id my-agent --wait
327
334
 
328
335
  # 7. Confirm decryption (shows approved/denied)
329
336
  aura confidential confirm-decryption --agent-id my-agent
330
337
 
331
- # 8. Execute (drives dWallet presign + sign automatically)
338
+ # 8. Execute (requests dWallet co-signing via the message-approval account)
332
339
  aura execution execute --agent-id my-agent --wait-signed
333
340
 
334
341
  # 9. Finalize
@@ -337,16 +344,40 @@ aura execution finalize --agent-id my-agent
337
344
 
338
345
  ---
339
346
 
347
+ ## Safety and security
348
+
349
+ Every command that sends a transaction runs through one pipeline with guard rails:
350
+
351
+ - **Preview** — before anything is sent, the CLI prints exactly what will be
352
+ signed: network, program, fee payer, and each instruction's account/signer counts.
353
+ - **Preflight simulation** — the transaction is simulated and its compute units
354
+ and any program error/logs are surfaced. Skip with `--no-simulate`.
355
+ - **Mainnet guard** — writes against a mainnet RPC require an explicit confirmation.
356
+ - **Sensitive-action confirmation** — authority changes, governance updates, and
357
+ account closures prompt before sending. Bypass non-interactively with `--yes`.
358
+ - **Keypair hygiene** — warns when a keypair file is readable by group/others (POSIX).
359
+ - **`--dry-run`** — build and preview without sending or simulating.
360
+
361
+ Secrets are never printed: keypairs are referenced by public key only.
362
+
363
+ ---
364
+
340
365
  ## Global Flags
341
366
 
342
367
  ```
343
- --rpc-url <url> Override RPC endpoint
344
- --wallet <path> Override keypair file path
345
- --program-id <id> Override program ID
346
- --json Output raw JSON (for piping)
347
- --quiet Suppress all output except errors
348
- --dry-run Build and display the transaction without sending
349
- --help Show help
368
+ --rpc-url <url> Override the RPC endpoint
369
+ --wallet <path> Override the keypair file path
370
+ --program-id <id> Override the program ID
371
+ --cluster <name> Cluster label for display
372
+ --json Output machine-readable JSON (implies --no-color)
373
+ --quiet Suppress non-error terminal output
374
+ --dry-run Build and preview the transaction without sending
375
+ -y, --yes Skip confirmation prompts (non-interactive / CI)
376
+ --no-simulate Skip the preflight simulation before sending
377
+ --no-color Disable colored output
378
+ --compute-units <n> Override the compute-unit limit
379
+ -v, --version Print the CLI version
380
+ --help Show help
350
381
  ```
351
382
 
352
383
  ---
@@ -358,7 +389,7 @@ AURA_RPC_URL="https://devnet.helius-rpc.com/?api-key=YOUR_KEY"
358
389
  AURA_DEVNET_RPC_URL="https://devnet.helius-rpc.com/?api-key=YOUR_KEY"
359
390
  AURA_WALLET_PATH="/path/to/keypair.json"
360
391
  PAYER_KEYPAIR="/path/to/keypair.json"
361
- AURA_PROGRAM_ID="2fHkM5fb8iLt5ojkubAcLpAjgkF1QL1iEXivKZmPw3ya"
392
+ AURA_PROGRAM_ID="auraEgX8ZUK3Xr8X81aRfgyTmoyNdsdfL6XfDN8W1ce"
362
393
  AURA_DEFAULT_AGENT_ID="my-agent"
363
394
  ```
364
395
 
package/bin/aura.js CHANGED
File without changes
@@ -1,2 +1,2 @@
1
- import { type Command } from "commander";
1
+ import type { Command } from "commander";
2
2
  export declare function registerConfidentialCommands(program: Command): void;