|
| 1 | +# AGW Context |
| 2 | + |
| 3 | +AGW is an agent-first CLI for Abstract Global Wallet workflows. Treat the CLI as the source of truth. |
| 4 | + |
| 5 | +## Rules |
| 6 | + |
| 7 | +- Use `agw-cli schema <commandId>` whenever the request or response shape is unclear. |
| 8 | +- Pass command input with `--json <payload|@file>`. |
| 9 | +- Keep runtime config out of JSON payloads. Use `AGW_*` env vars or CLI flags such as `--home`, `--chain-id`, `--rpc-url`, and `--app-url`. |
| 10 | +- Treat signing and state-changing commands as preview-first. |
| 11 | +- Use `--dry-run` to validate locally and inspect the preview. |
| 12 | +- Use `--execute` only after explicit user confirmation. |
| 13 | +- Never infer execute permission from a successful preview. |
| 14 | +- Keep reads narrow with `fields`. |
| 15 | +- Use pagination on list surfaces and prefer `--page-all --output ndjson` for large result sets. |
| 16 | +- Parse stdout only. Diagnostics and warnings belong on stderr. |
| 17 | +- Prefer MCP when the host supports it. The MCP server is generated from the same registry as the CLI. |
| 18 | +- Sanitization profiles are `off` and `strict`. MCP and extension surfaces default to `strict`. |
| 19 | + |
| 20 | +## Config |
| 21 | + |
| 22 | +Public runtime config is: |
| 23 | + |
| 24 | +- `AGW_HOME` |
| 25 | +- `AGW_CHAIN_ID` |
| 26 | +- `AGW_RPC_URL` |
| 27 | +- `AGW_APP_URL` |
| 28 | +- `AGW_OUTPUT` |
| 29 | +- `AGW_CALLBACK_SIGNING_PUBLIC_KEY` |
| 30 | +- `AGW_CALLBACK_SIGNING_ISSUER` |
| 31 | +- `AGW_SANITIZE_PROFILE` |
| 32 | + |
| 33 | +## Common Patterns |
| 34 | + |
| 35 | +Inspect schema: |
| 36 | + |
| 37 | +```bash |
| 38 | +agw-cli schema tx.send |
| 39 | +``` |
| 40 | + |
| 41 | +Inspect session state: |
| 42 | + |
| 43 | +```bash |
| 44 | +agw-cli session status --json '{"fields":["status","readiness","accountAddress"]}' |
| 45 | +``` |
| 46 | + |
| 47 | +Preview a mutating action: |
| 48 | + |
| 49 | +```bash |
| 50 | +agw-cli tx send --json '{"to":"0x...","data":"0x1234","value":"0"}' --dry-run |
| 51 | +``` |
| 52 | + |
| 53 | +Execute after confirmation: |
| 54 | + |
| 55 | +```bash |
| 56 | +agw-cli tx send --json '{"to":"0x...","data":"0x1234","value":"0"}' --execute |
| 57 | +``` |
| 58 | + |
| 59 | +Stream a paginated read: |
| 60 | + |
| 61 | +```bash |
| 62 | +agw-cli wallet tokens list \ |
| 63 | + --json '{"pageSize":25,"fields":["items.symbol","items.value","nextCursor"]}' \ |
| 64 | + --page-all \ |
| 65 | + --output ndjson |
| 66 | +``` |
0 commit comments