@aomi-labs/client 0.1.13 → 0.1.15

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.
package/README.md CHANGED
@@ -63,30 +63,30 @@ new Session(clientOptions: AomiClientOptions, sessionOptions?: SessionOptions)
63
63
  new Session(client: AomiClient, sessionOptions?: SessionOptions)
64
64
  ```
65
65
 
66
- | Option | Default | Description |
67
- |--------|---------|-------------|
68
- | `sessionId` | `crypto.randomUUID()` | Thread/session ID |
69
- | `namespace` | `"default"` | Backend namespace |
70
- | `publicKey` | — | Wallet address |
71
- | `apiKey` | — | API key for private namespaces |
72
- | `userState` | — | Arbitrary user state sent with requests |
73
- | `pollIntervalMs` | `500` | Polling interval in ms |
74
- | `logger` | — | Pass `console` for debug output |
66
+ | Option | Default | Description |
67
+ | ---------------- | --------------------- | --------------------------------------- |
68
+ | `sessionId` | `crypto.randomUUID()` | Thread/session ID |
69
+ | `namespace` | `"default"` | Backend namespace |
70
+ | `publicKey` | — | Wallet address |
71
+ | `apiKey` | — | API key for private namespaces |
72
+ | `userState` | — | Arbitrary user state sent with requests |
73
+ | `pollIntervalMs` | `500` | Polling interval in ms |
74
+ | `logger` | — | Pass `console` for debug output |
75
75
 
76
76
  #### Methods
77
77
 
78
- | Method | Description |
79
- |--------|-------------|
80
- | `send(message)` | Send a message, wait for completion, return `{ messages, title }` |
81
- | `sendAsync(message)` | Send without waiting — poll in background, listen via events |
82
- | `resolve(id, result)` | Resolve a pending wallet request |
83
- | `reject(id, reason?)` | Reject a pending wallet request |
84
- | `interrupt()` | Cancel current processing |
85
- | `close()` | Stop polling, unsubscribe SSE, clean up |
86
- | `getMessages()` | Current messages |
87
- | `getTitle()` | Current session title |
88
- | `getPendingRequests()` | Pending wallet requests |
89
- | `getIsProcessing()` | Whether the agent is processing |
78
+ | Method | Description |
79
+ | ---------------------- | ----------------------------------------------------------------- |
80
+ | `send(message)` | Send a message, wait for completion, return `{ messages, title }` |
81
+ | `sendAsync(message)` | Send without waiting — poll in background, listen via events |
82
+ | `resolve(id, result)` | Resolve a pending wallet request |
83
+ | `reject(id, reason?)` | Reject a pending wallet request |
84
+ | `interrupt()` | Cancel current processing |
85
+ | `close()` | Stop polling, unsubscribe SSE, clean up |
86
+ | `getMessages()` | Current messages |
87
+ | `getTitle()` | Current session title |
88
+ | `getPendingRequests()` | Pending wallet requests |
89
+ | `getIsProcessing()` | Whether the agent is processing |
90
90
 
91
91
  #### Events
92
92
 
@@ -119,11 +119,15 @@ When installed globally or in a project, the executable name is `aomi`.
119
119
  For one-off usage, run commands via `npx @aomi-labs/client ...`.
120
120
 
121
121
  ```bash
122
+ npx @aomi-labs/client --version # print installed CLI version
122
123
  npx @aomi-labs/client chat "swap 1 ETH for USDC" # talk to the agent
123
124
  npx @aomi-labs/client chat "swap 1 ETH for USDC" --model claude-sonnet-4
124
125
  npx @aomi-labs/client chat "swap 1 ETH" --verbose # stream tool calls + responses live
125
- npx @aomi-labs/client models # list available models
126
+ npx @aomi-labs/client app list # list available apps
127
+ npx @aomi-labs/client model list # list available models
126
128
  npx @aomi-labs/client model set claude-sonnet-4 # switch the current session model
129
+ npx @aomi-labs/client secret list # list configured secret handles
130
+ npx @aomi-labs/client --secret ALCHEMY_API_KEY=... # ingest a secret for the active session
127
131
  npx @aomi-labs/client log # show full conversation history
128
132
  npx @aomi-labs/client tx # list pending + signed txs
129
133
  npx @aomi-labs/client sign tx-1 # sign a specific pending tx
@@ -150,7 +154,7 @@ session don't need it again.
150
154
  The CLI can discover and switch backend models for the active session:
151
155
 
