System Commands
Shortcuts
opd -v— version (alias of--version)opd -h— help (alias of--help)opd -s— start wizard (equivalent toopd start)
start
Guided wizard for selecting framework, provider, environment, optional env sync, and deploying.
Usage:
opd start [--framework <next|astro|sveltekit>] \
[--provider <vercel|cloudflare|github>] [--env <prod|preview>] \
[--path <dir>] [--project <id>] [--org <id>] \
[--sync-env] [--dry-run] [--json] [--ci] [--no-save-defaults] [--minimal]
Behavior:
- Auto-detects frameworks when possible; otherwise prompts for a choice.
- Shows provider login status and offers one‑click login if required.
- Env sync is optional; when enabled, the wizard chooses a sensible
.envfile per target. - Prints a final JSON summary
{ ok, provider, target, url?, logsUrl?, final: true }when--jsonis used. - With
--dry-run, the wizard prints{ ok: true, mode: 'dry-run', final: true }and exits before syncing/deploying. - If you pass
--project/--org(Vercel) and the directory is not linked yet, the wizard offers to runvercel linkinline. - After deployment, the wizard prints a copyable non‑interactive command showing an equivalent
opd up ...invocation. - Minimal preset (
--minimal): non‑interactive defaults for first‑time deploys. Detects framework and chooses provider automatically (GitHub Pages when Next.js static export is detected vianext.config.*: { output: 'export' }, otherwise Vercel). Prints a concise summary in human mode and a final JSON line when--jsonis set.
Notes:
- The deploy step reuses the same logic as
upfor parity. - Non‑interactive usage is supported with flags.
- Defaults: When confirmed, the wizard stores your selections under
startDefaultsin the rootopendeploy.config.json. To clear, delete the file or remove thestartDefaultsproperty. Use--no-save-defaultsto suppress the save prompt.
Sidecar & experimental flags
You can optionally enable the Go sidecar and experimental provider features:
OPD_GO_FORCE=1— prefer the Go sidecar when present (more reliable process control)OPD_GO_DISABLE=1— disable the sidecar and use the Node runnerOPD_PTY=1|0— force PTY usage on/off; by default, PTY is used in interactive terminals but disabled in CI/JSON modes
Start wizard summary fields (JSON)
When --json (or --ndjson) is enabled, the final summary line includes at least:
{
"ok": true,
"action": "start",
"provider": "<vercel|cloudflare|github>",
"target": "<prod|preview>",
"mode": "deploy" | "prepare-only" | "workflow-only",
"url": "<deployment or site URL, if available>",
"logsUrl": "<dashboard/inspect URL, if available>",
"final": true
}
Provider examples:
- Vercel (preview deploy):
{
"ok": true,
"action": "start",
"provider": "vercel",
"target": "preview",
"mode": "deploy",
"url": "https://my-app-abc.vercel.app",
"logsUrl": "https://vercel.com/acme/my-app/inspect/dep_123",
"final": true
}
If --deploy is used, mode becomes deploy and url is included when available.
- Cloudflare Pages (deploy):
{
"ok": true,
"action": "start",
"provider": "cloudflare",
"target": "preview",
"mode": "deploy",
"url": "https://my-app.pages.dev",
"logsUrl": "https://dash.cloudflare.com/?to=/:account/pages/view/my-app",
"final": true
}
- GitHub Pages (Actions workflow-only):
{
"ok": true,
"action": "start",
"provider": "github",
"target": "prod",
"mode": "workflow-only",
"workflowPath": ".github/workflows/deploy-pages.yml",
"actionsUrl": "https://github.com/<owner>/<repo>/actions/workflows/deploy-pages.yml",
"final": true
}
detect
Detect a Next.js app and its configuration.
Usage:
opd detect [--json]
Output fields:
- framework, rootDir, appDir, hasAppRouter
- packageManager (pnpm | yarn | npm | bun)
- monorepo (turborepo | nx | workspaces | none)
- buildCommand, outputDir, environmentFiles
Notes:
- With
--json, only JSON is printed.
doctor
Validate local environment and provider CLIs.
Usage:
opd doctor [--ci] [--json] [--verbose] [--fix] [--path <dir>] [--project <vercelProjectId>] [--org <orgId>]
Checks:
- Node version
- pnpm, bun, vercel CLIs
- Auth for Vercel
- Monorepo sanity (workspace lockfile,
.vercel/project.json, optional rootvercel.json) - Monorepo linked apps scan (
apps/*) and chosen deploy cwd advisories for common paths (e.g.,apps/web).
Notes:
- With
--json, only JSON is printed.--ciexits non‑zero if any check fails. - With
--fix, the CLI attempts best‑effort linking fixes:- Vercel:
vercel link --yes --project <id> [--org <id>]when--projectis provided
- Vercel:
completion
Generate shell completion scripts for bash, zsh, or PowerShell.
Usage:
opd completion --shell <bash|zsh|pwsh>
Install (user-local examples):
- Bash (Linux/macOS):
# macOS (Homebrew bash-completion):
opd completion --shell bash > $(brew --prefix)/etc/bash_completion.d/opd
# Generic (user):
opd completion --shell bash > ~/.opd-completion.bash
echo 'source ~/.opd-completion.bash' >> ~/.bashrc
- Zsh:
opd completion --shell zsh > ~/.opd-completion.zsh
echo 'fpath=(~/.zfunc $fpath)' >> ~/.zshrc
mkdir -p ~/.zfunc
mv ~/.opd-completion.zsh ~/.zfunc/_opd
echo 'autoload -U compinit && compinit' >> ~/.zshrc
- PowerShell (Windows/macOS/Linux):
opd completion --shell pwsh | Out-File -FilePath $PROFILE -Append -Encoding utf8
# Restart PowerShell
ci logs
Show or follow GitHub Actions logs for the latest run on the current branch. Prints direct run URLs and emits GitHub annotations on failures.
Usage:
opd ci logs [--workflow <file>] [--follow] [--json]
Behavior:
- Auto-detects repository from
GITHUB_REPOSITORYorgit remote get-url origin. - Auto-detects branch from
GITHUB_HEAD_REF/GITHUB_REF_NAME, or falls back to the current Git branch; if detached, uses the origin default branch. - Prints the direct run URL, e.g.
https://github.com/<owner>/<repo>/actions/runs/<id>. - With
--follow, tails the latest run until completion and exits non‑zero on failure. - On failures, prints
::error ::CI run failed: <url>to enable GitHub Annotations in Actions.
Examples:
# Show latest run for the default workflow (ci.yml)
opd ci logs
# Follow the latest run until completion
opd ci logs --follow
# Use a specific workflow file name
opd ci logs --workflow deploy-pages.yml
# JSON summary (machine‑readable)
opd ci logs --json
Notes:
- Requires GitHub CLI (
gh); install on Windows viawinget install GitHub.cli. - In
--jsonmode, the final object includes{ ok, repo, branch, workflow, id, url, status, conclusion, final: true }.
ci open
Open the most recent GitHub Actions run in your default browser. You can scope to a PR or a workflow file.
Usage:
opd ci open [--workflow <file>] [--pr <number>] [--json]
Behavior:
- Resolves repo automatically; optionally resolves branch from a PR number.
- Opens the URL using the OS default opener (
starton Windows,openon macOS,xdg-openon Linux). - In
--jsonmode, prints{ ok, repo, branch?, workflow?, id, url, status, conclusion, final: true }.
Examples:
opd ci open
opd ci open --pr 42
opd ci open --workflow ci.yml
ci dispatch
Trigger a workflow run. Safeguarded—requires --yes.
Usage:
opd ci dispatch --workflow <file> [--ref <ref>] [--inputs k=v,...] [--yes] [--json]
Behavior:
- Requires GitHub CLI (
gh). - Refuses to run unless
--yesis present to prevent accidental triggers. --inputsaccepts comma-separatedkey=valuepairs and passes them via--raw-fieldtogh.- In
--jsonmode, prints{ ok, repo, workflow, ref, final: true }.
Examples:
opd ci dispatch --workflow ci.yml --yes
opd ci dispatch --workflow deploy-docs.yml --ref main --inputs site=docs,region=us --yes
ci last
Show the most recent GitHub Actions run across any branch. Optionally scope to a PR (by head branch) or a specific workflow.
Usage:
opd ci last [--workflow <file>] [--pr <number>] [--json]
Notes:
- Prints the direct run URL and a compact JSON summary in
--jsonmode.
ci summarize
Produce a compact summary of the latest run for a workflow, including failing jobs and short error excerpts. Ensures the latest run summary and job logs are synced locally for IDE inspection.
Usage:
opd ci summarize [--workflow <file>] [--out <dir>] [--pr <number>] [--json]
Notes:
- Logs are stored under
./.artifacts/ci-logs/<workflow>/<runId>/. - VSCode task: "CI: Summarize latest (ci.yml)" is included in
.vscode/tasks.json.
ci sync
Download the latest run summary and per-job logs for a workflow into a local directory for IDE debugging.
Usage:
opd ci sync [--workflow <file>] [--out <dir>] [--follow] [--pr <number>] [--json]
Notes:
- With
--follow, re-syncs until the run completes. - Output directory defaults to
./.artifacts/ci-logs.