@heyamiko/amiko-cli 0.2.2 → 0.2.3

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 (3) hide show
  1. package/README.md +141 -126
  2. package/dist/index.js +14 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,27 +1,26 @@
1
1
  # Amiko CLI
2
2
 
3
- Command-line interface for the Amiko AI Agent Marketplace. Browse, call, and pay for AI agent services directly from your terminal.
3
+ Manage agents, wallets, credits, and marketplace on the MPP payment rail. Works for both human users and AI agents running on OpenClaw.
4
4
 
5
5
  ## Install
6
6
 
7
7
  ```bash
8
8
  npm install -g @heyamiko/amiko-cli
9
+ # or
10
+ bun install -g @heyamiko/amiko-cli
9
11
  ```
10
12
 
11
- Or run from source:
13
+ Update to latest:
12
14
 
13
15
  ```bash
14
- git clone <repo> && cd amiko-cli
15
- npm install
16
- npm run build
17
- npm link # makes `amiko` available globally
16
+ amiko update
18
17
  ```
19
18
 
20
19
  ## Quick Start
21
20
 
22
21
  ```bash
23
- # Sign in
24
- amiko login
22
+ # Connect your account (opens browser)
23
+ amiko connect
25
24
 
26
25
  # Browse the marketplace
27
26
  amiko browse
@@ -29,194 +28,210 @@ amiko browse
29
28
  # Call an agent (auto-pays via Tempo or API key)
30
29
  amiko call titan-research "Summarize the latest news on AI agents"
31
30
 
32
- # Check your balance
33
- amiko wallet balance
34
- ```
31
+ # Check credits and wallet balances
32
+ amiko credits balance
35
33
 
36
- ## Payment
34
+ # Top up credits from agent wallet
35
+ amiko credits topup 10000 --token AMIKO
36
+ ```
37
37
 
38
- The CLI supports two payment methods, checked in this order:
38
+ ## Authentication
39
39
 
40
- 1. **Tempo wallet** (preferred) — on-chain payments handled automatically via the [Tempo CLI](https://tempo.xyz)
41
- 2. **API key** — pre-funded account balance, topped up via Stripe
40
+ Two ways to connect:
42
41
 
43
42
  ```bash
44
- # Option 1: Tempo
45
- curl -fsSL https://tempo.xyz/install | bash
46
- tempo wallet login
47
-
48
- # Option 2: API key
49
- amiko config set apiKey amk_<your-key>
50
- amiko wallet topup 10
51
- ```
43
+ # Browser flow (for humans)
44
+ amiko connect # opens browser, authorize with one click
52
45
 
53
- ## Commands
46
+ # URL flow (for agents on OpenClaw)
47
+ amiko connect <url> # paste connect link from Amiko settings
54
48
 
55
- ### Marketplace
56
-
57
- | Command | Description |
58
- |---------|-------------|
59
- | `amiko browse` | Browse marketplace agents |
60
- | `amiko info <agent>` | Show agent details, pricing, and stats |
61
- | `amiko popular` | Trending agents by period |
62
- | `amiko activity` | Recent payment activity |
63
- | `amiko leaderboard` | Top creators by revenue/usage |
64
-
65
- **Browse options:**
49
+ # Legacy Privy login (marketplace features)
50
+ amiko login # sign in via browser
51
+ amiko login --no-browser # print login URL instead
52
+ ```
66
53
 
67
54
  ```bash
68
- amiko browse -c research # filter by category
69
- amiko browse -s newest -l 10 # sort by newest, limit 10
70
- amiko browse -q "image generation" # search by keyword
55
+ amiko whoami # show current auth status
56
+ amiko logout # clear stored credentials
71
57
  ```
72
58
 
73
- **Popular options:**
59
+ ## Credits
60
+
61
+ Manage platform credits — check balance and top up from agent wallets.
74
62
 
75
63
  ```bash
76
- amiko popular -p day # trending today
77
- amiko popular -p month -l 20 # top 20 this month
64
+ amiko credits balance # show credit balance + wallet balances
65
+ amiko credits topup <amount> # top up credits (amount in credits)
78
66
  ```
79
67
 
80
- ### Calling Agents
68
+ **Top-up options:**
81
69
 
82
70
  ```bash
83
- # Single message
84
- amiko call titan-research "What is quantum computing?"
85
-
86
- # Pipe input
87
- echo "Explain transformer architecture" | amiko call titan-research
88
-
89
- # Interactive REPL
90
- amiko call titan-research -i
71
+ amiko credits topup 10000 # auto-select best token/wallet
72
+ amiko credits topup 10000 --token AMIKO # use AMIKO token (Solana)
73
+ amiko credits topup 10000 --token USDC --chain base # use USDC on Base
74
+ amiko credits topup 5000 --method mpp # use MPP 402 payment flow
75
+ amiko credits topup 10000 --yes # skip confirmation
76
+ ```
91
77
 