152
156
  ```bash
153
- $ npx @aomi-labs/client models
157
+ $ npx @aomi-labs/client model list
154
158
  claude-sonnet-4
155
159
  gpt-5
156
160
 
@@ -164,6 +168,29 @@ $ npx @aomi-labs/client chat "hello" --model claude-sonnet-4
164
168
  successful backend update. `aomi chat --model ...` applies the requested model
165
169
  before sending the message and updates that persisted state as well.
166
170
 
171
+ ### Secret management
172
+
173
+ The CLI supports per-session secret ingestion. This lets the backend use opaque
174
+ handles instead of raw secret values:
175
+
176
+ ```bash
177
+ $ npx @aomi-labs/client --secret ALCHEMY_API_KEY=sk_live_123
178
+ Configured 1 secret for session 7f8a...
179
+ ALCHEMY_API_KEY $SECRET:ALCHEMY_API_KEY
180
+
181
+ $ npx @aomi-labs/client --secret ALCHEMY_API_KEY=sk_live_123 chat "simulate a swap on Base"
182
+ ```
183
+
184
+ You can inspect or clear the current session's secret handles:
185
+
186
+ ```bash
187
+ $ npx @aomi-labs/client secret list
188
+ ALCHEMY_API_KEY $SECRET:ALCHEMY_API_KEY
189
+
190
+ $ npx @aomi-labs/client secret clear
191
+ Cleared all secrets for the active session.
192
+ ```
193
+
167
194
  ### Transaction flow
168
195
 
169
196
  The backend builds transactions; the CLI persists and signs them:
@@ -252,17 +279,19 @@ $ npx @aomi-labs/client log
252
279
 
253
280
  All config can be passed as flags (which take priority over env vars):
254
281
 
255
- | Flag | Env Variable | Default | Description |
256
- |------|-------------|---------|-------------|
257
- | `--backend-url` | `AOMI_BASE_URL` | `https://api.aomi.dev` | Backend URL |
258
- | `--api-key` | `AOMI_API_KEY` | — | API key for non-default apps |
259
- | `--app` | `AOMI_APP` | `default` | App |
260
- | `--model` | `AOMI_MODEL` | — | Model rig to apply before chat |
261
- | `--public-key` | `AOMI_PUBLIC_KEY` | — | Wallet address (tells agent your wallet) |
262
- | `--private-key` | `PRIVATE_KEY` | — | Hex private key for `aomi sign` |
263
- | `--rpc-url` | `CHAIN_RPC_URL` | — | RPC URL for transaction submission |
264
- | `--chain` | `AOMI_CHAIN_ID` | `1` | Chain ID (1, 137, 42161, 8453, 10, 11155111) |
265
- | `--verbose`, `-v` | | | Stream tool calls and agent responses live |
282
+ | Flag | Env Variable | Default | Description |
283
+ | ----------------------- | ----------------- | ---------------------- | -------------------------------------------- |
284
+ | `--backend-url` | `AOMI_BASE_URL` | `https://api.aomi.dev` | Backend URL |
285
+ | `--api-key` | `AOMI_API_KEY` | — | API key for non-default apps |
286
+ | `--app` | `AOMI_APP` | `default` | App |
287
+ | `--model` | `AOMI_MODEL` | — | Model rig to apply before chat |
288
+ | `--secret <NAME=value>` | | — | Ingest secret values for the active session |
289
+ | `--public-key` | `AOMI_PUBLIC_KEY` | — | Wallet address (tells agent your wallet) |
290
+ | `--private-key` | `PRIVATE_KEY` | — | Hex private key for `aomi sign` |
291
+ | `--rpc-url` | `CHAIN_RPC_URL` | | RPC URL for transaction submission |
292
+ | `--chain` | `AOMI_CHAIN_ID` | `1` | Chain ID (1, 137, 42161, 8453, 10, 11155111) |
293
+ | `--verbose`, `-v` | — | — | Stream tool calls and agent responses live |
294
+ | `--version`, `-V` | — | — | Print the installed CLI version |
266
295
 
