aomi-transact
Original:🇺🇸 English
Translated
Use when the user wants to interact with the Aomi CLI to inspect sessions, check balances or prices, build wallet requests, confirm quotes or routes, sign transactions or EIP-712 payloads, switch apps or chains, or execute swaps, transfers, and DeFi actions on-chain. Covers Aomi chat, transaction review, account-abstraction signing with automatic EOA fallback, session controls, and per-session secret ingestion.
2installs
Sourceaomi-labs/skills
Added on
NPX Install
npx skill4agent add aomi-labs/skills aomi-transactTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Aomi Transact
Use the CLI as an agent operating procedure, not as a long-running shell.
Each command starts, runs, and exits. Conversation history lives on the
backend. Local session data lives under or .
aomiAOMI_STATE_DIR~/.aomiUse This Skill When
- The user wants to chat with the Aomi agent from the terminal.
- The user wants balances, prices, routes, quotes, or transaction status.
- The user wants to build, simulate, confirm, sign, or broadcast wallet requests.
- The user wants to simulate a batch of pending transactions before signing.
- The user wants to inspect or switch apps, models, chains, or sessions.
- The user wants to inject API keys or other backend secrets for the current session.
Hard Rules
- Never print secrets verbatim in normal status, preflight, or confirmation output.
- Treat ,
PRIVATE_KEY,AOMI_API_KEY,ALCHEMY_API_KEY, and private RPC URLs as secrets.PIMLICO_API_KEY - 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.
- Prefer over stuffing provider API keys into normal chat text.
aomi --secret NAME=value ... - Do not sign anything unless the CLI has actually queued a wallet request and you can identify its ID.
tx-N - When starting work from a new Codex or assistant chat thread, default the first Aomi command to unless the user explicitly wants to continue an existing session.
--new-session - If is set in the environment, do not also pass
PRIVATE_KEYunless you intentionally want to override the environment value.--private-key - must match the address derived from the signing key. If they differ,
--public-keywill update the session to the signer address.aomi sign - Private keys must start with . Add the prefix if missing.
0x - is only one default RPC URL. When switching chains, prefer passing
CHAIN_RPC_URLon--rpc-url.aomi sign - Switching the chat/session chain with does not switch
--chain. The RPC used forCHAIN_RPC_URLmust match the pending transaction's chain.aomi sign - and
--aa-providerare AA-only controls and cannot be used with--aa-mode.--eoa
Quick Start
Run this once at the start of the session:
bash
aomi --version
aomi status 2>/dev/null || echo "no session"If the user is asking for a read-only result, that may be enough. If they want
to build or sign a transaction, continue with the workflow below.
Default Workflow
- Chat with the agent.
- If the agent asks whether to proceed, send a short confirmation in the same session.
- Review pending requests with .
aomi tx - For multi-step flows (e.g. approve → swap), simulate before signing: .
aomi simulate tx-1 tx-2 - Sign the queued request(s).
- Verify with ,
aomi tx, oraomi log.aomi status
The CLI output is the source of truth. If you do not see , there is nothing to sign yet.
Wallet request queued: tx-NWorkflow Details
Read-Only Requests
Use these when the user does not need signing:
bash
aomi chat "<message>" --new-session
aomi chat "<message>" --verbose
aomi tx
aomi log
aomi status
aomi events
aomi --version
aomi app list
aomi app current
aomi model list
aomi model current
aomi chain list
aomi session list
aomi session resume <id>Notes:
- Quote the chat message.
- On the first command in a new Codex or assistant thread, prefer so old local/backend state does not bleed into the new task.
--new-session - Use when debugging tool calls or streaming behavior.
--verbose - Pass on the first wallet-aware chat if the backend needs the user's address.
--public-key - For chain-specific requests, prefer on the command itself. Use
--chain <id>only when multiple consecutive commands should stay on the same chain.AOMI_CHAIN_ID=<id> - Use to inspect configured secret handles for the active session.
aomi secret list - wipes the active local session pointer and starts a fresh thread next time.
aomi close
Secret Ingestion
Use this when the backend or selected app needs API keys, provider tokens, or
other named secrets for the current session:
bash
aomi --secret ALCHEMY_API_KEY=sk_live_123 --new-session
aomi --secret ALCHEMY_API_KEY=sk_live_123 chat "simulate a swap on Base" --new-session
aomi secret list
aomi secret clearImportant behavior:
- with no command ingests secrets into the active session and exits.
aomi --secret NAME=value - ingests first, then runs the command.
aomi --secret NAME=value chat "..." - prints secret handle names, not raw values.
aomi secret list - removes all secrets for the active session.
aomi secret clear - Do not combine with
--secret.aomi secret clear
Building Wallet Requests
Use the first chat turn to give the agent the task and, if relevant, the wallet
address and chain:
bash
aomi chat "swap 1 ETH for USDC" --new-session --public-key 0xYourAddress --chain 1If the user wants a different backend app or chain, pass them explicitly on the
next command:
bash
aomi chat "show my balances" --app khalani
aomi chat "swap 1 POL for USDC on Polygon" --chain 137
aomi chat "swap 1 POL for USDC on Polygon" --app khalani --chain 137Important behavior:
- A chat response does not always queue a transaction immediately.
- The agent may return a quote, route, timing estimate, or deposit method and ask whether to proceed.
- When that happens, keep the same session and reply with a short confirmation message.
- Only move to after a wallet request is queued.
aomi sign - For Khalani, prefer a deposit method when available. The intended flow is quote -> sign transfer -> submit/continue after the transfer settles.
TRANSFER - Avoid Khalani routes that require ERC-20 approval unless the user explicitly wants that path or no transfer route is available.
CONTRACT_CALL
Queued request example:
⚡ Wallet request queued: tx-1
to: 0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD
value: 1000000000000000000
chain: 1
Run `aomi tx` to see pending transactions, `aomi sign <id>` to sign.Signing Policy
Use these rules exactly:
- Default command:
aomi sign <tx-id> [<tx-id> ...] - Default behavior: try account abstraction (AA) first, retry unsponsored AA when Alchemy sponsorship is unavailable, then fall back to EOA automatically if AA still fails.
- : require AA with no EOA fallback.
--aa - : force direct EOA execution.
--eoa - or
--aa-provider: AA-specific controls. Use them only when the user explicitly wants a provider or mode.--aa-mode
Examples:
bash
# Default: AA first, automatic EOA fallback if needed
aomi sign tx-1 --private-key 0xYourPrivateKey --rpc-url https://eth.llamarpc.com
# Require AA only
aomi sign tx-1 --aa --private-key 0xYourPrivateKey
# Force EOA only
aomi sign tx-1 --eoa --private-key 0xYourPrivateKey --rpc-url https://eth.llamarpc.com
# Explicit AA provider and mode
aomi sign tx-1 --aa-provider pimlico --aa-mode 4337 --private-key 0xYourPrivateKeyBatch Simulation
Use to dry-run pending transactions before signing. Simulation
runs each tx sequentially on a forked chain so state-dependent flows (approve →
swap) are validated as a batch — the swap sees the approve's state changes.
aomi simulatebash
# Simulate a single pending tx
aomi simulate tx-1
# Simulate a multi-step batch in order (approve then swap)
aomi simulate tx-1 tx-2The response includes per-step success/failure, revert reasons, and gas usage:
Simulation result:
Batch success: true
Stateful: true
Total gas: 147821
Step 1 — approve USDC
success: true
gas_used: 46000
Step 2 — swap on Uniswap
success: true
gas_used: 101821When to simulate:
- Always simulate multi-step flows (approve → swap, approve → deposit, etc.) before signing. These are state-dependent — the second tx will revert if submitted independently.
- Optional for single independent txs like a simple ETH transfer or a standalone swap with no prior approval needed.
- If simulation fails at step N, read the revert reason before retrying. Common causes: insufficient balance, expired quote/timestamp, wrong calldata. Do not blindly re-sign after a simulation failure.
When not to simulate:
- Read-only operations (balances, prices, quotes).
- If there are no pending transactions (shows nothing).
aomi tx
Simulation and signing workflow:
bash
# 1. Build the request
aomi chat "approve and swap 100 USDC for ETH on Uniswap" \
--public-key 0xYourAddress --chain 1
# 2. Check what got queued
aomi tx
# 3. Simulate the batch
aomi simulate tx-1 tx-2
# 4. If simulation succeeds, sign
aomi sign tx-1 tx-2 --private-key 0xYourPrivateKey --rpc-url https://eth.llamarpc.com
# 5. Verify
aomi txAccount Abstraction
AA is the preferred signing path when the user wants smart-account behavior,
gas sponsorship, or the CLI's automated fallback handling.
Use AA when:
- The user wants the most hands-off signing flow and is fine with the CLI trying AA before EOA.
- The user wants sponsored or user-funded smart-account execution through Alchemy or Pimlico.
- The user explicitly asks for or
4337account-abstraction mode.7702
How to choose:
- with no AA flags: try AA first, then fall back to EOA automatically if AA is unavailable.
aomi sign - : require AA only. Use this when the user does not want an EOA fallback.
aomi sign --aa - : bypass AA entirely and sign directly with the wallet key.
aomi sign --eoa - : force a specific AA provider.
aomi sign --aa-provider alchemy|pimlico - : force the execution mode when the user wants a specific AA path.
aomi sign --aa-mode 4337|7702
More signing notes:
- handles both transaction requests and EIP-712 typed data signatures.
aomi sign - Batch signing is supported for transaction requests only, not EIP-712 requests.
- A single override cannot be used for a mixed-chain multi-sign request.
--rpc-url - If the signer address differs from the stored session public key, the CLI updates the session to the signer address.
- The pending transaction already contains its target chain. Use a signing RPC for that same chain.
- If points to Ethereum but the pending transaction is on Polygon, Arbitrum, Base, Optimism, or Sepolia, override it with a matching
CHAIN_RPC_URL.--rpc-url - Prefer a reliable chain-specific RPC over generic public RPCs, which may return ,
401, or generic parameter errors.429 - If is available, prefer constructing the matching chain-specific Alchemy RPC before trying generic public RPCs.
ALCHEMY_API_KEY - If the available RPC looks unreliable, try at most one or two reasonable chain-specific public RPCs, then ask the user for a proper provider-backed RPC URL for that chain instead of continuing to guess.
Session And Storage Notes
- Active session, app, model, chain, pending txs, and signed txs are stored locally under or
AOMI_STATE_DIR.~/.aomi - Session files live under by default and get local IDs like
~/.aomi/sessions/.session-1 - Useful commands:
bash
aomi session list
aomi session resume <id>
aomi session delete <id>
aomi closeReference: Commands
Chat
bash
aomi chat "<message>" --new-session
aomi chat "<message>" --verbose
aomi chat "<message>" --model <rig>
aomi chat "<message>" --public-key 0xYourAddress --chain 1
aomi chat "<message>" --app khalani --chain 137- Quote the message.
- On the first command in a new Codex or assistant thread, prefer .
--new-session - Use to stream tool calls and agent output.
--verbose - Use on the first wallet-aware message.
--public-key - Use ,
--app, and--modelto change the active context for the next request.--chain - Prefer for one-off chain-specific requests. Use
--chain <id>when several consecutive commands should share the same chain context.AOMI_CHAIN_ID=<id>
Transaction Inspection
bash
aomi tx
aomi log
aomi status
aomi events
aomi secret list
aomi secret clear- inspects pending and signed requests.
aomi tx - replays conversation and tool output.
aomi log - shows the current session summary.
aomi status - shows raw backend system events.
aomi events - shows configured secret handles for the active session.
aomi secret list - removes all configured secrets for the active session.
aomi secret clear
Batch Simulation
bash
aomi simulate <tx-id> [<tx-id> ...]- Runs pending transactions sequentially on a forked chain (Anvil snapshot/revert).
- Each tx sees state changes from previous txs — validates state-dependent flows like approve → swap.
- Returns per-step success/failure, revert reasons, and .
gas_used - Returns for the entire batch.
total_gas - No on-chain state is modified — the fork is reverted after simulation.
- Requires pending transactions to exist in the session (to check).
aomi tx
App And Model Commands
bash
aomi app list
aomi app current
aomi model list
aomi model current
aomi model set <rig>- shows available backend apps.
aomi app list - shows the active app from local session state.
aomi app current - persists the selected model for the current session.
aomi model set <rig> - also applies a model for the session.
aomi chat --model <rig> "<message>"
Chain Commands
bash
aomi chain listSession Commands
bash
aomi session list
aomi session new
aomi session resume <id>
aomi session delete <id>
aomi close- Session selectors accept the backend session ID, , or
session-N.N - clears the active local session pointer. The next chat starts fresh.
aomi close
Reference: Account Abstraction
Signing Modes
- Default : try AA first, retry unsponsored Alchemy AA when sponsorship is unavailable, then fall back to EOA automatically.
aomi sign ... - : require AA only. Do not fall back to EOA.
aomi sign ... --aa - : force direct EOA signing.
aomi sign ... --eoa
AA Providers
| Provider | Flag | Env Var | Notes |
|---|---|---|---|
| Alchemy | | | Supports sponsorship, 4337, 7702 |
| Pimlico | | | Supports 4337 and 7702 |
Provider selection rules:
- If the user explicitly selects a provider, use it.
- In default mode, the CLI prefers the first configured AA provider.
- If no AA provider is configured, default mode uses EOA directly.
AA Modes
| Mode | Flag | Meaning |
|---|---|---|
| | Bundler-based smart account flow |
| | Delegated execution flow |
Default Chain Modes
| Chain | ID | Default AA Mode |
|---|---|---|
| Ethereum | 1 | 7702 |
| Polygon | 137 | 4337 |
| Arbitrum | 42161 | 4337 |
| Base | 8453 | 4337 |
| Optimism | 10 | 4337 |
Sponsorship
Alchemy sponsorship is optional.
bash
export ALCHEMY_API_KEY=your-key
export ALCHEMY_GAS_POLICY_ID=your-policy-id
aomi sign tx-1Default signing behavior for Alchemy:
- Try sponsored AA.
- If sponsorship is unavailable, retry AA with user-funded gas.
- If AA still fails and the mode is default auto mode, fall back to EOA.
Supported Chains
| Chain | ID |
|---|---|
| Ethereum | 1 |
| Polygon | 137 |
| Arbitrum One | 42161 |
| Base | 8453 |
| Optimism | 10 |
| Sepolia | 11155111 |
RPC Guidance By Chain
Use an RPC that matches the pending transaction's chain:
- Ethereum txs -> Ethereum RPC
- Polygon txs -> Polygon RPC
- Arbitrum txs -> Arbitrum RPC
- Base txs -> Base RPC
- Optimism txs -> Optimism RPC
- Sepolia txs -> Sepolia RPC
Practical rule:
- affects the wallet/session context for chat and request building.
--chain - affects where
--rpc-urlestimates and submits the transaction.aomi sign - Treat them as separate controls and keep them aligned with the transaction you are signing.
Reference: Configuration
Flags And Env Vars
All config can be passed as flags. Flags override environment variables.
| Flag | Env Var | Default | Purpose |
|---|---|---|---|
| | | Backend URL |
| | none | API key for non-default apps |
| | | Backend app |
| | backend default | Session model |
| | none | Wallet address for chat/session context |
| | none | Signing key for |
| | chain RPC default | RPC override for signing |
| | | Active wallet chain |
| | auto | AA provider override |
| | chain default | AA mode override |
AA Provider Credentials
| Env Var | Purpose |
|---|---|
| Enables Alchemy AA |
| Optional Alchemy sponsorship policy |
| Enables Pimlico AA |
ALCHEMY_API_KEY| Chain | Example Alchemy RPC |
|---|---|
| Ethereum | |
| Polygon | |
| Arbitrum | |
| Base | |
| Optimism | |
| Sepolia | |
Storage
| Env Var | Default | Purpose |
|---|---|---|
| | Root directory for local session state |
Storage layout by default:
- stores per-session JSON files.
~/.aomi/sessions/ - stores the active local session pointer.
~/.aomi/active-session.txt
Important Config Rules
- should start with
PRIVATE_KEY.0x - If is already set in the environment, do not also pass
PRIVATE_KEYunless you intentionally want to override it.--private-key - is only one default RPC URL. For chain switching, prefer passing
CHAIN_RPC_URLon--rpc-url.aomi sign - If the user switches from Ethereum to Polygon, Arbitrum, Base, Optimism, or Sepolia, do not keep using an Ethereum for signing.
CHAIN_RPC_URL - and
--aa-providercannot be used with--aa-mode.--eoa - In default signing mode, missing AA credentials cause the CLI to use EOA directly.
Reference: Examples
Read-Only Chat
bash
aomi chat "what is the price of ETH?" --verbose
aomi logBasic Swap Flow
bash
# 1. Start a wallet-aware session on Ethereum
aomi chat "swap 1 ETH for USDC on Uniswap" \
--public-key 0xYourAddress \
--chain 1
# 2. If the agent only returns a quote, confirm in the same session
aomi chat "proceed"
# 3. Review the queued request
aomi tx
# 4. Sign with default behavior: AA first, then automatic EOA fallback if needed
aomi sign tx-1 \
--private-key 0xYourPrivateKey \
--rpc-url https://eth.llamarpc.com
# 5. Verify
aomi tx
aomi logApprove + Swap With Simulation
bash
# 1. Build a multi-step request
aomi chat "approve and swap 500 USDC for ETH on Uniswap" \
--public-key 0xYourAddress --chain 1
# 2. Check queued requests
aomi tx
# 3. Simulate the batch — approve then swap
aomi simulate tx-1 tx-2
# 4. If simulation passes, sign the batch
aomi sign tx-1 tx-2 \
--private-key 0xYourPrivateKey \
--rpc-url https://eth.llamarpc.com
# 5. Verify
aomi txExplicit EOA Flow
bash
aomi sign tx-1 \
--eoa \
--private-key 0xYourPrivateKey \
--rpc-url https://eth.llamarpc.comExplicit AA Flow
bash
aomi sign tx-1 \
--aa \
--aa-provider pimlico \
--aa-mode 4337 \
--private-key 0xYourPrivateKeyAlchemy Sponsorship Flow
bash
export ALCHEMY_API_KEY=your-alchemy-key
export ALCHEMY_GAS_POLICY_ID=your-policy-id
export PRIVATE_KEY=0xYourPrivateKey
export CHAIN_RPC_URL=https://eth.llamarpc.com
aomi chat "swap 100 USDC for ETH" --public-key 0xYourAddress --chain 1
aomi sign tx-1Switching App And Chain
bash
aomi chat "show my balances" --app khalani
aomi chat "swap 1 POL for USDC on Polygon" --app khalani --chain 137
aomi txKhalani Transfer Flow
bash
# 1. Ask for a quote and prefer a transfer-based deposit route
aomi chat "swap 0.1 USDC for WETH using Khalani. Prefer a TRANSFER deposit method over CONTRACT_CALL if available." --app khalani --chain 1
# 2. If the agent asks for confirmation, confirm in the same session
aomi chat "proceed with the transfer route"
# 3. Review the queued transfer request
aomi tx
# 4. Sign the transfer
aomi sign tx-1 --private-key 0xYourPrivateKey --rpc-url https://eth.llamarpc.com
# 5. Continue with the agent if a submit/finalize step is required
aomi chat "the transfer has been sent, continue"Cross-Chain RPC Example
bash
# Build the request on Polygon
aomi chat "swap 0.1 USDC for WETH using Khalani on Polygon" --app khalani --chain 137
aomi tx
# Sign with a Polygon RPC, even if CHAIN_RPC_URL is still set to Ethereum
aomi sign tx-8 --rpc-url https://polygon.drpc.org --chain 137Session Control
bash
aomi session list
aomi session resume 2
aomi status
aomi closeTroubleshooting
- If returns
aomi chat, wait briefly and run(no response).aomi status - If signing fails in default mode, the CLI may already retry with unsponsored AA and then EOA. Read the console output before retrying manually.
- If AA is required and fails, check or
ALCHEMY_API_KEY, the selected chain, and any requestedPIMLICO_API_KEY.--aa-mode - If a transaction fails on-chain, check the RPC URL, balance, and chain.
- ,
401, and generic parameter errors during429are often RPC problems rather than transaction-construction problems. Try a reliable RPC for the correct chain.aomi sign - If is set, construct the correct chain-specific Alchemy RPC before falling back to random public endpoints.
ALCHEMY_API_KEY - If one or two public RPCs fail for the same chain, stop rotating through random endpoints and ask the user for a proper RPC URL for that chain.
- If fails with a revert, read the revert reason. Common causes: expired quote or timestamp (re-chat to get a fresh quote), insufficient token balance, or missing prior approval. Do not sign transactions that failed simulation without understanding why.
aomi simulate - If returns
aomi simulate, the backend could not fork the chain — simulation ran each tx independently viastateful: false, so state-dependent flows (approve → swap) may show false negatives. Retry or check that the backend's Anvil instance is running.eth_call