@blinkdotnew/cli 0.1.7 → 0.1.8

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/cli.js CHANGED
@@ -1344,7 +1344,7 @@ Agent ID resolution for all agent/secrets commands (priority: high \u2192 low):
1344
1344
  requireToken();
1345
1345
  const result = await withSpinner("Loading agents...", () => appRequest("/api/claw/agents"));
1346
1346
  if (isJsonMode()) return printJson(result);
1347
- const agents = result?.agents ?? result ?? [];
1347
+ const agents = Array.isArray(result) ? result : result?.agents ?? [];
1348
1348
  if (!agents.length) {
1349
1349
  console.log(chalk9.dim("No agents found. Deploy one at blink.new/claw"));
1350
1350
  return;
@@ -1432,7 +1432,7 @@ Examples:
1432
1432
  () => appRequest(`/api/claw/agents/${agentId}/secrets`)
1433
1433
  );
1434
1434
  if (isJsonMode()) return printJson(result);
1435
- const keys = result?.keys ?? result?.secrets?.map((s) => s.key) ?? result ?? [];
1435
+ const keys = result?.secrets?.map((s) => s.key) ?? result?.keys ?? [];
1436
1436
  if (!keys.length) {
1437
1437
  console.log(chalk10.dim("(no secrets set \u2014 use `blink secrets set KEY value`)"));
1438
1438
  return;
@@ -1456,14 +1456,15 @@ After setting, the secret is available as $KEY_NAME in agent shell commands.
1456
1456
  `Setting ${key}...`,
1457
1457
  () => appRequest(`/api/claw/agents/${agentId}/secrets`, {
1458
1458
  method: "POST",
1459
- body: { key: key.toUpperCase(), value }
1459
+ body: { key, value }
1460
1460
  })
1461
1461
  );
1462
+ const normalised = key.toUpperCase();
1462
1463
  if (!isJsonMode()) {
1463
- console.log(chalk10.green("\u2713") + ` ${key.toUpperCase()} saved`);
1464
- console.log(chalk10.dim(" Value hidden. Use $" + key.toUpperCase() + " in shell commands."));
1464
+ console.log(chalk10.green("\u2713") + ` ${normalised} saved`);
1465
+ console.log(chalk10.dim(" Value hidden. Use $" + normalised + " in shell commands."));
1465
1466
  } else {
1466
- printJson({ status: "ok", key: key.toUpperCase(), agent_id: agentId });
1467
+ printJson({ status: "ok", key: normalised, agent_id: agentId });
1467
1468
  }
1468
1469
  });
1469
1470
  secrets.command("delete <key>").description("Delete a secret from the agent vault").option("--agent <id>", "Agent ID (defaults to BLINK_AGENT_ID or BLINK_ACTIVE_AGENT)").option("--yes", "Skip confirmation").addHelpText("after", `
@@ -1484,7 +1485,7 @@ Examples:
1484
1485
  }
1485
1486
  await withSpinner(
1486
1487
  `Deleting ${key}...`,
1487
- () => appRequest(`/api/claw/agents/${agentId}/secrets/${key}`, { method: "DELETE" })
1488
+ () => appRequest(`/api/claw/agents/${agentId}/secrets?key=${encodeURIComponent(key)}`, { method: "DELETE" })
1488
1489
  );
1489
1490
  if (!isJsonMode()) console.log("Deleted: " + key);
1490
1491
  else printJson({ status: "ok", key, agent_id: agentId });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blinkdotnew/cli",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Blink platform CLI — deploy apps, manage databases, generate AI content",
5
5
  "bin": {
6
6
  "blink": "dist/cli.js"
@@ -28,7 +28,7 @@ Agent ID resolution for all agent/secrets commands (priority: high → low):
28
28
  const result = await withSpinner('Loading agents...', () => appRequest('/api/claw/agents'))
29
29
  if (isJsonMode()) return printJson(result)
30
30
  const agents: Array<{ id: string; name: string; status: string; model?: string; machine_size?: string }> =
31
- result?.agents ?? result ?? []
31
+ Array.isArray(result) ? result : result?.agents ?? []
32
32
  if (!agents.length) {
33
33
  console.log(chalk.dim('No agents found. Deploy one at blink.new/claw'))
34
34
  return
@@ -44,7 +44,7 @@ Examples:
44
44
  appRequest(`/api/claw/agents/${agentId}/secrets`)
45
45
  )
46
46
  if (isJsonMode()) return printJson(result)
47
- const keys: string[] = result?.keys ?? result?.secrets?.map((s: { key: string }) => s.key) ?? result ?? []
47
+ const keys: string[] = result?.secrets?.map((s: { key: string }) => s.key) ?? result?.keys ?? []
48
48
  if (!keys.length) {
49
49
  console.log(chalk.dim('(no secrets set — use `blink secrets set KEY value`)'))
50
50
  return
@@ -71,14 +71,15 @@ After setting, the secret is available as $KEY_NAME in agent shell commands.
71
71
  await withSpinner(`Setting ${key}...`, () =>
72
72
  appRequest(`/api/claw/agents/${agentId}/secrets`, {
73
73
  method: 'POST',
74
- body: { key: key.toUpperCase(), value },
74
+ body: { key, value },
75
75
  })
76
76
  )
77
+ const normalised = key.toUpperCase()
77
78
  if (!isJsonMode()) {
78
- console.log(chalk.green('✓') + ` ${key.toUpperCase()} saved`)
79
- console.log(chalk.dim(' Value hidden. Use $' + key.toUpperCase() + ' in shell commands.'))
79
+ console.log(chalk.green('✓') + ` ${normalised} saved`)
80
+ console.log(chalk.dim(' Value hidden. Use $' + normalised + ' in shell commands.'))
80
81
  } else {
81
- printJson({ status: 'ok', key: key.toUpperCase(), agent_id: agentId })
82
+ printJson({ status: 'ok', key: normalised, agent_id: agentId })
82
83
  }
83
84
  })
84
85
 
@@ -101,7 +102,7 @@ Examples:
101
102
  if (!ok) { console.log('Cancelled.'); return }
102
103
  }
103
104
  await withSpinner(`Deleting ${key}...`, () =>
104
- appRequest(`/api/claw/agents/${agentId}/secrets/${key}`, { method: 'DELETE' })
105
+ appRequest(`/api/claw/agents/${agentId}/secrets?key=${encodeURIComponent(key)}`, { method: 'DELETE' })
105
106
  )
106
107
  if (!isJsonMode()) console.log('Deleted: ' + key)
107
108
  else printJson({ status: 'ok', key, agent_id: agentId })