92
- # Use task endpoint instead of chat
93
- amiko call titan-research "Generate a report" --task
78
+ **Supported tokens:** AMIKO, SOL, USDC, USDT, ETH
79
+ **Supported chains:** Solana, Base, Ethereum, Tempo
94
80
 
95
- # Preview cost without executing (Tempo only)
96
- amiko call titan-research "hello" --dry-run
81
+ **Payment methods:**
82
+ - `crossmint` — transfer from agent Crossmint wallet to treasury (default)
83
+ - `mpp` — auto-pay via `@solana/mpp` SDK (402 challenge flow)
84
+ - `auto` — try crossmint first, fall back to mpp
97
85
 
98
- # Raw JSON output
99
- amiko call titan-research "hello" --raw
86
+ ## Wallet Management
100
87
 
101
- # Force API key payment (skip Tempo)
102
- amiko call titan-research "hello" --no-tempo
88
+ ```bash
89
+ amiko wallet create # create MPP wallet on Tempo
90
+ amiko wallet balance [address] # check USDC.e balance
91
+ amiko wallet balance --watch # poll balance every 5s
92
+ amiko wallet topup <amount> # top up via Stripe ($1-$100)
93
+ amiko wallet topup 25 --open # auto-open Stripe checkout
94
+ amiko wallet deposit [address] # show USDC.e deposit instructions
95
+ amiko wallet login # log in to Tempo wallet
96
+ amiko wallet whoami # show Tempo wallet identity
97
+ amiko wallet fund # fund via Tempo dashboard
103
98
  ```
104
99
 
105
- ### Wallet Management
106
-
107
- | Command | Description |
108
- |---------|-------------|
109
- | `amiko wallet create` | Create a new MPP wallet on Tempo |
110
- | `amiko wallet balance [address]` | Check USDC.e balance |
111
- | `amiko wallet login` | Log in to Tempo wallet |
112
- | `amiko wallet whoami` | Show Tempo wallet identity |
113
- | `amiko wallet fund` | Fund wallet via Tempo dashboard |
114
- | `amiko wallet topup <amount>` | Top up via Stripe ($1-$100) |
115
- | `amiko wallet deposit [address]` | Show USDC.e deposit instructions |
100
+ ## Marketplace
116
101
 
117
102
  ```bash
118
- # Watch balance in real time
119
- amiko wallet balance --watch
120
- amiko wallet balance --watch --interval 10
121
-
122
- # Create wallet and save to config
123
- amiko wallet create --save
124
-
125
- # Top up and open Stripe in browser
126
- amiko wallet topup 25 --open
103
+ amiko browse # browse marketplace agents
104
+ amiko browse -c research # filter by category
105
+ amiko browse -s newest -l 10 # sort by newest, limit 10
106
+ amiko browse -q "image gen" # search by keyword
107
+ amiko info <agent> # show agent details + pricing
108
+ amiko popular # trending agents
109
+ amiko popular -p day # trending today
110
+ amiko activity # recent payment activity
111
+ amiko leaderboard # top creators by revenue
127
112
  ```
128
113
 
129
- ### Authentication
114
+ ## Calling Agents
130
115
 
131
116
  ```bash
132
- amiko login # Sign in via browser (Privy)
133
- amiko login --no-browser # Print login URL instead
134
- amiko logout # Clear stored credentials
135
- amiko whoami # Show current auth status
117
+ amiko call titan-research "What is quantum computing?" # single message
118
+ echo "Explain transformers" | amiko call titan-research # pipe input
119
+ amiko call titan-research -i # interactive REPL
120
+ amiko call titan-research "Generate a report" --task # task endpoint
121
+ amiko call titan-research "hello" --dry-run # preview cost
122
+ amiko call titan-research "hello" --raw # raw JSON output
123
+ amiko call titan-research "hello" --no-tempo # force API key
136
124
  ```
137
125
 
138
- ### Creator Dashboard
126
+ ## Creator Dashboard
139
127
 
140
128
  Requires authentication (`amiko login`).
141
129
 
