@blinkdotnew/cli
v0.9.1
Published
Blink CLI — full-stack cloud infrastructure from your terminal. Deploy, database, auth, storage, backend, domains, and more.
Readme
Blink CLI
The command-line interface for Blink — full-stack cloud infrastructure from your terminal.
Create projects, deploy frontends, manage databases, configure auth, set up custom domains, and more. Designed for developers and AI coding agents alike.
npx @blinkdotnew/cli --helpInstall
npm install -g @blinkdotnew/cliRequires Node.js 22+.
Quick Start
# Authenticate
blink login --interactive
# Create and link a project
blink init --name "my-app"
# Deploy
npm run build && blink deploy ./dist --prod
# Done — your app is liveWhat You Can Do
| Command | Description |
|---------|-------------|
| blink init | Create a new project and link it to the current directory |
| blink deploy ./dist --prod | Deploy your built app to production |
| blink db query "SELECT * FROM users" | Run SQL against your project's database |
| blink env set STRIPE_KEY sk_live_xxx | Set environment variables (secrets) — env list masks values, --reveal shows them |
| blink backend deploy | Deploy a Hono backend to Cloudflare Workers |
| blink auth-config set --provider google --enabled true | Configure authentication providers |
| blink domains add myapp.com | Connect a custom domain |
| blink hosting activate | Activate production hosting |
| blink storage upload ./photo.jpg | Upload files to project storage |
| blink ai image "a logo for my app" | Generate images, text, video, speech |
Full Command Reference
Project Management
blink init # Create project + link to current dir
blink init --name "My App" # Create with custom name
blink link # Link existing project (interactive picker)
blink link proj_xxx # Link to specific project
blink project list # List all projects
blink project create "My App" # Create without linking
blink project delete proj_xxx --yes # Delete a project
blink status # Show current context (project + auth)Deploy
blink deploy ./dist --prod # Deploy to production (a build over ~3 MB is zipped and uploaded automatically; builds up to 50 MB)
blink deploy ./dist # Preview deployment
blink deployments # List past deployments
blink rollback # Rollback to previous versionDatabase
Each project gets its own SQLite database powered by libSQL.
blink db query "SELECT * FROM users LIMIT 10"
blink db exec schema.sql # Run a SQL file
blink db list # Show all tables
blink db list users # Show rows in a tableEnvironment Variables
Secret values are hidden unless you ask for them — listing is an inspection command, and terminal output ends up in scrollback, CI logs and screenshots.
blink env list # List env var NAMES (values masked)
blink env list --reveal # ...and their values
blink env set DATABASE_URL postgres://...
blink env delete OLD_KEY
blink env push .env # Bulk import from .env file
blink env pull > .env.local # Export values to a file
blink env pull --stdout # ...or to this terminal, explicitlyenv pull exports real values: it refuses to print to an interactive terminal
unless you pass --stdout, and notes on stderr that plaintext was exported —
except under > file 2>&1, where that note would land inside the export.
Backend (Cloudflare Workers)
Deploy a Hono server to Cloudflare Workers for Platforms — each project gets its own isolated V8 worker.
blink backend deploy # Deploy backend/ folder
blink backend deploy ./server # Deploy from custom directory
blink backend status # Check deployment status
blink backend logs # View request logs
blink backend delete --yes # Remove backendAuth Configuration
blink auth-config get # Show current auth config
blink auth-config set --provider google --enabled true
blink auth-config set --mode managed
blink auth-config byoc-set --provider google --client-id X --client-secret Y
blink auth-config byoc-remove --provider googleCustom Domains
blink domains list # List project domains
blink domains add myapp.com # Add a custom domain
blink domains verify <domain_id> # Verify DNS configuration
blink domains remove <domain_id> --yes # Remove a domain
blink domains search "myapp" # Search available domains
blink domains purchase myapp.com --yes # Purchase a domain
blink domains connect myapp.com # Connect purchased domain to project
blink domains my # List your purchased domainsHosting
blink hosting status # Check hosting state + URLs
blink hosting activate # Activate production hosting
blink hosting deactivate --yes # Deactivate hosting
blink hosting reactivate # Reactivate after deactivationStorage
Storage answers to the project's secret key, not the workspace key: set BLINK_PROJECT_KEY to blnk_sk_... (Project Settings → API Keys). A publishable key (blnk_pk_...) is meant for browsers, so the CLI refuses it. Keep the secret key out of your repository and your frontend.
Files are readable by anyone who has the URL, and Blink names the stored file itself (<folder>/<random id>.<ext>), so --path chooses only the folder.
export BLINK_PROJECT_KEY=blnk_sk_...
blink storage upload ./photo.jpg --path images/ # prints the real public URL
blink storage list # one folder level; folders end in /
blink storage list images/ # the contents of images/
blink storage url images/<stored-name>.jpg # Public URL
blink storage download images/<stored-name>.jpg ./local.jpg
blink storage delete images/<stored-name>.jpglist shows one folder at a time, so walk the folders to inventory a project. It has no paging options: limit would cap the reply instead of paging it.
AI
blink ai text "Summarize this: ..."
blink ai image "a futuristic city at sunset"
blink ai video "ocean waves" --duration 10s
blink ai speech "Hello world" --voice nova --output hello.mp3
blink ai transcribe ./meeting.mp3Security & CORS
blink security get # Show per-module auth policy
blink security set --module db --require-auth true
blink cors get # Show allowed origins
blink cors set --origins https://example.com https://app.example.comWorkspace Management
blink workspace list # List workspaces
blink workspace create "My Team" # Create a workspace
blink workspace switch wsp_xxx # Switch active workspace
blink workspace members wsp_xxx # List members
blink workspace invite [email protected] wsp_xxx --role adminVersions
blink versions list # List saved snapshots
blink versions save --message "v1.0" # Save a snapshot
blink versions restore ver_xxx --yes # Restore to a snapshotBilling
blink credits # Check credit usage
blink usage # Usage breakdown
blink usage --period month # Monthly summaryAuthentication
Get your workspace API key from blink.new/settings?tab=api-keys (starts with blnk_ak_).
# Opens the API keys page in your browser, then prompts for the key
blink login
blink login --interactive
# Or set the env var directly (CI/agents)
export BLINK_API_KEY=blnk_ak_...Auth is resolved in this order:
--tokenflag — per-command overrideBLINK_API_KEYenv var — for CI/CD and coding agents- Config file — saved by
blink login --interactiveat~/.config/blink/config.toml
Project Context
Commands that operate on a project resolve it in this order:
- Positional argument —
blink db query proj_xxx "SELECT 1" BLINK_ACTIVE_PROJECTenv var —eval $(blink use proj_xxx --export).blink/project.json— created byblink linkorblink init
Machine-Readable Output
Every command supports --json for scripting and AI agent integration:
blink deploy ./dist --prod --json | jq '.url'
blink db query "SELECT email FROM users" --json | jq '.[].email'
blink env list --json | jq '.secrets[].key'For Coding Agents
The Blink CLI is designed to work seamlessly with AI coding agents like Cursor, Claude Code, and Codex:
- Non-interactive by default — all inputs are flags, no menus or prompts
--jsonmode — structured output for every command--yesflag — skip confirmations for automation- Actionable errors — every error message includes the exact command to fix it
- Layered help —
blink --helpfor overview,blink backend --helpfor a group,blink backend deploy --helpfor full details
Links
- Blink — Build full-stack apps with AI
- Documentation
- SDK
License
MIT