267
296
  ```bash
268
297
  # Use a custom backend
@@ -293,14 +322,16 @@ The CLI is **not** a long-running process — each command starts, runs, and
293
322
  exits. Conversation history lives on the backend. Between invocations, the CLI
294
323
  persists local state under `AOMI_STATE_DIR` or `~/.aomi` by default:
295
324
 
296
- | Field | Purpose |
297
- |-------|---------|
298
- | `sessionId` | Which conversation to continue |
299
- | `model` | Last successfully applied model for the session |
300
- | `publicKey` | Wallet address (from `--public-key`) |
301
- | `chainId` | Active chain ID (from `--chain`) |
302
- | `pendingTxs` | Unsigned transactions waiting for `aomi sign <id>` |
303
- | `signedTxs` | Completed transactions with hashes/signatures |
325
+ | Field | Purpose |
326
+ | --------------- | ------------------------------------------------------ |
327
+ | `sessionId` | Which conversation to continue |
328
+ | `clientId` | Stable client identity used for session secret handles |
329
+ | `model` | Last successfully applied model for the session |
330
+ | `publicKey` | Wallet address (from `--public-key`) |
331
+ | `chainId` | Active chain ID (from `--chain`) |
332
+ | `secretHandles` | Opaque handles returned for ingested secrets |
333
+ | `pendingTxs` | Unsigned transactions waiting for `aomi sign <id>` |
334
+ | `signedTxs` | Completed transactions with hashes/signatures |
304
335
 
305
336
  ```
306
337
  $ npx @aomi-labs/client chat "hello" # creates session, saves sessionId
package/dist/cli.js CHANGED
@@ -19,6 +19,46 @@ var __spreadValues = (a, b) => {
19
19
  };
20
20
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
21
 
22
+ // package.json
23
+ var package_default = {
24
+ name: "@aomi-labs/client",
25
+ version: "0.1.15",
26
+ description: "Platform-agnostic TypeScript client for the Aomi backend API",
27
+ type: "module",
28
+ main: "./dist/index.cjs",
29
+ module: "./dist/index.js",
30
+ types: "./dist/index.d.ts",
31
+ bin: {
32
+ aomi: "./dist/cli.js"
33
+ },
34
+ exports: {
35
+ ".": {
36
+ import: {
37
+ types: "./dist/index.d.ts",
38
+ default: "./dist/index.js"
39
+ },
40
+ require: {
41
+ types: "./dist/index.d.cts",
42
+ default: "./dist/index.cjs"
43
+ }
44
+ }
45
+ },
46
+ files: [
47
+ "dist",
48
+ "skills",
49
+ "README.md"
50
+ ],
51
+ scripts: {
52
+ build: "tsup",
53
+ "clean:dist": "rm -rf dist"
54
+ },
55
+ dependencies: {
56
+ "@getpara/aa-alchemy": "2.18.0",
57
+ "@getpara/aa-pimlico": "2.18.0",
58
+ viem: "^2.40.3"
59
+ }
60
+ };
61
+
22
62
  // src/cli/errors.ts