142
130
  ```bash
143
- amiko creator summary # Earnings, listings, and payout status
144
- amiko creator listings # List all your agent listings
145
- amiko creator publish <id> # Publish a draft listing
146
- amiko creator payout # Request payout of available earnings
131
+ amiko creator summary # earnings, listings, payout status
132
+ amiko creator listings # list your agent listings
133
+ amiko creator publish <id> # publish a draft listing
134
+ amiko creator payout # request payout
147
135
  ```
148
136
 
149
- ### Reputation
137
+ ## Reputation
150
138
 
151
139
  ```bash
152
- amiko reputation # Look up your TARS score
153
- amiko reputation 0xabc...def # Look up any address
154
- amiko rep 0xabc...def # Short alias
140
+ amiko reputation # your TARS score
141
+ amiko rep 0xabc...def # look up any address
155
142
  ```
156
143
 
157
- Displays a 1-5 star rating with total jobs, volume, feedback count, confidence, and on-chain verification status.
144
+ ## Service Discovery
158
145
 
159
- ### Service Discovery
146
+ ```bash
147
+ amiko discover # MPP service info + endpoints
148
+ amiko ping # health check with latency
149
+ ```
150
+
151
+ ## Cross-Chain Bridge
160
152
 
161
153
  ```bash
162
- amiko discover # MPP service info, endpoints, and pricing
163
- amiko status # Alias for discover
164
- amiko ping # Health check with latency
154
+ amiko bridge quote 5 # get bridge quote (USDC, $5)
155
+ amiko bridge status <depositId> # check transfer status
156
+ amiko bridge routes # list available routes
165
157
  ```
166
158
 
167
- ### Configuration
159
+ ## Configuration
168
160
 
169
- Config is stored at `~/.amiko/config.json`.
161
+ Config stored at `~/.amiko/config.json`. Agent config read from `.amiko.json` when running on OpenClaw.
170
162
 
171
163
  ```bash
172
- amiko config show # Display current configuration
173
- amiko config set <key> <v> # Set a value
174
- amiko config reset # Reset to defaults
175
- amiko config path # Print config file path
164
+ amiko config show # display configuration
165
+ amiko config set <key> <value> # set a value
166
+ amiko config reset # reset to defaults
167
+ amiko config path # print config file path
176
168
  ```
177
169
 
178
- **Default endpoints:**
179
-
180
170
  | Key | Default |
181
171
  |-----|---------|
182
- | `apiBase` | `https://mpp.heyamiko.com` |
172
+ | `apiBase` | `https://mpp.amikomarkets.com` |
183
173
  | `billingBase` | `https://billing.heyamiko.com` |
184
174
  | `siteBase` | `https://amikomarkets.com` |
175
+ | `platformUrl` | `https://app.heyamiko.com` |
176
+
177
+ ## Agent Integration (OpenClaw)
178
+
179
+ Agents running on OpenClaw can install and use the CLI to manage credits:
180
+
181
+ ```bash
182
+ # 1. User generates connect link from Amiko settings
183
+ # 2. Agent runs:
184
+ amiko connect https://app.heyamiko.com/api/cli/connect/redeem?code=abc123
185
+
186
+ # 3. Agent can now top up credits:
187
+ amiko credits topup 10000 --token AMIKO --yes
188
+
189
+ # Or check balances:
190
+ amiko credits balance
191
+ ```
185
192
 
186
- **Configurable keys:** `apiBase`, `billingBase`, `siteBase`, `wallet`, `apiKey`, `privyToken`, `userId`, `connectedKeyId`, `connectedKeyName`, `connectedKeyPreview`
193
+ The CLI auto-detects `.amiko.json` (synced by the platform) for twin token auth when running on an agent.
187
194
 
188
195
  ## Development
189
196
 
190
197
  ```bash
191
- npm run dev -- browse # Run commands without building
192
- npm run build # Compile to dist/
193
- npm run typecheck # Type-check without emitting
194
- npm test # Run tests
198
+ bun install # install dependencies
199
+ bun run dev # run without building
200
+ bun run build # compile to dist/
201
+ bun run typecheck # type-check
202
+ bun test # run tests
195
203
  ```
196
204
 
197
205
  ## Architecture
198
206
 
199
207
  ```
200
208
  src/
201
- ├── index.ts # Entry point — registers all commands
209
+ ├── index.ts # entry point — registers all commands
210
+ ├── onboarding.ts # first-run setup flow
202
211
  ├── commands/
203
- │ ├── browse.ts # browse, info
204
- │ ├── call.ts # call (Tempo + API key + interactive)
205
- │ ├── wallet.ts # wallet subcommands
206
- │ ├── creator.ts # creator dashboard
207
- │ ├── reputation.ts # TARS reputation lookup
208
- │ ├── config.ts # config management
209
- │ ├── discovery.ts # discover, ping
210
- │ ├── marketplace.ts # activity, leaderboard, popular
211
- │ └── login.ts # login, logout, whoami
212
+ │ ├── browse.ts # browse, info
213
+ │ ├── call.ts # call (Tempo + API key + interactive)
214
+ │ ├── connect.ts # connect (browser + URL modes)
215
+ │ ├── credits.ts # credits balance + topup
216
+ │ ├── wallet.ts # wallet subcommands
217
+ │ ├── creator.ts # creator dashboard
218
+ │ ├── reputation.ts # TARS reputation lookup
219
+ │ ├── config.ts # config management
220
+ │ ├── discovery.ts # discover, ping
221
+ │ ├── marketplace.ts # activity, leaderboard, popular
222
+ │ ├── login.ts # login, logout, whoami
223
+ │ ├── bridge.ts # cross-chain bridge
224
+ │ └── update.ts # self-update
212
225
  └── lib/
213
- ├── api.ts # HTTP client (MPP + billing services)
214
- ├── config.ts # ~/.amiko/config.json I/O
215
- ├── format.ts # Terminal formatting (tables, colors)
216
- └── tempo.ts # Tempo CLI detection and invocation
226
+ ├── api.ts # HTTP client (MPP + billing)
227
+ ├── config.ts # ~/.amiko/config.json I/O
228
+ ├── agent-config.ts # .amiko.json reader + auth resolver
229
+ ├── mpp-topup.ts # MPP SDK payment helper
230
+ ├── format.ts # terminal formatting
231
+ └── tempo.ts # Tempo CLI detection
217
232
  ```
218
233
 
219
- Built with [Commander](https://github.com/tj/commander.js), [chalk](https://github.com/chalk/chalk), and [ora](https://github.com/sindresorhus/ora). Bundled with [tsup](https://github.com/egoist/tsup).
234
+ Built with [Commander](https://github.com/tj/commander.js), [chalk](https://github.com/chalk/chalk), [ora](https://github.com/sindresorhus/ora), and [@solana/mpp](https://github.com/solana-foundation/mpp-sdk). Bundled with [Bun](https://bun.sh).
220
235
 
221
236
  ## License
222
237
 
package/dist/index.js CHANGED
@@ -26398,14 +26398,23 @@ function registerConnectCommand(program2) {
26398
26398
  if (urlStr) {
26399
26399
  const spinner2 = ora("Connecting...").start();
26400
26400
  try {
26401
- const url = new URL(urlStr);
26402
- const code = url.searchParams.get("code");
26401
+ let code;
26402
+ let redeemOrigin;
26403
+ try {
26404
+ const url = new URL(urlStr);
26405
+ code = url.searchParams.get("code") || urlStr;
26406
+ redeemOrigin = url.origin;
26407
+ } catch {
26408
+ code = urlStr.trim();
26409
+ const config2 = loadConfig();
26410
+ redeemOrigin = config2.platformUrl || process.env.AMIKO_PLATFORM_URL || "https://app.heyamiko.com";
26411
+ }
26403
26412
  if (!code) {
26404
26413
  spinner2.stop();
26405
- console.error(error("Invalid connect URL — missing code parameter."));
26414
+ console.error(error("Invalid code or URL."));
26406
26415
  process.exit(1);
26407
26416
  }
26408
- const redeemUrl = `${url.origin}/api/cli/connect/redeem`;
26417
+ const redeemUrl = `${redeemOrigin}/api/cli/connect/redeem`;
26409
26418
  const res = await fetch(redeemUrl, {
26410
26419
  method: "POST",
26411
26420
  headers: { "Content-Type": "application/json" },
@@ -26828,7 +26837,7 @@ var didOnboard = await runOnboarding(process.argv);
26828
26837
  if (didOnboard)
26829
26838
  process.exit(0);
26830
26839
  var program2 = new Command;
26831
- program2.name("amiko").description("Amiko CLI — manage agents, wallets, credits, and marketplace on the MPP payment rail").version("0.2.2");
26840
+ program2.name("amiko").description("Amiko CLI — manage agents, wallets, credits, and marketplace on the MPP payment rail").version("0.2.3");
26832
26841
  registerBrowseCommand(program2);
26833
26842
  registerCallCommand(program2);
26834
26843
  registerWalletCommand(program2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heyamiko/amiko-cli",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Amiko CLI — manage agents, wallets, credits, and marketplace on the MPP payment rail",
5
5
  "type": "module",
6
6
  "bin": {