@heyamiko/amiko-cli 0.6.4 → 0.6.6
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 +52 -6
- package/dist/index.js +63 -77
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# amiko-cli (v0.6.6)
|
|
2
2
|
|
|
3
3
|
Manage agents, wallets, credits, and the MPP marketplace from your terminal. Works for both human users and AI agents running on OpenClaw.
|
|
4
4
|
|
|
@@ -147,6 +147,27 @@ amiko bridge routes # available bridge routes
|
|
|
147
147
|
amiko bridge limits # min/max limits per route
|
|
148
148
|
```
|
|
149
149
|
|
|
150
|
+
## Audio & Voice
|
|
151
|
+
|
|
152
|
+
All audio endpoints return binary audio streams. Use `amiko service call` for direct access:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# Sound effects ($0.05)
|
|
156
|
+
amiko service call POST /v1/sfx '{"text":"Thunder with heavy rain","duration_seconds":5}'
|
|
157
|
+
|
|
158
|
+
# Music generation ($0.10)
|
|
159
|
+
amiko service call POST /v1/music '{"prompt":"Lo-fi chill beat","music_length_ms":30000}'
|
|
160
|
+
|
|
161
|
+
# Composition plan ($0.02) — get JSON plan before generating
|
|
162
|
+
amiko service call POST /v1/music/plan '{"prompt":"Epic orchestral piece"}'
|
|
163
|
+
|
|
164
|
+
# Text-to-speech ($0.50/1K chars)
|
|
165
|
+
amiko service call POST /v1/tts/21m00Tcm4TlvDq8ikWAM '{"text":"Hello world"}'
|
|
166
|
+
|
|
167
|
+
# List all available services + prices
|
|
168
|
+
amiko service list
|
|
169
|
+
```
|
|
170
|
+
|
|
150
171
|
## Other Commands
|
|
151
172
|
|
|
152
173
|
```bash
|
|
@@ -158,24 +179,49 @@ amiko config set <key> <value> # set config value
|
|
|
158
179
|
amiko update # update CLI to latest
|
|
159
180
|
```
|
|
160
181
|
|
|
182
|
+
## X Search
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
amiko search "AI agents" # search X (pays 1 AMIKO from Solana wallet)
|
|
186
|
+
amiko search "bitcoin" --token USDC # pay with USDC instead
|
|
187
|
+
amiko search "news" --raw # raw JSON output
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Pays via Crossmint server-signed transfer from the agent's wallet. Tries Solana wallet first, falls back to EVM (Base/Tempo).
|
|
191
|
+
|
|
192
|
+
## Image Generation
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
amiko image "a sunset over mountains" # gpt-image-1 (default, base64)
|
|
196
|
+
amiko image "logo" --background transparent # transparent background
|
|
197
|
+
amiko image "cat" --model dall-e-3 # DALL-E 3 (returns URL)
|
|
198
|
+
amiko image "portrait" --size 1024x1792 --quality high # portrait, high quality
|
|
199
|
+
amiko image "icon" --format webp # webp output
|
|
200
|
+
amiko image "banner" --raw # raw JSON (for piping)
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Costs 5 AMIKO per image. Default model is `gpt-image-1` which returns base64 data (permanent, no expiring URLs).
|
|
204
|
+
|
|
161
205
|
## Agent Integration (OpenClaw)
|
|
162
206
|
|
|
163
|
-
Agents
|
|
207
|
+
Agents auto-authenticate via `.amiko.json` — no manual connect needed. The platform writes this file during twin init with wallets, billing config, and twin token.
|
|
164
208
|
|
|
165
209
|
```bash
|
|
166
|
-
|
|
167
|
-
amiko connect <CODE>
|
|
210
|
+
# Agent environment — just works
|
|
168
211
|
amiko credits balance
|
|
212
|
+
amiko search "trending topics"
|
|
169
213
|
amiko credits topup 10000 --token AMIKO --yes
|
|
170
214
|
```
|
|
171
215
|
|
|
172
|
-
The CLI
|
|
216
|
+
The CLI checks for `.amiko.json` in order:
|
|
173
217
|
1. `$OPENCLAW_WORKSPACE_DIR/.amiko.json`
|
|
174
218
|
2. `$OPENCLAW_HOME/.openclaw/workspace/.amiko.json`
|
|
175
219
|
3. `/data/.openclaw/workspace/.amiko.json`
|
|
176
220
|
4. Walking up from `cwd`
|
|
177
221
|
|
|
178
|
-
|
|
222
|
+
The `.amiko.json` provides: `AMIKO_TWIN_TOKEN` (auth), `agentWallets` (Solana + Base addresses), `billingBase`, and optionally `platformKey`.
|
|
223
|
+
|
|
224
|
+
**Important:** If `~/.amiko/config.json` exists with a stale `apiKey`, it takes priority over `.amiko.json` twin token. Remove stale keys or let the platform manage auth.
|
|
179
225
|
|
|
180
226
|
## Configuration
|
|
181
227
|
|
package/dist/index.js
CHANGED
|
@@ -71871,6 +71871,25 @@ function tryLoadConfig(filePath) {
|
|
|
71871
71871
|
}
|
|
71872
71872
|
}
|
|
71873
71873
|
function resolveAuth(cliConfig) {
|
|
71874
|
+
const agentConfig = loadAgentConfig();
|
|
71875
|
+
if (agentConfig?.agentWallets?.length && !cliConfig.agentWallets?.length) {
|
|
71876
|
+
cliConfig.agentWallets = agentConfig.agentWallets;
|
|
71877
|
+
}
|
|
71878
|
+
if (agentConfig?.billingBase && !cliConfig.billingBase) {
|
|
71879
|
+
cliConfig.billingBase = agentConfig.billingBase;
|
|
71880
|
+
}
|
|
71881
|
+
if (agentConfig?.twinToken && !cliConfig.twinToken) {
|
|
71882
|
+
cliConfig.twinToken = agentConfig.twinToken;
|
|
71883
|
+
}
|
|
71884
|
+
if (agentConfig?.twinId && !cliConfig.twinId) {
|
|
71885
|
+
cliConfig.twinId = agentConfig.twinId;
|
|
71886
|
+
}
|
|
71887
|
+
if (agentConfig?.userId && !cliConfig.userId) {
|
|
71888
|
+
cliConfig.userId = agentConfig.userId;
|
|
71889
|
+
}
|
|
71890
|
+
if (agentConfig?.platformKey && !cliConfig.apiKey) {
|
|
71891
|
+
cliConfig.apiKey = agentConfig.platformKey;
|
|
71892
|
+
}
|
|
71874
71893
|
if (cliConfig.agentWallets?.length) {
|
|
71875
71894
|
return {
|
|
71876
71895
|
mode: "connected",
|
|
@@ -71916,7 +71935,6 @@ function resolveAuth(cliConfig) {
|
|
|
71916
71935
|
platformUrl: process.env.AMIKO_PLATFORM_URL
|
|
71917
71936
|
};
|
|
71918
71937
|
}
|
|
71919
|
-
const agentConfig = loadAgentConfig();
|
|
71920
71938
|
if (agentConfig?.twinToken) {
|
|
71921
71939
|
return {
|
|
71922
71940
|
mode: "agent",
|
|
@@ -72981,25 +72999,6 @@ async function get(path) {
|
|
|
72981
72999
|
}
|
|
72982
73000
|
return res.json();
|
|
72983
73001
|
}
|
|
72984
|
-
async function post(path, body) {
|
|
72985
|
-
const res = await fetch(`${mppBase()}${path}`, {
|
|
72986
|
-
method: "POST",
|
|
72987
|
-
headers: authHeaders(),
|
|
72988
|
-
body: body ? JSON.stringify(body) : undefined
|
|
72989
|
-
});
|
|
72990
|
-
if (res.status === 402) {
|
|
72991
|
-
const data = await res.json();
|
|
72992
|
-
const err = new Error("Payment required");
|
|
72993
|
-
err.status = 402;
|
|
72994
|
-
err.data = data;
|
|
72995
|
-
throw err;
|
|
72996
|
-
}
|
|
72997
|
-
if (!res.ok) {
|
|
72998
|
-
const text = await res.text().catch(() => "");
|
|
72999
|
-
throw new Error(`${res.status} ${res.statusText}: ${text}`);
|
|
73000
|
-
}
|
|
73001
|
-
return res.json();
|
|
73002
|
-
}
|
|
73003
73002
|
async function creatorPost(path, body) {
|
|
73004
73003
|
const res = await fetch(`${billingBase()}${path}`, {
|
|
73005
73004
|
method: "POST",
|
|
@@ -73531,7 +73530,7 @@ function sanitizeTempoWhoamiOutput(output) {
|
|
|
73531
73530
|
function buildConnectedKeyTopupInput(config, amount) {
|
|
73532
73531
|
const token = getPrivyToken(config);
|
|
73533
73532
|
if (!token) {
|
|
73534
|
-
throw new Error(
|
|
73533
|
+
throw new Error("Not signed in. Check .amiko.json credentials.");
|
|
73535
73534
|
}
|
|
73536
73535
|
if (!config.connectedKeyId) {
|
|
73537
73536
|
throw new Error("No connected API key is attached to this account. Sign in again after creating a server-side key.");
|
|
@@ -73557,32 +73556,6 @@ function openUrl(url) {
|
|
|
73557
73556
|
}
|
|
73558
73557
|
function registerWalletCommand(program2) {
|
|
73559
73558
|
const cmd = program2.command("wallet").description("Manage MPP wallets");
|
|
73560
|
-
cmd.command("create").description("Create a new MPP wallet on Tempo").option("--save", "Save the wallet address to CLI config").action(async (opts) => {
|
|
73561
|
-
const spinner = ora("Creating wallet...").start();
|
|
73562
|
-
try {
|
|
73563
|
-
const data = await post("/v1/wallet/create");
|
|
73564
|
-
spinner.stop();
|
|
73565
|
-
console.log(success("Wallet created"));
|
|
73566
|
-
console.log("");
|
|
73567
|
-
console.log(label("Address", source_default.cyan(data.address)));
|
|
73568
|
-
console.log(label("Wallet ID", data.walletId));
|
|
73569
|
-
if (data.chain)
|
|
73570
|
-
console.log(label("Chain", data.chain));
|
|
73571
|
-
console.log("");
|
|
73572
|
-
console.log(dim("Fund it with USDC.e on Tempo to start using paid services."));
|
|
73573
|
-
if (opts.save) {
|
|
73574
|
-
saveConfig({ wallet: data.address });
|
|
73575
|
-
console.log(success("Saved to CLI config"));
|
|
73576
|
-
} else {
|
|
73577
|
-
console.log(dim(`
|
|
73578
|
-
Tip: amiko config set wallet ${data.address}`));
|
|
73579
|
-
}
|
|
73580
|
-
} catch (err) {
|
|
73581
|
-
spinner.stop();
|
|
73582
|
-
console.error(error(err instanceof Error ? err.message : "Failed to create wallet"));
|
|
73583
|
-
process.exit(1);
|
|
73584
|
-
}
|
|
73585
|
-
});
|
|
73586
73559
|
cmd.command("balance").description("Check wallet balance").argument("[address]", "Wallet address (uses configured wallet if omitted)").option("-w, --watch", "Poll balance every 5 seconds").option("--interval <seconds>", "Poll interval in seconds (with --watch)", "5").action(async (address, opts) => {
|
|
73587
73560
|
const addr = address || loadConfig().wallet;
|
|
73588
73561
|
if (!addr) {
|
|
@@ -73721,12 +73694,12 @@ Tip: add --open to auto-launch in browser.`));
|
|
|
73721
73694
|
}
|
|
73722
73695
|
const agentWallet = config.agentWallets?.find((w5) => w5.address === fromAddr);
|
|
73723
73696
|
if (!agentWallet?.signerSecret) {
|
|
73724
|
-
console.error(error(
|
|
73697
|
+
console.error(error("No signer secret for this wallet. Re-init from the Amiko dashboard to provision wallet keys."));
|
|
73725
73698
|
process.exit(1);
|
|
73726
73699
|
}
|
|
73727
73700
|
const apiKey = process.env.CROSSMINT_API_KEY || config.apiKey;
|
|
73728
73701
|
if (!apiKey) {
|
|
73729
|
-
console.error(error(
|
|
73702
|
+
console.error(error("No API key. Check platformKey in .amiko.json or set CROSSMINT_API_KEY."));
|
|
73730
73703
|
process.exit(1);
|
|
73731
73704
|
}
|
|
73732
73705
|
const spinner = ora(`Sending ${amount} ${token} to ${truncAddr(to)}...`).start();
|
|
@@ -73782,7 +73755,7 @@ function requireCreatorToken() {
|
|
|
73782
73755
|
const token = getPrivyToken(config);
|
|
73783
73756
|
if (!token) {
|
|
73784
73757
|
console.error(error("Not signed in."));
|
|
73785
|
-
console.log(dim("
|
|
73758
|
+
console.log(dim("Check .amiko.json credentials."));
|
|
73786
73759
|
process.exit(1);
|
|
73787
73760
|
}
|
|
73788
73761
|
return token;
|
|
@@ -75256,7 +75229,7 @@ function registerCreditsCommand(program2) {
|
|
|
75256
75229
|
const auth = resolveAuth(loadConfig());
|
|
75257
75230
|
if (auth.mode === "none") {
|
|
75258
75231
|
spinner.stop();
|
|
75259
|
-
console.error(error("Not
|
|
75232
|
+
console.error(error("Not authenticated. Check .amiko.json credentials."));
|
|
75260
75233
|
process.exit(1);
|
|
75261
75234
|
}
|
|
75262
75235
|
spinner.stop();
|
|
@@ -75365,19 +75338,19 @@ function registerCreditsCommand(program2) {
|
|
|
75365
75338
|
const auth = resolveAuth(loadConfig());
|
|
75366
75339
|
if (auth.mode === "none") {
|
|
75367
75340
|
spinner.stop();
|
|
75368
|
-
console.error(error("Not
|
|
75341
|
+
console.error(error("Not authenticated. Check .amiko.json credentials."));
|
|
75369
75342
|
process.exit(1);
|
|
75370
75343
|
}
|
|
75371
75344
|
const billingBase2 = auth.billingBase || "https://billing.heyamiko.com";
|
|
75372
75345
|
if (!billingBase2) {
|
|
75373
75346
|
spinner.stop();
|
|
75374
|
-
console.error(error("Billing service not configured.
|
|
75347
|
+
console.error(error("Billing service not configured. Check billingBase in .amiko.json."));
|
|
75375
75348
|
process.exit(1);
|
|
75376
75349
|
}
|
|
75377
75350
|
const authToken = auth.platformKey || auth.twinToken || auth.privyToken;
|
|
75378
75351
|
if (!authToken) {
|
|
75379
75352
|
spinner.stop();
|
|
75380
|
-
console.error(error("No API key or auth token.
|
|
75353
|
+
console.error(error("No API key or auth token. Check platformKey in .amiko.json."));
|
|
75381
75354
|
process.exit(1);
|
|
75382
75355
|
}
|
|
75383
75356
|
const authHeaders2 = {
|
|
@@ -75661,7 +75634,7 @@ function registerSwapCommand(program2) {
|
|
|
75661
75634
|
const config2 = loadConfig();
|
|
75662
75635
|
const auth = resolveAuth(config2);
|
|
75663
75636
|
if (auth.mode === "none") {
|
|
75664
|
-
console.error(error("Not
|
|
75637
|
+
console.error(error("Not authenticated. Check .amiko.json credentials."));
|
|
75665
75638
|
process.exit(1);
|
|
75666
75639
|
}
|
|
75667
75640
|
const allWallets = auth.agentWallets || config2.agentWallets || [];
|
|
@@ -75833,7 +75806,7 @@ function registerUpdateCommand(program2) {
|
|
|
75833
75806
|
// src/commands/search.ts
|
|
75834
75807
|
var TREASURY = "FPiZAf3jEnNfCwfvbv46jdPfHbmSepD4Q6iHiLJDQXvb";
|
|
75835
75808
|
function registerSearchCommand(program2) {
|
|
75836
|
-
program2.command("search <query>").description("X Search — pays 1 AMIKO token per search").option("--raw", "Output raw JSON").action(async (query, opts) => {
|
|
75809
|
+
program2.command("search <query>").description("X Search — pays 1 AMIKO token per search").option("--raw", "Output raw JSON").option("--token <token>", "Payment token (AMIKO, USDC, SOL)", "AMIKO").action(async (query, opts) => {
|
|
75837
75810
|
const spinner = ora("X Search...").start();
|
|
75838
75811
|
try {
|
|
75839
75812
|
const config2 = loadConfig();
|
|
@@ -75843,18 +75816,25 @@ function registerSearchCommand(program2) {
|
|
|
75843
75816
|
const billingToken = auth.platformKey || auth.twinToken || auth.privyToken;
|
|
75844
75817
|
if (auth.mode === "none" || !billingToken) {
|
|
75845
75818
|
spinner.stop();
|
|
75846
|
-
console.error(error("Not
|
|
75819
|
+
console.error(error("Not authenticated. Check .amiko.json has valid credentials."));
|
|
75847
75820
|
process.exit(1);
|
|
75848
75821
|
}
|
|
75849
75822
|
const allWallets = auth.agentWallets || config2.agentWallets || [];
|
|
75850
75823
|
const solanaWallet = allWallets.find((w5) => w5.chain === "solana")?.address;
|
|
75851
|
-
|
|
75824
|
+
const evmWallet = allWallets.find((w5) => w5.chain === "base" || w5.chain === "evm" || w5.chain === "tempo")?.address;
|
|
75825
|
+
if (!solanaWallet && !evmWallet) {
|
|
75852
75826
|
spinner.stop();
|
|
75853
|
-
console.error(error("No
|
|
75827
|
+
console.error(error("No wallet found. Your twin needs a Solana or EVM wallet."));
|
|
75828
|
+
console.log(dim(" Re-init your twin from the Amiko dashboard to provision wallets."));
|
|
75854
75829
|
process.exit(1);
|
|
75855
75830
|
}
|
|
75856
|
-
|
|
75857
|
-
const
|
|
75831
|
+
const payWithSolana = !!solanaWallet;
|
|
75832
|
+
const wallet = payWithSolana ? solanaWallet : evmWallet;
|
|
75833
|
+
const chain = payWithSolana ? "solana" : "base";
|
|
75834
|
+
const token = payWithSolana ? opts.token || "AMIKO" : "USDC";
|
|
75835
|
+
const amount2 = token === "AMIKO" ? "1" : "0.01";
|
|
75836
|
+
spinner.text = `Paying ${amount2} ${token} (${chain})...`;
|
|
75837
|
+
const transferRes = await fetch(`${billingBase2}/api/crossmint/wallets/${encodeURIComponent(wallet)}/transfer`, {
|
|
75858
75838
|
method: "POST",
|
|
75859
75839
|
headers: {
|
|
75860
75840
|
"Content-Type": "application/json",
|
|
@@ -75862,15 +75842,15 @@ function registerSearchCommand(program2) {
|
|
|
75862
75842
|
},
|
|
75863
75843
|
body: JSON.stringify({
|
|
75864
75844
|
to: TREASURY,
|
|
75865
|
-
amount:
|
|
75866
|
-
token
|
|
75867
|
-
chain
|
|
75845
|
+
amount: amount2,
|
|
75846
|
+
token,
|
|
75847
|
+
chain
|
|
75868
75848
|
})
|
|
75869
75849
|
});
|
|
75870
75850
|
if (!transferRes.ok) {
|
|
75871
75851
|
spinner.stop();
|
|
75872
75852
|
const err = await transferRes.json().catch(() => ({ error: "Transfer failed" }));
|
|
75873
|
-
console.error(error(err.error ||
|
|
75853
|
+
console.error(error(err.error || `${token} payment failed: ${transferRes.status}`));
|
|
75874
75854
|
process.exit(1);
|
|
75875
75855
|
}
|
|
75876
75856
|
const transferData = await transferRes.json();
|
|
@@ -75880,21 +75860,22 @@ function registerSearchCommand(program2) {
|
|
|
75880
75860
|
console.error(error("Payment sent but no tx hash returned."));
|
|
75881
75861
|
process.exit(1);
|
|
75882
75862
|
}
|
|
75883
|
-
spinner.text = `Paid
|
|
75863
|
+
spinner.text = `Paid ${amount2} ${token} — searching X...`;
|
|
75884
75864
|
const params = new URLSearchParams({ q: query });
|
|
75885
75865
|
const res = await fetch(`${mppBase2}/v1/x/search?${params}`, {
|
|
75886
75866
|
headers: {
|
|
75887
75867
|
"Content-Type": "application/json",
|
|
75888
75868
|
"X-Payment-Tx": txHash,
|
|
75889
|
-
"X-Payment-Amount":
|
|
75890
|
-
"X-Payment-Token":
|
|
75869
|
+
"X-Payment-Amount": amount2,
|
|
75870
|
+
"X-Payment-Token": token
|
|
75891
75871
|
}
|
|
75892
75872
|
});
|
|
75893
75873
|
spinner.stop();
|
|
75894
75874
|
if (!res.ok) {
|
|
75895
75875
|
const text = await res.text().catch(() => "");
|
|
75896
75876
|
console.error(error(`Search failed: ${res.status} ${text.slice(0, 200)}`));
|
|
75897
|
-
|
|
75877
|
+
const explorer = chain === "solana" ? `https://solscan.io/tx/${txHash}` : `https://explorer.tempo.xyz/tx/${txHash}`;
|
|
75878
|
+
console.log(dim(`Payment tx: ${explorer}`));
|
|
75898
75879
|
process.exit(1);
|
|
75899
75880
|
}
|
|
75900
75881
|
const data = await res.json();
|
|
@@ -75920,7 +75901,7 @@ function registerSearchCommand(program2) {
|
|
|
75920
75901
|
console.log("");
|
|
75921
75902
|
}
|
|
75922
75903
|
}
|
|
75923
|
-
console.log(success(
|
|
75904
|
+
console.log(success(`Paid ${amount2} ${token}`) + dim(` tx: ${txHash.slice(0, 16)}...`));
|
|
75924
75905
|
} catch (err) {
|
|
75925
75906
|
spinner.stop();
|
|
75926
75907
|
console.error(error(err instanceof Error ? err.message : "Search failed"));
|
|
@@ -75932,7 +75913,7 @@ function registerSearchCommand(program2) {
|
|
|
75932
75913
|
// src/commands/image.ts
|
|
75933
75914
|
var TREASURY2 = "FPiZAf3jEnNfCwfvbv46jdPfHbmSepD4Q6iHiLJDQXvb";
|
|
75934
75915
|
function registerImageCommand(program2) {
|
|
75935
|
-
program2.command("image <prompt>").alias("img").description("Generate an image
|
|
75916
|
+
program2.command("image <prompt>").alias("img").description("Generate an image — costs 5 AMIKO").option("--size <size>", "Image size: 1024x1024, 1024x1792, 1792x1024", "1024x1024").option("--quality <q>", "Quality: auto, low, medium, high (gpt-image-1) or standard, hd (dall-e-3)", "auto").option("--model <model>", "Model: gpt-image-1 or dall-e-3", "gpt-image-1").option("--background <bg>", "Background: transparent, opaque, auto (gpt-image-1 only)").option("--format <fmt>", "Output: png, webp, jpeg (gpt-image-1 only)", "png").option("--raw", "Output raw JSON").action(async (prompt2, opts) => {
|
|
75936
75917
|
const spinner = ora("Generating image...").start();
|
|
75937
75918
|
try {
|
|
75938
75919
|
const config2 = loadConfig();
|
|
@@ -75942,7 +75923,7 @@ function registerImageCommand(program2) {
|
|
|
75942
75923
|
const billingToken = auth.platformKey || auth.twinToken || auth.privyToken;
|
|
75943
75924
|
if (!billingToken) {
|
|
75944
75925
|
spinner.stop();
|
|
75945
|
-
console.error(error("Not
|
|
75926
|
+
console.error(error("Not authenticated. Check .amiko.json credentials."));
|
|
75946
75927
|
process.exit(1);
|
|
75947
75928
|
}
|
|
75948
75929
|
const allWallets = auth.agentWallets || config2.agentWallets || [];
|
|
@@ -75990,7 +75971,9 @@ function registerImageCommand(program2) {
|
|
|
75990
75971
|
prompt: prompt2,
|
|
75991
75972
|
size: opts.size,
|
|
75992
75973
|
quality: opts.quality,
|
|
75993
|
-
model: opts.model
|
|
75974
|
+
model: opts.model,
|
|
75975
|
+
...opts.background && { background: opts.background },
|
|
75976
|
+
...opts.model === "gpt-image-1" && { output_format: opts.format || "png" }
|
|
75994
75977
|
})
|
|
75995
75978
|
});
|
|
75996
75979
|
spinner.stop();
|
|
@@ -76013,9 +75996,12 @@ function registerImageCommand(program2) {
|
|
|
76013
75996
|
console.log("");
|
|
76014
75997
|
const images = data.images || data.data || [];
|
|
76015
75998
|
for (const img of images) {
|
|
76016
|
-
|
|
76017
|
-
|
|
76018
|
-
|
|
75999
|
+
if (img.url) {
|
|
76000
|
+
console.log(label("URL", img.url));
|
|
76001
|
+
} else if (img.b64_json) {
|
|
76002
|
+
console.log(label("Format", "base64 (inline image data)"));
|
|
76003
|
+
console.log(dim(` ${img.b64_json.length.toLocaleString()} chars — save with: amiko image "..." --raw | jq -r '.images[0].b64_json' | base64 -d > image.png`));
|
|
76004
|
+
}
|
|
76019
76005
|
if (img.revised_prompt && img.revised_prompt !== prompt2) {
|
|
76020
76006
|
console.log(label("Revised", dim(img.revised_prompt)));
|
|
76021
76007
|
}
|
|
@@ -76062,7 +76048,7 @@ function registerAmazonCommand(program2) {
|
|
|
76062
76048
|
const billingToken = auth.platformKey || auth.twinToken || auth.privyToken;
|
|
76063
76049
|
if (!billingToken) {
|
|
76064
76050
|
spinner.stop();
|
|
76065
|
-
console.error(error("Not
|
|
76051
|
+
console.error(error("Not authenticated. Check .amiko.json credentials."));
|
|
76066
76052
|
process.exit(1);
|
|
76067
76053
|
}
|
|
76068
76054
|
const allWallets = auth.agentWallets || config2.agentWallets || [];
|