23
63
  var CliExit = class extends Error {
24
64
  constructor(code) {
@@ -93,22 +133,38 @@ function parseAAMode(value) {
93
133
  }
94
134
  fatal("Unsupported AA mode. Use `4337` or `7702`.");
95
135
  }
136
+ function parseSecret(value, secrets) {
137
+ const eqIdx = value.indexOf("=");
138
+ if (eqIdx > 0) {
139
+ secrets[value.slice(0, eqIdx)] = value.slice(eqIdx + 1);
140
+ }
141
+ }
96
142
  function parseArgs(argv) {
97
143
  const raw = argv.slice(2);
98
- const command = raw[0] && !raw[0].startsWith("--") ? raw[0] : void 0;
144
+ const command = raw[0] && !raw[0].startsWith("-") ? raw[0] : void 0;
99
145
  const rest = command ? raw.slice(1) : raw;
100
146
  const positional = [];
101
147
  const flags = {};
148
+ const secrets = {};
102
149
  for (let i = 0; i < rest.length; i++) {
103
150
  const arg = rest[i];
104
151
  if (arg.startsWith("--") && arg.includes("=")) {
105
152
  const [key, ...val] = arg.slice(2).split("=");
106
- flags[key] = val.join("=");
153
+ const value = val.join("=");
154
+ if (key === "secret") {
155
+ parseSecret(value, secrets);
156
+ } else {
157
+ flags[key] = value;
158
+ }
107
159
  } else if (arg.startsWith("--")) {
108
160
  const key = arg.slice(2);
109
161
  const next = rest[i + 1];
110
162
  if (next && !next.startsWith("-")) {
111
- flags[key] = next;
163
+ if (key === "secret") {
164
+ parseSecret(next, secrets);
165
+ } else {
166
+ flags[key] = next;
167
+ }
112
168
  i++;
113
169
  } else {
114
170
  flags[key] = "true";
@@ -119,7 +175,7 @@ function parseArgs(argv) {
119
175
  positional.push(arg);
120
176
  }
121
177
  }
122
- return { command, positional, flags };
178
+ return { command, positional, flags, secrets };
123
179
  }
124
180
  function getConfig(parsed) {
125
181
  var _a3, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
@@ -148,6 +204,7 @@ function getConfig(parsed) {
148
204
  privateKey: (_j = parsed.flags["private-key"]) != null ? _j : process.env.PRIVATE_KEY,
149
205
  chainRpcUrl: (_k = parsed.flags["rpc-url"]) != null ? _k : process.env.CHAIN_RPC_URL,
150
206
  chain: parseChainId((_l = parsed.flags["chain"]) != null ? _l : process.env.AOMI_CHAIN_ID),
207
+ secrets: parsed.secrets,
151
208
  execution,
152
209
  aaProvider,
153
210
  aaMode
@@ -198,6 +255,7 @@ function toSessionFilePath(localId) {
198
255
  function toCliSessionState(stored) {
199
256
  return {
200
257
  sessionId: stored.sessionId,
258
+ clientId: stored.clientId,
201
259
  baseUrl: stored.baseUrl,
202
260
  app: stored.app,
203
261
  model: stored.model,
@@ -205,7 +263,8 @@ function toCliSessionState(stored) {
205
263
  publicKey: stored.publicKey,
206
264
  chainId: stored.chainId,
207
265
  pendingTxs: stored.pendingTxs,
208
- signedTxs: stored.signedTxs
266
+ signedTxs: stored.signedTxs,
267
+ secretHandles: stored.secretHandles
209
268
  };
210
269
  }
211
270
  function readStoredSession(path) {
@@ -1782,6 +1841,22 @@ async function applyModelSelection(session, state, model) {
1782
1841
  state.model = model;
1783
1842
  writeState(state);
1784
1843
  }
1844
+ async function ingestSecretsIfPresent(runtime, state, client) {
1845
+ var _a3;
1846
+ const secrets = runtime.config.secrets;
1847
+ if (Object.keys(secrets).length === 0) return {};
1848
+ if (!state.clientId) {
1849
+ state.clientId = crypto.randomUUID();
1850
+ writeState(state);
1851
+ }
1852
+ const response = await client.ingestSecrets(
1853
+ state.clientId,
1854
+ secrets
1855
+ );
1856
+ state.secretHandles = __spreadValues(__spreadValues({}, (_a3 = state.secretHandles) != null ? _a3 : {}), response.handles);
1857
+ writeState(state);
1858
+ return response.handles;
1859
+ }
1785
1860
  async function applyRequestedModelIfPresent(runtime, session, state) {
1786
1861
  const requestedModel = runtime.config.model;
1787
1862
  if (!requestedModel || requestedModel === state.model) {
@@ -2641,6 +2716,70 @@ function closeCommand(runtime) {
2641
2716
  console.log("Session closed");
2642
2717
  }
2643
2718
 
2719
+ // src/cli/commands/secrets.ts
2720
+ async function ingestSecretsCommand(runtime) {
2721
+ const secretEntries = Object.entries(runtime.config.secrets);
2722
+ if (secretEntries.length === 0) {
2723
+ fatal("Usage: aomi --secret NAME=value [NAME=value ...]");
2724
+ }
2725
+ const { session, state } = getOrCreateSession(runtime);
2726
+ try {
2727
+ const handles = await ingestSecretsIfPresent(
2728
+ runtime,
2729
+ state,
2730
+ session.client
2731
+ );
2732
+ const names = Object.keys(handles).sort();
2733
+ console.log(
2734
+ `Configured ${names.length} secret${names.length === 1 ? "" : "s"} for session ${state.sessionId}.`
2735
+ );
2736
+ for (const name of names) {
2737
+ console.log(`${name} ${handles[name]}`);
2738
+ }
2739
+ printDataFileLocation();
2740
+ } finally {
2741
+ session.close();
2742
+ }
2743
+ }
2744
+ async function secretCommand(runtime) {
2745
+ var _a3;
2746
+ const subcommand = runtime.parsed.positional[0];
2747
+ if (!subcommand || subcommand === "list") {
2748
+ const state = readState();
2749
+ if (!state) {
2750
+ console.log("No active session");
2751
+ printDataFileLocation();
2752
+ return;
2753
+ }
2754
+ const secretHandles = (_a3 = state.secretHandles) != null ? _a3 : {};
2755
+ const names = Object.keys(secretHandles).sort();
2756
+ if (names.length === 0) {
2757
+ console.log("No secrets configured.");
2758
+ printDataFileLocation();
2759
+ return;
2760
+ }
2761
+ for (const name of names) {
2762
+ console.log(`${name} ${secretHandles[name]}`);
2763
+ }
2764
+ printDataFileLocation();
2765
+ return;
2766
+ }
2767
+ if (subcommand === "clear") {
2768
+ const { session, state } = getOrCreateSession(runtime);
2769
+ try {
2770
+ await session.client.clearSecrets(state.clientId);
2771
+ state.secretHandles = {};
2772
+ writeState(state);
2773
+ console.log("Cleared all secrets for the active session.");
2774
+ printDataFileLocation();
2775
+ } finally {
2776
+ session.close();
2777
+ }
2778
+ return;
2779
+ }
2780
+ fatal("Usage: aomi secret list\n aomi secret clear");
2781
+ }
2782
+
2644
2783
  // src/cli/commands/sessions.ts
2645
2784
  async function fetchRemoteSessionStats(record) {
2646
2785
  var _a3, _b;
@@ -3665,6 +3804,7 @@ async function signCommand(runtime) {
3665
3804
  }
3666
3805
 
3667
3806
  // src/cli/main.ts
3807
+ var CLI_VERSION = package_default.version;
3668
3808
  function printUsage() {
3669
3809
  console.log(`
3670
3810
  aomi \u2014 CLI client for Aomi on-chain agent
@@ -3688,9 +3828,12 @@ Usage:
3688
3828
  aomi tx List pending and signed transactions
3689
3829
  aomi sign <tx-id> [<tx-id> ...] [--eoa | --aa] [--aa-provider <name>] [--aa-mode <mode>]
3690
3830
  Sign and submit a pending transaction
3831
+ aomi secret list List configured secrets for the active session
3832
+ aomi secret clear Clear all secrets for the active session
3691
3833
  aomi status Show current session state
3692
3834
  aomi events List system events
3693
3835
  aomi close Close the current session
3836
+ aomi --version Print the installed CLI version
3694
3837
 
3695
3838
  Options:
3696
3839
  --backend-url <url> Backend URL (default: https://api.aomi.dev)
@@ -3700,7 +3843,9 @@ Options:
3700
3843
  --public-key <addr> Wallet address (so the agent knows your wallet)
3701
3844
  --private-key <key> Hex private key for signing
3702
3845
  --rpc-url <url> RPC URL for transaction submission
3846
+ --secret NAME=value Ingest a secret (repeatable, e.g. --secret X_API_KEY=abc)
3703
3847
  --verbose, -v Show tool calls and streaming output (for chat)
3848
+ --version, -V Print the installed CLI version
3704
3849
 
3705
3850
  Sign options:
3706
3851
  aomi sign <tx-id> --eoa
@@ -3734,8 +3879,9 @@ Environment (overridden by flags):
3734
3879
  `.trim());
3735
3880
  }
3736
3881
  async function main(runtime) {
3737
- var _a3;
3738
- const command = (_a3 = runtime.parsed.command) != null ? _a3 : runtime.parsed.flags["help"] || runtime.parsed.flags["h"] ? "help" : void 0;
3882
+ var _a3, _b, _c;
3883
+ const hasSecrets = Object.keys(runtime.parsed.secrets).length > 0;
3884
+ const command = (_c = (_b = (_a3 = runtime.parsed.command) != null ? _a3 : hasSecrets ? "ingest-secrets" : void 0) != null ? _b : runtime.parsed.flags["version"] || runtime.parsed.flags["V"] ? "version" : void 0) != null ? _c : runtime.parsed.flags["help"] || runtime.parsed.flags["h"] ? "help" : void 0;
3739
3885
  switch (command) {
3740
3886
  case "chat":
3741
3887
  await chatCommand(runtime);
@@ -3767,9 +3913,18 @@ async function main(runtime) {
3767
3913
  case "events":
3768
3914
  await eventsCommand(runtime);
3769
3915
  break;
3916
+ case "secret":
3917
+ await secretCommand(runtime);
3918
+ break;
3919
+ case "ingest-secrets":
3920
+ await ingestSecretsCommand(runtime);
3921
+ break;
3770
3922
  case "close":
3771
3923
  closeCommand(runtime);
3772
3924
  break;
3925
+ case "version":
3926
+ console.log(CLI_VERSION);
3927
+ break;
3773
3928
  case "help":
3774
3929
  printUsage();
3775
3930
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aomi-labs/client",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Platform-agnostic TypeScript client for the Aomi backend API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -5,13 +5,14 @@ description: >
5
5
  check balances or prices, build wallet requests, confirm quotes or routes,
6
6
  sign transactions or EIP-712 payloads, switch apps or chains, or execute
7
7
  swaps, transfers, and DeFi actions on-chain. Covers Aomi chat, transaction
8
- review, AA-first signing with automatic EOA fallback, and session controls.
9
- compatibility: "Requires @aomi-labs/client (`npm install -g @aomi-labs/client`). CLI executable is `aomi`. Requires viem for signing (`npm install viem`). Use AOMI_APP / --app, AOMI_MODEL / --model, AOMI_CHAIN_ID / --chain, CHAIN_RPC_URL / --rpc-url, and AOMI_STATE_DIR for local session storage."
8
+ review, AA-first signing with automatic EOA fallback, session controls, and
9
+ per-session secret ingestion.
10
+ compatibility: "Requires @aomi-labs/client (`npm install -g @aomi-labs/client`). CLI executable is `aomi`. Requires viem for signing (`npm install viem`). Use AOMI_APP / --app, AOMI_MODEL / --model, AOMI_CHAIN_ID / --chain, CHAIN_RPC_URL / --rpc-url, optional --secret NAME=value ingestion, and AOMI_STATE_DIR for local session storage."
10
11
  license: MIT
11
12
  allowed-tools: Bash
12
13
  metadata:
13
14
  author: aomi-labs
14
- version: "0.4"
15
+ version: "0.5"
15
16
  ---
16
17
 
17
18
  # Aomi Transact
@@ -26,12 +27,14 @@ backend. Local session data lives under `AOMI_STATE_DIR` or `~/.aomi`.
26
27
  - The user wants balances, prices, routes, quotes, or transaction status.
27
28
  - The user wants to build, confirm, sign, or broadcast wallet requests.
28
29
  - The user wants to inspect or switch apps, models, chains, or sessions.
30
+ - The user wants to inject API keys or other backend secrets for the current session.
29
31
 
30
32
  ## Hard Rules
31
33
 
32
34
  - Never print secrets verbatim in normal status, preflight, or confirmation output.
33
35
  - Treat `PRIVATE_KEY`, `AOMI_API_KEY`, `ALCHEMY_API_KEY`, `PIMLICO_API_KEY`, and private RPC URLs as secrets.
34
36
  - If the user provides a private key or API key, do not repeat it back unless they explicitly ask for that exact value to be reformatted.
37
+ - Prefer `aomi --secret NAME=value ...` over stuffing provider API keys into normal chat text.
35
38
  - Do not sign anything unless the CLI has actually queued a wallet request and you can identify its `tx-N` ID.
36
39
  - If `PRIVATE_KEY` is set in the environment, do not also pass `--private-key` unless you intentionally want to override the environment value.
37
40
  - `--public-key` must match the address derived from the signing key. If they differ, `aomi sign` will update the session to the signer address.
@@ -45,6 +48,7 @@ backend. Local session data lives under `AOMI_STATE_DIR` or `~/.aomi`.
45
48
  Run this once at the start of the session:
46
49
 
47
50
  ```bash
51
+ aomi --version
48
52
  aomi status 2>/dev/null || echo "no session"
49
53
  ```
50
54
 
@@ -75,6 +79,7 @@ aomi tx
75
79
  aomi log
76
80
  aomi status
77
81
  aomi events
82
+ aomi --version
78
83
  aomi app list
79
84
  aomi app current
80
85
  aomi model list
@@ -89,8 +94,29 @@ Notes:
89
94
  - Quote the chat message.
90
95
  - Use `--verbose` when debugging tool calls or streaming behavior.
91
96
  - Pass `--public-key` on the first wallet-aware chat if the backend needs the user's address.
97
+ - Use `aomi secret list` to inspect configured secret handles for the active session.
92
98
  - `aomi close` wipes the active local session pointer and starts a fresh thread next time.
93
99
 
100
+ ### Secret Ingestion
101
+
102
+ Use this when the backend or selected app needs API keys, provider tokens, or
103
+ other named secrets for the current session:
104
+
105
+ ```bash
106
+ aomi --secret ALCHEMY_API_KEY=sk_live_123
107
+ aomi --secret ALCHEMY_API_KEY=sk_live_123 chat "simulate a swap on Base"
108
+ aomi secret list
109
+ aomi secret clear
110
+ ```
111
+
112
+ Important behavior:
113
+
114
+ - `aomi --secret NAME=value` with no command ingests secrets into the active session and exits.
115
+ - `aomi --secret NAME=value chat "..."` ingests first, then runs the command.
116
+ - `aomi secret list` prints secret handle names, not raw values.
117
+ - `aomi secret clear` removes all secrets for the active session.
118
+ - Do not combine `--secret` with `aomi secret clear`.
119
+
94
120
  ### Building Wallet Requests
95
121
 
96
122
  Use the first chat turn to give the agent the task and, if relevant, the wallet
@@ -203,12 +229,16 @@ aomi tx
203
229
  aomi log
204
230
  aomi status
205
231
  aomi events
232
+ aomi secret list
233
+ aomi secret clear
206
234
  ```
207
235
 
208
236
  - `aomi tx` inspects pending and signed requests.
209
237
  - `aomi log` replays conversation and tool output.
210
238
  - `aomi status` shows the current session summary.
211
239
  - `aomi events` shows raw backend system events.
240
+ - `aomi secret list` shows configured secret handles for the active session.
241
+ - `aomi secret clear` removes all configured secrets for the active session.
212
242
 
213
243
  ### App And Model Commands
214
244
 
@@ -253,10 +283,10 @@ aomi close
253
283
 
254
284
  ### AA Providers
255
285
 
256
- | Provider | Flag | Env Var | Notes |
257
- |----------|------|---------|-------|
258
- | Alchemy | `--aa-provider alchemy` | `ALCHEMY_API_KEY` | Supports sponsorship, 4337, 7702 |
259
- | Pimlico | `--aa-provider pimlico` | `PIMLICO_API_KEY` | Supports 4337 and 7702 |
286
+ | Provider | Flag | Env Var | Notes |
287
+ | -------- | ----------------------- | ----------------- | -------------------------------- |
288
+ | Alchemy | `--aa-provider alchemy` | `ALCHEMY_API_KEY` | Supports sponsorship, 4337, 7702 |
289
+ | Pimlico | `--aa-provider pimlico` | `PIMLICO_API_KEY` | Supports 4337 and 7702 |
260
290
 
261
291
  Provider selection rules:
262
292
 
@@ -266,20 +296,20 @@ Provider selection rules:
266
296
 
267
297
  ### AA Modes
268
298
 
269
- | Mode | Flag | Meaning |
270
- |------|------|---------|
299
+ | Mode | Flag | Meaning |
300
+ | ------ | ---------------- | -------------------------------- |
271
301
  | `4337` | `--aa-mode 4337` | Bundler-based smart account flow |
272
- | `7702` | `--aa-mode 7702` | Delegated execution flow |
302
+ | `7702` | `--aa-mode 7702` | Delegated execution flow |
273
303
 
274
304
  ### Default Chain Modes
275
305
 
276
- | Chain | ID | Default AA Mode |
277
- |-------|----|-----------------|
278
- | Ethereum | 1 | 7702 |
279
- | Polygon | 137 | 4337 |
280
- | Arbitrum | 42161 | 4337 |
281
- | Base | 8453 | 4337 |
282
- | Optimism | 10 | 4337 |
306
+ | Chain | ID | Default AA Mode |
307
+ | -------- | ----- | --------------- |
308
+ | Ethereum | 1 | 7702 |
309
+ | Polygon | 137 | 4337 |
310
+ | Arbitrum | 42161 | 4337 |
311
+ | Base | 8453 | 4337 |
312
+ | Optimism | 10 | 4337 |
283
313
 
284
314
  ### Sponsorship
285
315
 
@@ -299,14 +329,14 @@ Default signing behavior for Alchemy:
299
329
 
300
330
  ### Supported Chains
301
331
 
302
- | Chain | ID |
303
- |-------|----|
304
- | Ethereum | 1 |
305
- | Polygon | 137 |
306
- | Arbitrum One | 42161 |
307
- | Base | 8453 |
308
- | Optimism | 10 |
309
- | Sepolia | 11155111 |
332
+ | Chain | ID |
333
+ | ------------ | -------- |
334
+ | Ethereum | 1 |
335
+ | Polygon | 137 |
336
+ | Arbitrum One | 42161 |
337
+ | Base | 8453 |
338
+ | Optimism | 10 |
339
+ | Sepolia | 11155111 |
310
340
 
311
341
  ### RPC Guidance By Chain
312
342
 
@@ -331,42 +361,42 @@ Practical rule:
331
361
 
332
362
  All config can be passed as flags. Flags override environment variables.
333
363
 
334
- | Flag | Env Var | Default | Purpose |
335
- |------|---------|---------|---------|
336
- | `--backend-url` | `AOMI_BASE_URL` | `https://api.aomi.dev` | Backend URL |
337
- | `--api-key` | `AOMI_API_KEY` | none | API key for non-default apps |
338
- | `--app` | `AOMI_APP` | `default` | Backend app |
339
- | `--model` | `AOMI_MODEL` | backend default | Session model |
340
- | `--public-key` | `AOMI_PUBLIC_KEY` | none | Wallet address for chat/session context |
341
- | `--private-key` | `PRIVATE_KEY` | none | Signing key for `aomi sign` |
342
- | `--rpc-url` | `CHAIN_RPC_URL` | chain RPC default | RPC override for signing |
343
- | `--chain` | `AOMI_CHAIN_ID` | `1` | Active wallet chain |
344
- | `--aa-provider` | `AOMI_AA_PROVIDER` | auto | AA provider override |
345
- | `--aa-mode` | `AOMI_AA_MODE` | chain default | AA mode override |
364
+ | Flag | Env Var | Default | Purpose |
365
+ | --------------- | ------------------ | ---------------------- | --------------------------------------- |
366
+ | `--backend-url` | `AOMI_BASE_URL` | `https://api.aomi.dev` | Backend URL |
367
+ | `--api-key` | `AOMI_API_KEY` | none | API key for non-default apps |
368
+ | `--app` | `AOMI_APP` | `default` | Backend app |
369
+ | `--model` | `AOMI_MODEL` | backend default | Session model |
370
+ | `--public-key` | `AOMI_PUBLIC_KEY` | none | Wallet address for chat/session context |
371
+ | `--private-key` | `PRIVATE_KEY` | none | Signing key for `aomi sign` |
372
+ | `--rpc-url` | `CHAIN_RPC_URL` | chain RPC default | RPC override for signing |
373
+ | `--chain` | `AOMI_CHAIN_ID` | `1` | Active wallet chain |
374
+ | `--aa-provider` | `AOMI_AA_PROVIDER` | auto | AA provider override |
375
+ | `--aa-mode` | `AOMI_AA_MODE` | chain default | AA mode override |
346
376
 
347
377
  ### AA Provider Credentials
348
378
 
349
- | Env Var | Purpose |
350
- |---------|---------|
351
- | `ALCHEMY_API_KEY` | Enables Alchemy AA |
379
+ | Env Var | Purpose |
380
+ | ----------------------- | ----------------------------------- |
381
+ | `ALCHEMY_API_KEY` | Enables Alchemy AA |
352
382
  | `ALCHEMY_GAS_POLICY_ID` | Optional Alchemy sponsorship policy |
353
- | `PIMLICO_API_KEY` | Enables Pimlico AA |
383
+ | `PIMLICO_API_KEY` | Enables Pimlico AA |
354
384
 
355
385
  `ALCHEMY_API_KEY` can also be used to construct chain-specific signing RPCs:
356
386
 
357
- | Chain | Example Alchemy RPC |
358
- |-------|---------------------|
359
- | Ethereum | `https://eth-mainnet.g.alchemy.com/v2/<ALCHEMY_API_KEY>` |
360
- | Polygon | `https://polygon-mainnet.g.alchemy.com/v2/<ALCHEMY_API_KEY>` |
361
- | Arbitrum | `https://arb-mainnet.g.alchemy.com/v2/<ALCHEMY_API_KEY>` |
362
- | Base | `https://base-mainnet.g.alchemy.com/v2/<ALCHEMY_API_KEY>` |
363
- | Optimism | `https://opt-mainnet.g.alchemy.com/v2/<ALCHEMY_API_KEY>` |
364
- | Sepolia | `https://eth-sepolia.g.alchemy.com/v2/<ALCHEMY_API_KEY>` |
387
+ | Chain | Example Alchemy RPC |
388
+ | -------- | ------------------------------------------------------------ |
389
+ | Ethereum | `https://eth-mainnet.g.alchemy.com/v2/<ALCHEMY_API_KEY>` |
390
+ | Polygon | `https://polygon-mainnet.g.alchemy.com/v2/<ALCHEMY_API_KEY>` |
391
+ | Arbitrum | `https://arb-mainnet.g.alchemy.com/v2/<ALCHEMY_API_KEY>` |
392
+ | Base | `https://base-mainnet.g.alchemy.com/v2/<ALCHEMY_API_KEY>` |
393
+ | Optimism | `https://opt-mainnet.g.alchemy.com/v2/<ALCHEMY_API_KEY>` |
394
+ | Sepolia | `https://eth-sepolia.g.alchemy.com/v2/<ALCHEMY_API_KEY>` |
365
395
 
366
396
  ### Storage
367
397
 
368
- | Env Var | Default | Purpose |
369
- |---------|---------|---------|
398
+ | Env Var | Default | Purpose |
399
+ | ---------------- | --------- | -------------------------------------- |
370
400
  | `AOMI_STATE_DIR` | `~/.aomi` | Root directory for local session state |
371
401
 
372
402
  Storage layout by default: