@blinkdotnew/cli 0.3.7 → 0.4.1
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 +152 -321
- package/dist/cli.js +1538 -80
- package/package.json +28 -2
- package/src/cli.ts +88 -1
- package/src/commands/auth-config.ts +129 -0
- package/src/commands/backend.ts +175 -0
- package/src/commands/billing.ts +56 -0
- package/src/commands/domains.ts +211 -0
- package/src/commands/env.ts +215 -0
- package/src/commands/functions.ts +136 -0
- package/src/commands/hosting.ts +117 -0
- package/src/commands/init.ts +77 -0
- package/src/commands/project.ts +2 -2
- package/src/commands/security.ts +136 -0
- package/src/commands/tokens.ts +98 -0
- package/src/commands/versions.ts +95 -0
- package/src/commands/workspace.ts +130 -0
- package/src/lib/api-app.ts +7 -1
- package/src/lib/api-resources.ts +3 -0
- package/src/lib/auth.ts +6 -1
- package/src/lib/config.ts +2 -2
- package/src/lib/project.ts +7 -1
package/README.md
CHANGED
|
@@ -1,427 +1,258 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Blink CLI
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The command-line interface for [Blink](https://blink.new) — full-stack cloud infrastructure from your terminal.
|
|
4
|
+
|
|
5
|
+
Create projects, deploy frontends, manage databases, configure auth, set up custom domains, and more. Designed for developers and AI coding agents alike.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx @blinkdotnew/cli --help
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Install
|
|
4
12
|
|
|
5
13
|
```bash
|
|
6
14
|
npm install -g @blinkdotnew/cli
|
|
7
|
-
blink --help
|
|
8
15
|
```
|
|
9
16
|
|
|
10
|
-
|
|
17
|
+
Requires Node.js 22+.
|
|
11
18
|
|
|
12
19
|
## Quick Start
|
|
13
20
|
|
|
14
21
|
```bash
|
|
15
|
-
#
|
|
16
|
-
npm install -g @blinkdotnew/cli
|
|
17
|
-
|
|
18
|
-
# Authenticate (enter your blnk_ak_... API key from blink.new → Settings → API Keys)
|
|
22
|
+
# Authenticate
|
|
19
23
|
blink login --interactive
|
|
20
24
|
|
|
21
|
-
#
|
|
22
|
-
blink
|
|
23
|
-
|
|
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
|
|
25
|
+
# Create and link a project
|
|
26
|
+
blink init --name "my-app"
|
|
29
27
|
|
|
30
|
-
# Deploy
|
|
28
|
+
# Deploy
|
|
31
29
|
npm run build && blink deploy ./dist --prod
|
|
32
30
|
|
|
33
|
-
#
|
|
34
|
-
blink db query "SELECT count(*) FROM users"
|
|
35
|
-
|
|
36
|
-
# Generate AI content
|
|
37
|
-
blink ai image "a glowing blink logo on dark background"
|
|
38
|
-
blink ai text "Summarize this article: ..."
|
|
39
|
-
|
|
40
|
-
# Scrape websites
|
|
41
|
-
blink scrape https://lovable.dev --extract "pricing tiers and costs"
|
|
42
|
-
blink scrape https://example.com --text
|
|
31
|
+
# Done — your app is live
|
|
43
32
|
```
|
|
44
33
|
|
|
45
|
-
|
|
34
|
+
## What You Can Do
|
|
46
35
|
|
|
47
|
-
|
|
36
|
+
| Command | Description |
|
|
37
|
+
|---------|-------------|
|
|
38
|
+
| `blink init` | Create a new project and link it to the current directory |
|
|
39
|
+
| `blink deploy ./dist --prod` | Deploy your built app to production |
|
|
40
|
+
| `blink db query "SELECT * FROM users"` | Run SQL against your project's database |
|
|
41
|
+
| `blink env set STRIPE_KEY sk_live_xxx` | Set environment variables (secrets) |
|
|
42
|
+
| `blink backend deploy` | Deploy a Hono backend to Cloudflare Workers |
|
|
43
|
+
| `blink auth-config set --provider google --enabled true` | Configure authentication providers |
|
|
44
|
+
| `blink domains add myapp.com` | Connect a custom domain |
|
|
45
|
+
| `blink hosting activate` | Activate production hosting |
|
|
46
|
+
| `blink storage upload ./photo.jpg` | Upload files to project storage |
|
|
47
|
+
| `blink ai image "a logo for my app"` | Generate images, text, video, speech |
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
## Full Command Reference
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|---|---|
|
|
53
|
-
| `--token <key>` flag | One-off override per command |
|
|
54
|
-
| `BLINK_API_KEY` env var | CI/CD and Claw agents (set automatically) |
|
|
55
|
-
| `~/.config/blink/config.toml` | Stored after `blink login` |
|
|
51
|
+
### Project Management
|
|
56
52
|
|
|
57
53
|
```bash
|
|
58
|
-
#
|
|
59
|
-
blink
|
|
60
|
-
|
|
61
|
-
#
|
|
62
|
-
blink
|
|
63
|
-
|
|
64
|
-
#
|
|
65
|
-
|
|
54
|
+
blink init # Create project + link to current dir
|
|
55
|
+
blink init --name "My App" # Create with custom name
|
|
56
|
+
blink link # Link existing project (interactive picker)
|
|
57
|
+
blink link proj_xxx # Link to specific project
|
|
58
|
+
blink project list # List all projects
|
|
59
|
+
blink project create "My App" # Create without linking
|
|
60
|
+
blink project delete proj_xxx --yes # Delete a project
|
|
61
|
+
blink status # Show current context (project + auth)
|
|
66
62
|
```
|
|
67
63
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
### Multiple accounts
|
|
71
|
-
|
|
72
|
-
```toml
|
|
73
|
-
# ~/.config/blink/config.toml
|
|
74
|
-
[default]
|
|
75
|
-
api_key = "blnk_ak_personal"
|
|
76
|
-
|
|
77
|
-
[work]
|
|
78
|
-
api_key = "blnk_ak_work"
|
|
79
|
-
```
|
|
64
|
+
### Deploy
|
|
80
65
|
|
|
81
66
|
```bash
|
|
82
|
-
blink --
|
|
67
|
+
blink deploy ./dist --prod # Deploy to production
|
|
68
|
+
blink deploy ./dist # Preview deployment
|
|
69
|
+
blink deployments # List past deployments
|
|
70
|
+
blink rollback # Rollback to previous version
|
|
83
71
|
```
|
|
84
72
|
|
|
85
|
-
|
|
73
|
+
### Database
|
|
86
74
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
### `blink deploy` — Deploy to Blink hosting
|
|
75
|
+
Each project gets its own SQLite database powered by libSQL.
|
|
90
76
|
|
|
91
77
|
```bash
|
|
92
|
-
blink
|
|
93
|
-
blink
|
|
94
|
-
blink
|
|
95
|
-
blink
|
|
96
|
-
blink deploy ./dist --preview # Preview URL (default)
|
|
97
|
-
blink deploy ./dist --name "v2 beta" # Label this deployment
|
|
98
|
-
|
|
99
|
-
blink deployments # List deployments
|
|
100
|
-
blink rollback # Rollback production to previous deploy
|
|
78
|
+
blink db query "SELECT * FROM users LIMIT 10"
|
|
79
|
+
blink db exec schema.sql # Run a SQL file
|
|
80
|
+
blink db list # Show all tables
|
|
81
|
+
blink db list users # Show rows in a table
|
|
101
82
|
```
|
|
102
83
|
|
|
103
|
-
|
|
84
|
+
### Environment Variables
|
|
104
85
|
|
|
105
86
|
```bash
|
|
106
|
-
|
|
87
|
+
blink env list # List all env vars
|
|
88
|
+
blink env set DATABASE_URL postgres://...
|
|
89
|
+
blink env delete OLD_KEY
|
|
90
|
+
blink env push .env # Bulk import from .env file
|
|
91
|
+
blink env pull > .env.local # Export to file
|
|
107
92
|
```
|
|
108
93
|
|
|
109
|
-
|
|
110
|
-
Production deploys go to your custom domain or `{id}.sites.blink.new`.
|
|
111
|
-
|
|
112
|
-
---
|
|
94
|
+
### Backend (Cloudflare Workers)
|
|
113
95
|
|
|
114
|
-
|
|
96
|
+
Deploy a Hono server to Cloudflare Workers for Platforms — each project gets its own isolated V8 worker.
|
|
115
97
|
|
|
116
98
|
```bash
|
|
117
|
-
blink
|
|
118
|
-
blink
|
|
119
|
-
blink
|
|
120
|
-
|
|
121
|
-
blink
|
|
122
|
-
blink link proj_xxx # Link to specific project
|
|
123
|
-
blink unlink # Remove .blink/project.json
|
|
124
|
-
blink status # Show linked project + auth source
|
|
99
|
+
blink backend deploy # Deploy backend/ folder
|
|
100
|
+
blink backend deploy ./server # Deploy from custom directory
|
|
101
|
+
blink backend status # Check deployment status
|
|
102
|
+
blink backend logs # View request logs
|
|
103
|
+
blink backend delete --yes # Remove backend
|
|
125
104
|
```
|
|
126
105
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
### `blink use` — Set active project for a shell session
|
|
106
|
+
### Auth Configuration
|
|
132
107
|
|
|
133
108
|
```bash
|
|
134
|
-
blink
|
|
135
|
-
|
|
136
|
-
|
|
109
|
+
blink auth-config get # Show current auth config
|
|
110
|
+
blink auth-config set --provider google --enabled true
|
|
111
|
+
blink auth-config set --mode managed
|
|
112
|
+
blink auth-config byoc-set --provider google --client-id X --client-secret Y
|
|
113
|
+
blink auth-config byoc-remove --provider google
|
|
137
114
|
```
|
|
138
115
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
---
|
|
142
|
-
|
|
143
|
-
### `blink db` — Database (Turso/SQLite per project)
|
|
116
|
+
### Custom Domains
|
|
144
117
|
|
|
145
118
|
```bash
|
|
146
|
-
#
|
|
147
|
-
blink
|
|
148
|
-
blink
|
|
149
|
-
|
|
150
|
-
#
|
|
151
|
-
blink
|
|
152
|
-
blink
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
blink db list
|
|
119
|
+
blink domains list # List project domains
|
|
120
|
+
blink domains add myapp.com # Add a custom domain
|
|
121
|
+
blink domains verify <domain_id> # Verify DNS configuration
|
|
122
|
+
blink domains remove <domain_id> --yes # Remove a domain
|
|
123
|
+
blink domains search "myapp" # Search available domains
|
|
124
|
+
blink domains purchase myapp.com --yes # Purchase a domain
|
|
125
|
+
blink domains connect myapp.com # Connect purchased domain to project
|
|
126
|
+
blink domains my # List your purchased domains
|
|
127
|
+
```
|
|
156
128
|
|
|
157
|
-
|
|
158
|
-
blink db list users
|
|
159
|
-
blink db list proj_xxx users --limit 50
|
|
129
|
+
### Hosting
|
|
160
130
|
|
|
161
|
-
|
|
162
|
-
blink
|
|
131
|
+
```bash
|
|
132
|
+
blink hosting status # Check hosting state + URLs
|
|
133
|
+
blink hosting activate # Activate production hosting
|
|
134
|
+
blink hosting deactivate --yes # Deactivate hosting
|
|
135
|
+
blink hosting reactivate # Reactivate after deactivation
|
|
163
136
|
```
|
|
164
137
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
### `blink storage` — File storage
|
|
138
|
+
### Storage
|
|
168
139
|
|
|
169
140
|
```bash
|
|
170
|
-
|
|
171
|
-
blink storage upload ./logo.png
|
|
172
|
-
blink storage upload proj_xxx ./logo.png --path images/logo.png
|
|
173
|
-
|
|
174
|
-
# List
|
|
141
|
+
blink storage upload ./photo.jpg
|
|
175
142
|
blink storage list
|
|
176
|
-
blink storage
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
blink storage download images/logo.png ./local-logo.png
|
|
180
|
-
|
|
181
|
-
# Get public URL
|
|
182
|
-
blink storage url images/logo.png
|
|
183
|
-
|
|
184
|
-
# Delete
|
|
185
|
-
blink storage delete images/old-logo.png
|
|
143
|
+
blink storage url images/photo.jpg # Get CDN URL
|
|
144
|
+
blink storage download images/photo.jpg ./local.jpg
|
|
145
|
+
blink storage delete images/old.jpg
|
|
186
146
|
```
|
|
187
147
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
### `blink ai` — AI generation
|
|
148
|
+
### AI
|
|
191
149
|
|
|
192
150
|
```bash
|
|
193
|
-
|
|
194
|
-
blink ai text "Summarize this in 3 bullets: ..."
|
|
195
|
-
blink ai text "Write a product description" --model anthropic/claude-sonnet-4.5
|
|
196
|
-
|
|
197
|
-
# Image
|
|
151
|
+
blink ai text "Summarize this: ..."
|
|
198
152
|
blink ai image "a futuristic city at sunset"
|
|
199
|
-
blink ai
|
|
200
|
-
blink ai
|
|
201
|
-
|
|
202
|
-
# Image editing
|
|
203
|
-
blink ai image-edit "make it night time" https://example.com/city.jpg
|
|
204
|
-
|
|
205
|
-
# Video (text-to-video)
|
|
206
|
-
blink ai video "a drone flyover of a neon city"
|
|
207
|
-
blink ai video "timelapse of clouds" --model fal-ai/veo3.1 --duration 10s --aspect 9:16
|
|
208
|
-
|
|
209
|
-
# Video (image-to-video) — local file or URL
|
|
210
|
-
blink ai animate "make it come alive" ./photo.jpg
|
|
211
|
-
blink ai animate "pan slowly to the right" https://example.com/photo.jpg
|
|
212
|
-
|
|
213
|
-
# Speech (text-to-speech)
|
|
214
|
-
blink ai speech "Hello, welcome to Blink."
|
|
215
|
-
blink ai speech "Hello world" --voice nova --output ./greeting.mp3
|
|
216
|
-
# Voices: alloy, echo, fable, onyx, nova, shimmer
|
|
217
|
-
|
|
218
|
-
# Transcription
|
|
153
|
+
blink ai video "ocean waves" --duration 10s
|
|
154
|
+
blink ai speech "Hello world" --voice nova --output hello.mp3
|
|
219
155
|
blink ai transcribe ./meeting.mp3
|
|
220
|
-
blink ai transcribe https://example.com/audio.mp3 --language en
|
|
221
156
|
```
|
|
222
157
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
### `blink fetch`, `blink search`, `blink scrape` — Web & data
|
|
158
|
+
### Security & CORS
|
|
226
159
|
|
|
227
160
|
```bash
|
|
228
|
-
|
|
229
|
-
blink
|
|
230
|
-
blink
|
|
231
|
-
blink
|
|
232
|
-
|
|
233
|
-
# Web search
|
|
234
|
-
blink search "latest AI news"
|
|
235
|
-
blink search "React Server Components" --count 10 --json
|
|
236
|
-
|
|
237
|
-
# Scrape web pages
|
|
238
|
-
blink scrape https://example.com # Raw response
|
|
239
|
-
blink scrape https://example.com --text # Clean text (strips HTML)
|
|
240
|
-
blink scrape https://example.com --extract "all prices" # AI-extract specific data
|
|
241
|
-
blink scrape https://news.ycombinator.com --extract "top 10 story titles and URLs"
|
|
242
|
-
blink scrape https://example.com --extract "contact email" --json
|
|
161
|
+
blink security get # Show per-module auth policy
|
|
162
|
+
blink security set --module db --require-auth true
|
|
163
|
+
blink cors get # Show allowed origins
|
|
164
|
+
blink cors set --origins https://example.com https://app.example.com
|
|
243
165
|
```
|
|
244
166
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
- `--text` — strips all HTML tags, returns readable text
|
|
248
|
-
- `--extract <instructions>` — uses AI (Gemini Flash) to extract exactly what you ask for
|
|
249
|
-
- Combine with `--json` for `{ url, content }` or `{ url, extracted }` output
|
|
250
|
-
|
|
251
|
-
---
|
|
252
|
-
|
|
253
|
-
### `blink realtime` — Pub/sub
|
|
167
|
+
### Workspace Management
|
|
254
168
|
|
|
255
169
|
```bash
|
|
256
|
-
|
|
257
|
-
blink
|
|
258
|
-
blink
|
|
170
|
+
blink workspace list # List workspaces
|
|
171
|
+
blink workspace create "My Team" # Create a workspace
|
|
172
|
+
blink workspace switch wsp_xxx # Switch active workspace
|
|
173
|
+
blink workspace members wsp_xxx # List members
|
|
174
|
+
blink workspace invite user@example.com wsp_xxx --role admin
|
|
259
175
|
```
|
|
260
176
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
### `blink rag` — Knowledge base / RAG
|
|
177
|
+
### Versions
|
|
264
178
|
|
|
265
179
|
```bash
|
|
266
|
-
#
|
|
267
|
-
blink
|
|
268
|
-
blink
|
|
269
|
-
blink rag search proj_xxx "billing" --limit 10
|
|
270
|
-
|
|
271
|
-
# Upload a document
|
|
272
|
-
blink rag upload ./docs/faq.md
|
|
273
|
-
blink rag upload proj_xxx ./docs/faq.md --collection coll_xxx
|
|
274
|
-
|
|
275
|
-
# List collections
|
|
276
|
-
blink rag collections
|
|
180
|
+
blink versions list # List saved snapshots
|
|
181
|
+
blink versions save --message "v1.0" # Save a snapshot
|
|
182
|
+
blink versions restore ver_xxx --yes # Restore to a snapshot
|
|
277
183
|
```
|
|
278
184
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
### `blink notify` — Email
|
|
185
|
+
### Billing
|
|
282
186
|
|
|
283
187
|
```bash
|
|
284
|
-
blink
|
|
285
|
-
blink
|
|
286
|
-
blink
|
|
188
|
+
blink credits # Check credit usage
|
|
189
|
+
blink usage # Usage breakdown
|
|
190
|
+
blink usage --period month # Monthly summary
|
|
287
191
|
```
|
|
288
192
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
### `blink connector` — OAuth connectors
|
|
193
|
+
### Personal Access Tokens
|
|
292
194
|
|
|
293
195
|
```bash
|
|
294
|
-
|
|
295
|
-
blink
|
|
296
|
-
blink
|
|
297
|
-
blink connector exec slack post_message '{"channel":"C123","text":"Hello"}' --method POST
|
|
298
|
-
blink connector exec notion create_page '{"title":"New Page"}' --account acct_xxx
|
|
196
|
+
blink tokens list # List all PATs
|
|
197
|
+
blink tokens create --name "CI key" # Create a new token (shown once)
|
|
198
|
+
blink tokens revoke tok_xxx --yes # Revoke a token
|
|
299
199
|
```
|
|
300
200
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
## Global Flags
|
|
304
|
-
|
|
305
|
-
Available on every command:
|
|
306
|
-
|
|
307
|
-
| Flag | Description |
|
|
308
|
-
|---|---|
|
|
309
|
-
| `--token <key>` | Override API key for this command only |
|
|
310
|
-
| `--json` | Output raw JSON (no colors, no spinners — great for scripting) |
|
|
311
|
-
| `--yes` | Skip confirmation prompts |
|
|
312
|
-
| `--profile <name>` | Use a named profile from `config.toml` |
|
|
313
|
-
| `--debug` | Print full request/response details |
|
|
314
|
-
| `--version` | Print CLI version |
|
|
315
|
-
| `--help` | Show help for any command |
|
|
201
|
+
## Authentication
|
|
316
202
|
|
|
317
|
-
|
|
203
|
+
Three ways to authenticate, checked in this order:
|
|
318
204
|
|
|
319
|
-
|
|
205
|
+
1. **`--token` flag** — per-command override
|
|
206
|
+
2. **`BLINK_API_KEY` env var** — for CI/CD and coding agents
|
|
207
|
+
3. **Config file** — saved by `blink login --interactive` at `~/.config/blink/config.toml`
|
|
320
208
|
|
|
321
|
-
|
|
209
|
+
Get your API key at [blink.new/settings?tab=api-keys](https://blink.new/settings?tab=api-keys).
|
|
322
210
|
|
|
323
211
|
```bash
|
|
324
|
-
#
|
|
325
|
-
|
|
326
|
-
echo "Deployed to: $URL"
|
|
327
|
-
|
|
328
|
-
# Query database and pipe to jq
|
|
329
|
-
blink db query "SELECT id, email FROM users" --json | jq '.[].email'
|
|
330
|
-
|
|
331
|
-
# Generate image and get URL
|
|
332
|
-
IMG=$(blink ai image "a logo" --json | jq -r '.url')
|
|
333
|
-
blink storage upload ./banner.png --json | jq -r '.url'
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
### GitHub Actions example
|
|
337
|
-
|
|
338
|
-
```yaml
|
|
339
|
-
- name: Deploy to Blink
|
|
340
|
-
env:
|
|
341
|
-
BLINK_API_KEY: ${{ secrets.BLINK_API_KEY }}
|
|
342
|
-
run: |
|
|
343
|
-
npm install -g @blinkdotnew/cli
|
|
344
|
-
blink deploy ./dist --prod --json
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
---
|
|
348
|
-
|
|
349
|
-
## Config Files
|
|
350
|
-
|
|
351
|
-
| File | Purpose |
|
|
352
|
-
|---|---|
|
|
353
|
-
| `~/.config/blink/config.toml` | Auth tokens, workspace ID, named profiles |
|
|
354
|
-
| `.blink/project.json` | Per-directory project link (like `.vercel/project.json`) |
|
|
355
|
-
|
|
356
|
-
`.blink/project.json` is created by `blink link` — add it to `.gitignore`.
|
|
357
|
-
|
|
358
|
-
---
|
|
359
|
-
|
|
360
|
-
## Blink Claw Agents
|
|
212
|
+
# Interactive — saves to config file
|
|
213
|
+
blink login --interactive
|
|
361
214
|
|
|
362
|
-
|
|
215
|
+
# Environment variable — for CI/agents
|
|
216
|
+
export BLINK_API_KEY=blnk_ak_...
|
|
363
217
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
BLINK_AGENT_ID this agent's ID — auto-used by blink agent/secrets commands
|
|
367
|
-
BLINK_APIS_URL https://core.blink.new
|
|
368
|
-
BLINK_APP_URL https://blink.new
|
|
218
|
+
# Per-command
|
|
219
|
+
blink deploy ./dist --prod --token blnk_ak_...
|
|
369
220
|
```
|
|
370
221
|
|
|
371
|
-
|
|
222
|
+
## Project Context
|
|
372
223
|
|
|
373
|
-
|
|
374
|
-
# In openclaw/skills/blink-image/scripts/generate.sh
|
|
375
|
-
blink ai image "$PROMPT" --model "$MODEL" --json
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
### `blink agent` — Manage agents
|
|
224
|
+
Commands that operate on a project resolve it in this order:
|
|
379
225
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
blink
|
|
383
|
-
eval $(blink agent use clw_xxx --export) # Set active agent for this session
|
|
384
|
-
blink agent status # Show current agent details
|
|
385
|
-
blink agent status clw_xxx # Show specific agent details
|
|
386
|
-
```
|
|
226
|
+
1. **Positional argument** — `blink db query proj_xxx "SELECT 1"`
|
|
227
|
+
2. **`BLINK_ACTIVE_PROJECT` env var** — `eval $(blink use proj_xxx --export)`
|
|
228
|
+
3. **`.blink/project.json`** — created by `blink link` or `blink init`
|
|
387
229
|
|
|
388
|
-
|
|
230
|
+
## Machine-Readable Output
|
|
389
231
|
|
|
390
|
-
|
|
232
|
+
Every command supports `--json` for scripting and AI agent integration:
|
|
391
233
|
|
|
392
234
|
```bash
|
|
393
|
-
|
|
394
|
-
blink
|
|
395
|
-
blink
|
|
396
|
-
blink secrets delete OLD_KEY # Remove a secret (--yes to skip prompt)
|
|
397
|
-
|
|
398
|
-
# Cross-agent management (agent manager pattern)
|
|
399
|
-
blink secrets list --agent clw_other # Another agent's keys
|
|
400
|
-
blink secrets set --agent clw_other OPENAI_KEY sk-xxx # Set on another agent
|
|
235
|
+
blink deploy ./dist --prod --json | jq '.url'
|
|
236
|
+
blink db query "SELECT email FROM users" --json | jq '.[].email'
|
|
237
|
+
blink env list --json | jq '.[].key'
|
|
401
238
|
```
|
|
402
239
|
|
|
403
|
-
|
|
240
|
+
## For Coding Agents
|
|
404
241
|
|
|
405
|
-
|
|
406
|
-
1. `--agent <id>` flag
|
|
407
|
-
2. `BLINK_AGENT_ID` env var ← always set on Claw Fly machines
|
|
408
|
-
3. `BLINK_ACTIVE_AGENT` env var ← from `eval $(blink agent use clw_xxx --export)`
|
|
242
|
+
The Blink CLI is designed to work seamlessly with AI coding agents like Cursor, Claude Code, and Codex:
|
|
409
243
|
|
|
410
|
-
|
|
244
|
+
- **Non-interactive by default** — all inputs are flags, no menus or prompts
|
|
245
|
+
- **`--json` mode** — structured output for every command
|
|
246
|
+
- **`--yes` flag** — skip confirmations for automation
|
|
247
|
+
- **Actionable errors** — every error message includes the exact command to fix it
|
|
248
|
+
- **Layered help** — `blink --help` for overview, `blink backend --help` for a group, `blink backend deploy --help` for full details
|
|
411
249
|
|
|
412
|
-
|
|
413
|
-
$ BLINK_AGENT_ID=clw_xxx blink status
|
|
414
|
-
|
|
415
|
-
Agent clw_xxx (BLINK_AGENT_ID env)
|
|
416
|
-
Project proj_yyy (.blink/project.json)
|
|
417
|
-
Auth ~/.config/blink/config.toml
|
|
418
|
-
```
|
|
250
|
+
## Links
|
|
419
251
|
|
|
420
|
-
|
|
252
|
+
- [Blink](https://blink.new) — Build full-stack apps with AI
|
|
253
|
+
- [Documentation](https://blink.new/docs/cli)
|
|
254
|
+
- [SDK](https://www.npmjs.com/package/@blinkdotnew/sdk)
|
|
421
255
|
|
|
422
|
-
##
|
|
256
|
+
## License
|
|
423
257
|
|
|
424
|
-
|
|
425
|
-
- **Blink platform**: https://blink.new
|
|
426
|
-
- **Docs**: https://blink.new/docs
|
|
427
|
-
- **Source**: `blink-sdk/packages/cli/` in the `blink-new/blink-sdk` repo
|
|
258
|
+
MIT
|