@blinkdotnew/cli 0.1.8 → 0.2.0
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 +58 -9
- package/dist/cli.js +4 -2
- package/package.json +1 -1
- package/src/commands/project.ts +2 -1
- package/src/commands/secrets.ts +2 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @blinkdotnew/cli
|
|
2
2
|
|
|
3
|
-
The Blink platform CLI. Deploy apps, query databases, generate AI content, manage storage — all from your terminal or agent scripts.
|
|
3
|
+
The Blink platform CLI. Deploy apps, query databases, generate AI content, manage storage, and control Blink Claw agents — all from your terminal or agent scripts.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npm install -g @blinkdotnew/cli
|
|
@@ -15,20 +15,27 @@ blink --help
|
|
|
15
15
|
# Install
|
|
16
16
|
npm install -g @blinkdotnew/cli
|
|
17
17
|
|
|
18
|
-
# Authenticate (enter your blnk_ak_... API key)
|
|
18
|
+
# Authenticate (enter your blnk_ak_... API key from blink.new → Settings → API Keys)
|
|
19
19
|
blink login --interactive
|
|
20
20
|
|
|
21
|
-
#
|
|
22
|
-
blink
|
|
21
|
+
# See full context: agent + project + auth
|
|
22
|
+
blink status
|
|
23
23
|
|
|
24
|
-
#
|
|
25
|
-
blink
|
|
24
|
+
# Manage Claw agents
|
|
25
|
+
blink agent list
|
|
26
|
+
eval $(blink agent use clw_xxx --export)
|
|
27
|
+
blink secrets set GITHUB_TOKEN ghp_xxx
|
|
28
|
+
blink secrets list
|
|
29
|
+
|
|
30
|
+
# Deploy an app
|
|
31
|
+
npm run build && blink deploy ./dist --prod
|
|
26
32
|
|
|
27
33
|
# Query your database
|
|
28
34
|
blink db query "SELECT count(*) FROM users"
|
|
29
35
|
|
|
30
|
-
# Generate
|
|
36
|
+
# Generate AI content
|
|
31
37
|
blink ai image "a glowing blink logo on dark background"
|
|
38
|
+
blink ai text "Summarize this article: ..."
|
|
32
39
|
```
|
|
33
40
|
|
|
34
41
|
---
|
|
@@ -338,8 +345,8 @@ blink storage upload ./banner.png --json | jq -r '.url'
|
|
|
338
345
|
The CLI is **pre-installed** in every Blink Claw agent (Fly.io Firecracker VM). These env vars are already injected — no login needed:
|
|
339
346
|
|
|
340
347
|
```
|
|
341
|
-
BLINK_API_KEY auth token
|
|
342
|
-
BLINK_AGENT_ID
|
|
348
|
+
BLINK_API_KEY auth token (workspace-scoped)
|
|
349
|
+
BLINK_AGENT_ID this agent's ID — auto-used by blink agent/secrets commands
|
|
343
350
|
BLINK_APIS_URL https://core.blink.new
|
|
344
351
|
BLINK_APP_URL https://blink.new
|
|
345
352
|
```
|
|
@@ -351,6 +358,48 @@ Agents use the CLI directly in skill scripts:
|
|
|
351
358
|
blink ai image "$PROMPT" --model "$MODEL" --json
|
|
352
359
|
```
|
|
353
360
|
|
|
361
|
+
### `blink agent` — Manage agents
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
blink agent list # List all agents in workspace
|
|
365
|
+
blink agent use clw_xxx # Show how to set active agent
|
|
366
|
+
eval $(blink agent use clw_xxx --export) # Set active agent for this session
|
|
367
|
+
blink agent status # Show current agent details
|
|
368
|
+
blink agent status clw_xxx # Show specific agent details
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
On Claw machines, `BLINK_AGENT_ID` is already set — `blink agent status` works with zero config.
|
|
372
|
+
|
|
373
|
+
### `blink secrets` — Agent encrypted vault
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
# All commands auto-use BLINK_AGENT_ID on Claw machines
|
|
377
|
+
blink secrets list # List secret key names (values never shown)
|
|
378
|
+
blink secrets set GITHUB_TOKEN ghp_xxx # Add or update a secret
|
|
379
|
+
blink secrets delete OLD_KEY # Remove a secret (--yes to skip prompt)
|
|
380
|
+
|
|
381
|
+
# Cross-agent management (agent manager pattern)
|
|
382
|
+
blink secrets list --agent clw_other # Another agent's keys
|
|
383
|
+
blink secrets set --agent clw_other OPENAI_KEY sk-xxx # Set on another agent
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
Secrets are stored encrypted and available as `$KEY_NAME` in all agent shell commands.
|
|
387
|
+
|
|
388
|
+
Agent ID resolution for `blink agent` and `blink secrets`:
|
|
389
|
+
1. `--agent <id>` flag
|
|
390
|
+
2. `BLINK_AGENT_ID` env var ← always set on Claw Fly machines
|
|
391
|
+
3. `BLINK_ACTIVE_AGENT` env var ← from `eval $(blink agent use clw_xxx --export)`
|
|
392
|
+
|
|
393
|
+
### `blink status` — Full context at a glance
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
$ BLINK_AGENT_ID=clw_xxx blink status
|
|
397
|
+
|
|
398
|
+
Agent clw_xxx (BLINK_AGENT_ID env)
|
|
399
|
+
Project proj_yyy (.blink/project.json)
|
|
400
|
+
Auth ~/.config/blink/config.toml
|
|
401
|
+
```
|
|
402
|
+
|
|
354
403
|
---
|
|
355
404
|
|
|
356
405
|
## Links
|
package/dist/cli.js
CHANGED
|
@@ -1203,7 +1203,8 @@ After creating a project, link it to your current directory:
|
|
|
1203
1203
|
});
|
|
1204
1204
|
project.command("delete <project_id>").description("Delete a project").option("--yes", "Skip confirmation").action(async (projectId, opts) => {
|
|
1205
1205
|
requireToken();
|
|
1206
|
-
|
|
1206
|
+
const skipConfirm = opts.yes || process.argv.includes("--yes") || process.argv.includes("-y");
|
|
1207
|
+
if (!skipConfirm && process.stdout.isTTY) {
|
|
1207
1208
|
const { confirm } = await import("@clack/prompts");
|
|
1208
1209
|
const ok = await confirm({ message: `Delete project ${projectId}? This cannot be undone.` });
|
|
1209
1210
|
if (!ok) {
|
|
@@ -1475,7 +1476,8 @@ Examples:
|
|
|
1475
1476
|
`).action(async (key, opts) => {
|
|
1476
1477
|
requireToken();
|
|
1477
1478
|
const agentId = requireAgentId(opts.agent);
|
|
1478
|
-
|
|
1479
|
+
const skipConfirm = opts.yes || process.argv.includes("--yes") || process.argv.includes("-y");
|
|
1480
|
+
if (!skipConfirm && !isJsonMode() && process.stdout.isTTY) {
|
|
1479
1481
|
const { confirm } = await import("@clack/prompts");
|
|
1480
1482
|
const ok = await confirm({ message: `Delete secret "${key}" from agent ${agentId}?` });
|
|
1481
1483
|
if (!ok) {
|
package/package.json
CHANGED
package/src/commands/project.ts
CHANGED
|
@@ -49,7 +49,8 @@ After creating a project, link it to your current directory:
|
|
|
49
49
|
.option('--yes', 'Skip confirmation')
|
|
50
50
|
.action(async (projectId: string, opts) => {
|
|
51
51
|
requireToken()
|
|
52
|
-
|
|
52
|
+
const skipConfirm = opts.yes || process.argv.includes('--yes') || process.argv.includes('-y')
|
|
53
|
+
if (!skipConfirm && process.stdout.isTTY) {
|
|
53
54
|
const { confirm } = await import('@clack/prompts')
|
|
54
55
|
const ok = await confirm({ message: `Delete project ${projectId}? This cannot be undone.` })
|
|
55
56
|
if (!ok) { console.log('Cancelled.'); return }
|
package/src/commands/secrets.ts
CHANGED
|
@@ -96,7 +96,8 @@ Examples:
|
|
|
96
96
|
.action(async (key: string, opts) => {
|
|
97
97
|
requireToken()
|
|
98
98
|
const agentId = requireAgentId(opts.agent)
|
|
99
|
-
|
|
99
|
+
const skipConfirm = opts.yes || process.argv.includes('--yes') || process.argv.includes('-y')
|
|
100
|
+
if (!skipConfirm && !isJsonMode() && process.stdout.isTTY) {
|
|
100
101
|
const { confirm } = await import('@clack/prompts')
|
|
101
102
|
const ok = await confirm({ message: `Delete secret "${key}" from agent ${agentId}?` })
|
|
102
103
|
if (!ok) { console.log('Cancelled.'); return }
|