CLI Reference
Complete reference for every poc command. Install with npm install -g @poc-ai/cli.
Global Options
| Flag | Description |
|---|---|
--help, -h | Show help for any command |
--version, -V | Print CLI version |
--json | Output results as JSON |
--verbose | Enable verbose logging |
--token <token> | Use a specific API token instead of the stored session |
poc login
AUTHAuthenticate with POC.ai. Opens a browser window for OAuth and stores the session token locally.
poc login
| Flag | Description |
|---|---|
--token <token> | Authenticate with an API token directly (for CI environments) |
--no-browser | Print the auth URL instead of opening a browser |
Example:
poc login
# Opening browser for authentication...
# ✓ Logged in as you@example.com
# CI mode:
poc login --token $POC_API_TOKEN
poc deploy
DEPLOYDetect the framework in the given path and deploy a preview. If no path is provided, the current directory is used.
poc deploy [path]
| Flag | Description | Default |
|---|---|---|
--env <name> | Target environment (preview, staging, production) | preview |
--name <name> | Override the auto-detected project name | Directory name |
--framework <fw> | Skip detection and use specified framework | Auto-detect |
--build-cmd <cmd> | Override the build command | Auto-detect |
--start-cmd <cmd> | Override the start command | Auto-detect |
--region <region> | Deployment region | oregon |
--yes, -y | Skip confirmation prompt | — |
Example:
poc deploy ./my-app --env preview --name my-app
# Detecting framework... React (Vite)
# Generating blueprint... done
# Deploying preview... ━━━━━━━━━━━━━━━━ 100%
#
# ✓ Preview live at https://my-app-abc123.poc.ai
# Deployment ID: dep_7xk2m9
poc status
READCheck the current status of a deployment. If no ID is provided, shows the most recent deployment.
poc status [id]
| Flag | Description |
|---|---|
--watch, -w | Continuously poll status until terminal state |
--json | Output as JSON |
Example:
poc status dep_7xk2m9
# Deployment dep_7xk2m9
# Status live
# URL https://my-app-abc123.poc.ai
# Created 2 minutes ago
# Framework React (Vite)
poc promote
DEPLOYPromote a preview deployment to production. Requires the deployment to be in live status.
poc promote [id]
| Flag | Description |
|---|---|
--yes, -y | Skip confirmation prompt |
--domain <domain> | Custom production domain |
Example:
poc promote dep_7xk2m9
# Promoting dep_7xk2m9 to production...
# ✓ Production live at https://my-app.poc.ai
poc rollback
DEPLOYRoll back to the previous healthy version of a deployment.
poc rollback [id]
| Flag | Description |
|---|---|
--to <version> | Roll back to a specific version instead of the previous one |
--yes, -y | Skip confirmation prompt |
Example:
poc rollback dep_7xk2m9
# Rolling back dep_7xk2m9...
# ✓ Rolled back to version v2. Service is live.
poc logs
READView build and runtime logs for a deployment.
poc logs [id]
| Flag | Description |
|---|---|
--follow, -f | Stream logs in real time |
--type <type> | Filter by log type: build, runtime, or all |
--lines, -n <num> | Number of lines to show |
Example:
poc logs dep_7xk2m9 --type build --lines 20
# [build] Installing dependencies...
# [build] npm install completed in 12s
# [build] Running build command: vite build
# [build] ✓ Build succeeded in 8s
poc env
CONFIGManage environment variables for a project.
poc env [set|get|list]
| Subcommand | Description | Usage |
|---|---|---|
set | Set an environment variable | poc env set KEY=value |
get | Get the value of a variable | poc env get KEY |
list | List all environment variables | poc env list |
| Flag | Description |
|---|---|
--project <name> | Target project (defaults to current directory) |
--env <environment> | Target environment (preview, staging, production) |
Examples:
# Set a variable
poc env set DATABASE_URL=postgres://localhost:5432/mydb
# List all variables
poc env list --project my-app
# DATABASE_URL = postgres://loc... (preview)
# API_KEY = ****masked**** (preview)
# Get a specific variable
poc env get DATABASE_URL
poc whoami
AUTHDisplay the currently authenticated user and organization.
poc whoami
Example:
poc whoami
# Email you@example.com
# Org PsyTech
# Plan Pro
# Token poc_****...a1b2