@heyamiko/amiko-cli 0.9.0 → 0.9.2

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/dist/index.js CHANGED
@@ -21788,6 +21788,66 @@ function registerWalletsCreateCommand(program2) {
21788
21788
  }
21789
21789
  });
21790
21790
  }
21791
+ function registerWalletsTransferCommand(program2) {
21792
+ program2.command("transfer").description("Transfer tokens from a twin wallet to another address").requiredOption("--to <address>", "Recipient address").requiredOption("--amount <amount>", "Amount to send (e.g., 0.5)").requiredOption("--token <symbol>", "Token symbol (sol, usdc, usdt, amiko, eth) or mint/contract address").option("--wallet <address>", "Source wallet (defaults to your Solana wallet)").option("--chain <chain>", "Preferred chain when resolving default wallet (solana | base)", "solana").option("--yes", "Skip confirmation").option("--json", "Output raw JSON").action(async (opts) => {
21793
+ let auth;
21794
+ try {
21795
+ auth = requireAuth();
21796
+ } catch (e) {
21797
+ console.error(error(e instanceof Error ? e.message : String(e)));
21798
+ process.exit(1);
21799
+ }
21800
+ const chain = opts.chain.toLowerCase();
21801
+ if (chain !== "solana" && chain !== "base") {
21802
+ console.error(error(`Unsupported chain '${opts.chain}'. Use solana or base.`));
21803
+ process.exit(1);
21804
+ }
21805
+ let wallet;
21806
+ try {
21807
+ wallet = await resolveWalletAddress(auth, opts.wallet, chain);
21808
+ } catch (e) {
21809
+ console.error(error(e instanceof Error ? e.message : String(e)));
21810
+ process.exit(1);
21811
+ }
21812
+ if (!opts.json) {
21813
+ console.log(heading("Transfer"));
21814
+ console.log("");
21815
+ console.log(label("From", wallet));
21816
+ console.log(label("To", opts.to));
21817
+ console.log(label("Amount", `${opts.amount} ${opts.token.toUpperCase()}`));
21818
+ console.log("");
21819
+ }
21820
+ await requireApproval({
21821
+ cost: `${chain} gas`,
21822
+ summary: `transfer ${opts.amount} ${opts.token.toUpperCase()} from ${truncAddr(wallet)} to ${truncAddr(opts.to)}`,
21823
+ yes: opts.yes,
21824
+ commandExample: `amiko wallets transfer --to ${opts.to} --amount ${opts.amount} --token ${opts.token}`
21825
+ });
21826
+ const spinner = opts.json ? null : ora("Sending transfer...").start();
21827
+ try {
21828
+ const data = await amikoWebFetch(auth, `/api/agents/${encodeURIComponent(auth.twinId)}/wallets/${encodeURIComponent(wallet)}/transfer`, {
21829
+ method: "POST",
21830
+ body: { to: opts.to, amount: opts.amount, token: opts.token }
21831
+ });
21832
+ spinner?.stop();
21833
+ if (opts.json) {
21834
+ console.log(JSON.stringify(data, null, 2));
21835
+ return;
21836
+ }
21837
+ console.log(success("Transfer submitted"));
21838
+ console.log("");
21839
+ console.log(label("Status", data.crossmint.status));
21840
+ if (data.txHash)
21841
+ console.log(label("Tx", data.txHash));
21842
+ if (data.transaction?.id)
21843
+ console.log(label("Transaction", data.transaction.id));
21844
+ } catch (e) {
21845
+ spinner?.stop();
21846
+ console.error(error(e instanceof Error ? e.message : "Failed to transfer"));
21847
+ process.exit(1);
21848
+ }
21849
+ });
21850
+ }
21791
21851
  function registerWalletsListCommand(program2) {
21792
21852
  program2.command("list").alias("ls").description("List wallets for the authenticated twin").option("--json", "Output raw JSON").action(async (opts) => {
21793
21853
  let auth;
@@ -21859,6 +21919,7 @@ registerAmazonCommand(markets);
21859
21919
  registerWalletsCreateCommand(wallets);
21860
21920
  registerWalletsListCommand(wallets);
21861
21921
  registerWalletsBalanceCommand(wallets);
21922
+ registerWalletsTransferCommand(wallets);
21862
21923
  registerSwapCommand(wallets);
21863
21924
  registerBridgeCommand(wallets);
21864
21925
  registerConfigCommand(program2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heyamiko/amiko-cli",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "Amiko CLI — swap tokens, manage credits, bridge cross-chain, and call marketplace agents",
5
5
  "type": "module",
6
6
  "bin": {
package/skills/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: amiko-cli
3
- description: The Amiko CLI lets an agent act on the Amiko platform end-to-end — manage Solana/Base wallets (create, swap via Jupiter, bridge USDC via Across), top up and spend credits, call paid MPP marketplace services (X/Twitter search, image generation, Amazon product search, TTS/STT, AI chat, SFX/music), manage the twin's identity and RAG documents, voice and avatar, social graph (friends, posts, comments, feed), and Composio OAuth connections. Auth is automatic when run from the agent's workspace folder; payments are platform-custodied (no keys on disk). Use this skill whenever the user asks to do anything that would show up in their Amiko account or cost AMIKO/credits.
3
+ description: The Amiko CLI lets an agent act on the Amiko platform end-to-end — manage Solana/Base wallets (create, swap via Jupiter, bridge USDC via Across, transfer tokens to external addresses), top up and spend credits, call paid MPP marketplace services (X/Twitter search, image generation, Amazon product search, TTS/STT, AI chat, SFX/music), manage the twin's identity and RAG documents, voice and avatar, social graph (friends, posts, comments, feed), and Composio OAuth connections. Auth is automatic when run from the agent's workspace folder; payments are platform-custodied (no keys on disk). Use this skill whenever the user asks to do anything that would show up in their Amiko account or cost AMIKO/credits.
4
4
  homepage: https://platform.heyamiko.com
5
5
  metadata: {"openclaw":{"emoji":"🤖","requires":{"bins":["node"]}}}
6
6
  ---
@@ -20,7 +20,7 @@ Each row is a first-level command group or command. Start here when the user ask
20
20
  | Command | What it does |
21
21
  |---------|--------------|
22
22
  | `amiko markets <cmd>` | Paid MPP services: X search, image gen, Amazon, TTS/STT/chat, generic service call, discover |
23
- | `amiko wallets <cmd>` | Wallet ops: create, list, sync balance, swap on Solana (Jupiter), bridge USDC cross-chain (Across) |
23
+ | `amiko wallets <cmd>` | Wallet ops: create, list, sync balance, transfer tokens out, swap on Solana (Jupiter), bridge USDC cross-chain (Across) |
24
24
  | `amiko credits <cmd>` | Show credit balance, top up with AMIKO/SOL/USDC/USDT (10,000 credits = $1) |
25
25
  | `amiko twin <cmd>` | Update the twin's identity — name, description, public visibility |
26
26
  | `amiko docs <cmd>` | Manage twin RAG documents — list, upload (path/URL/stdin), delete, presign |
@@ -40,7 +40,7 @@ All twin-scoped commands accept `--twin <id>` to target a non-default twin.
40
40
 
41
41
  ## The `--wallet` default (read this before any paid command)
42
42
 
43
- Every paid command (`markets search`, `markets image`, `markets amazon search`, `markets service *`, `wallets swap send`) spends tokens from an on-chain wallet. As of v0.9.0-beta.9 you almost never need to pass `--wallet` explicitly:
43
+ Every paid / value-moving command (`markets search`, `markets image`, `markets amazon search`, `markets service *`, `wallets swap send`, `wallets bridge send`, `wallets transfer`) spends tokens from an on-chain wallet. As of v0.9.0-beta.9 you almost never need to pass `--wallet` explicitly:
44
44
 
45
45
  - **Default**: the CLI auto-selects the twin's first active **Solana** wallet from `GET /api/agents/{id}/wallets`.
46
46
  - **Override**: pass `--wallet <address>` only if you want a different wallet than the default.
@@ -51,7 +51,7 @@ Every paid command (`markets search`, `markets image`, `markets amazon search`,
51
51
 
52
52
  ## Critical Rules
53
53
 
54
- 1. **Every paid / value-moving command is hard-gated on `--yes` in a non-interactive shell.** The CLI *refuses* to run `markets image`, `markets search`, `markets amazon search`, `markets service call`, `markets service tts`, `markets service stt`, `markets service chat`, `credits topup`, `wallets swap send`, or `wallets bridge send` unless `--yes` is passed. The refusal is loud: it prints the cost and the command you should re-run. **Quote the cost to the user, get explicit approval, THEN append `--yes`**. Same for destructive non-paid commands (`twin update --public`, `docs delete`, `friends remove`, `friends reports request`, `avatar update`, `voice reset`, `composio disconnect`).
54
+ 1. **Every paid / value-moving command is hard-gated on `--yes` in a non-interactive shell.** The CLI *refuses* to run `markets image`, `markets search`, `markets amazon search`, `markets service call`, `markets service tts`, `markets service stt`, `markets service chat`, `credits topup`, `wallets swap send`, `wallets bridge send`, or `wallets transfer` unless `--yes` is passed. The refusal is loud: it prints the cost and the command you should re-run. **Quote the cost to the user, get explicit approval, THEN append `--yes`**. Same for destructive non-paid commands (`twin update --public`, `docs delete`, `friends remove`, `friends reports request`, `avatar update`, `voice reset`, `composio disconnect`).
55
55
  2. **After every paid command, report the remaining balance.** The CLI prints a `Balance: N credits` line at the end of every paid command — include that figure in your reply.
56
56
  3. **Never retry a failed command.** Report the error and stop. Every paid call costs tokens even on failure.
57
57
  4. **Never suggest `amiko login` or `amiko connect`.** These don't exist. Auth is automatic when you run from your workspace folder.
@@ -72,6 +72,7 @@ Every paid command (`markets search`, `markets image`, `markets amazon search`,
72
72
  | `amiko markets service call POST /v1/music/plan ...` | $0.02 |
73
73
  | `amiko wallets swap quote ...` | Free |
74
74
  | `amiko wallets swap send ...` | Solana gas + 10bps |
75
+ | `amiko wallets transfer ...` | Chain gas only |
75
76
  | `amiko credits topup ...` | Whatever amount you top up |
76
77
 
77
78
  ## Credits
@@ -107,6 +108,7 @@ Supported tokens: AMIKO, SOL, USDC, USDT. The CLI fetches the live price, the pl
107
108
  amiko wallets list # all twin wallets + cached balances
108
109
  amiko wallets create --chain solana # create a wallet (solana | base)
109
110
  amiko wallets balance <address> # force-sync one wallet; returns fresh balances
111
+ amiko wallets transfer --to <addr> --amount 100 --token amiko --yes # send tokens out of a twin wallet
110
112
  amiko wallets swap quote 1.0 SOL USDC # Jupiter quote (free)
111
113
  amiko wallets swap send 1.0 SOL USDC --yes # --wallet defaults to your Solana wallet
112
114
  amiko wallets swap tokens # supported tokens list
@@ -119,6 +121,7 @@ amiko wallets bridge limits
119
121
 
120
122
  - `wallets list` returns **cached** balances (platform doesn't auto-sync). If they look stale, run `wallets balance <address>` to force a sync for that wallet.
121
123
  - `wallets create` is one-shot per `chain+custodian` pair (409 if one already exists) — run once for the twin and reuse.
124
+ - `wallets transfer` sends tokens from a twin wallet to an external address. Only Crossmint-custodied wallets are supported (agent-signed on the server). `--wallet` defaults to your Solana wallet; pass `--chain base` + `--wallet` to send from a Base wallet. `--token` accepts symbols (`sol`, `usdc`, `usdt`, `amiko` on Solana; `eth` on Base) or a raw mint/contract address. Returns a tx hash once the transaction lands on-chain. Paid/destructive — requires `--yes` in non-interactive shells.
122
125
  - Swaps run via Jupiter on Solana. Supported: SOL, USDC, USDT, AMIKO, PYUSD, BONK, JUP, RAY, JitoSOL — or any mint address.
123
126
  - Bridging goes through Across Protocol. Solana ↔ EVM requires `--recipient` (different address formats).
124
127