⌨️ CLI Reference
nirvadeploy CLI
Command-line tool สำหรับ script + automate NirvaDeploy
💡 เลือกใช้ tool ไหนดี?
| Use case | Best tool |
|---|---|
| คุยกับ AI สั่ง deploy | MCP server + Claude/Manus/Cursor |
| Manage projects ใน browser | Web dashboard (nirvadeploy.com/dashboard) |
| Script ใน CI/CD pipeline | CLI (this page) |
| Programmatic integration | REST API (/docs/api) |
📦 Install (Phase 2.x)
# via npm (Phase 2.x — TBD) npm install -g @nirvadeploy/cli # or via Homebrew (Phase 2.x — TBD) brew install nirvadeploy # or download binary (Phase 2.x — TBD) curl -fsSL https://nirvadeploy.com/install.sh | bash
🚧 ตอนนี้ใช้ MCP server แทน (/docs/api) — เร็วๆ นี้จะมี CLI standalone
Auth
$ nirvadeploy login
Sign in via OAuth (opens browser)
$ nirvadeploy whoami
Show current authenticated user
$ nirvadeploy logout
Clear local credentials
Projects + services
$ nirvadeploy projects ls
List all projects
$ nirvadeploy projects ls --json
$ nirvadeploy projects create <repo>
Create project from GitHub repo
$ nirvadeploy projects create myorg/web-app --branch main
$ nirvadeploy services ls
List services in current/given project
$ nirvadeploy services ls --project=<id>
$ nirvadeploy services deploy
Trigger redeploy
$ nirvadeploy services scale --replicas=N
Scale to N replicas (1-10, Pro+)
$ nirvadeploy services delete --confirm
Delete service (destructive — requires --confirm)
Logs + metrics
$ nirvadeploy logs
Stream logs from latest deployment
$ nirvadeploy logs --service=svc-001 --follow
$ nirvadeploy metrics
Show CPU/RAM/network metrics
$ nirvadeploy metrics --service=svc-001 --format=table
Variables
$ nirvadeploy env ls
List env vars (names only)
$ nirvadeploy env set KEY=value
Set env var (supports --file .env)
$ nirvadeploy env set DATABASE_URL=postgres://...
$ nirvadeploy env unset KEY
Remove env var
Templates
$ nirvadeploy templates ls
List available templates
$ nirvadeploy templates deploy <slug>
Deploy template from marketplace
$ nirvadeploy templates deploy line-bot-starter --env LINE_TOKEN=...
Affiliate
$ nirvadeploy affiliate link
Print your referral link
$ nirvadeploy affiliate stats
Show clicks, signups, commission earned
🚩 Global flags
| Flag | Description |
|---|---|
| --project=<id> | Target specific project (overrides current dir) |
| --token=<token> | API token (overrides ~/.nirvadeploy/config) |
| --json | Output as JSON (for piping/scripting) |
| --format=table|json|tsv | Output format |
| --follow / -f | Stream output (logs, deployments) |
| --quiet / -q | Suppress non-essential output |
| --debug | Verbose logging |
| --no-color | Disable ANSI colors (for piping) |
| --help / -h | Show help for command |
| --version / -v | Print version |
🔄 CI/CD usage (planned)
GitHub Actions
name: Deploy to NirvaDeploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nirvadeploy/setup-cli@v1 # Phase 2.x
with:
token: ${{ secrets.NIRVADEPLOY_TOKEN }}
- run: nirvadeploy services deploy --service=svc-001 --wait
- run: nirvadeploy logs --service=svc-001 --since=2m📦 Source: github.com/nirvadeploy/cli (Phase 2.x)
CLI ตอนนี้กำลังพัฒนา. ใช้ MCP server (/nirvadeploy-mcp) ในระหว่างนี้.