CommunityArt et designgithub.com

prevu

Use when running, configuring, or debugging the Prevu CLI (`prevu` binary) - managing staging environments, exposing ports, SSH access, API tokens, signing in, listing envs, and service commands. Mentions: prevu, prevu env, prevu auth, prevu keys, prevu.cloud, app.prevu.cloud, prevu.page, PREVU_TOKEN, staging environment for coding agents.

Compatible avec~Claude Code~Codex CLI~Cursor
npx add-skill https://github.com/prevu-cloud/prevu/tree/main/skills/prevu

name: prevu description: "Use when running, configuring, or debugging the Prevu CLI (prevu binary) - managing staging environments, exposing ports, SSH access, API tokens, signing in, listing envs, and service commands. Mentions: prevu, prevu env, prevu auth, prevu keys, prevu.cloud, app.prevu.cloud, prevu.page, PREVU_TOKEN, staging environment for coding agents."

Prevu CLI

Prevu provisions a persistent Linux VM you can SSH into, expose ports from, and reach via a public URL. The prevu CLI is the supported surface (no infrastructure tools).

This skill is the reference: install, command map, output contract, exit codes, with deeper detail in references/*.md. For the multi-step user-facing workflows (mirroring local dev to a phone-reviewable preview, sharing a WIP branch), see the prevu-flows skill - load it when the user describes a scenario rather than a single command.

Install + sign in

npm install -g @prevu/cli
prevu --version              # 0.2.0+ (slug-only URLs and env exec need 0.2.0+)
prevu auth login             # paste a token from https://app.prevu.cloud/keys

Requires Node >= 20. Token is stored at ~/.prevu/config.json (mode 0600).

For CI / non-TTY:

export PREVU_TOKEN=prv_...

Resolution order: --token flag -> PREVU_TOKEN env var -> ~/.prevu/config.json.

PREVU_API_URL defaults to https://app.prevu.cloud. Override with --api-url only for self-hosted Prevu APIs.

Command map

NamespaceCommandDetail in
authlogin / logout / whoamireferences/auth.md
envlist, get, create, destroyreferences/env.md
envwaitreferences/env.md + references/lifecycle.md
envssh, ssh-command, execreferences/env.md
envurlsreferences/env.md
envservice start/list/logs/restart/stopreferences/env.md
envexpose, unexposereferences/env.md
keyslistreferences/keys.md

Run prevu <namespace> --help for inline help.

Output contract - always pass --format json when parsing

Default output is a human table; for any scripted call, pass --format json. Envelope is fixed:

// success
{ "data": { ... } }
// failure
{ "error": { "type": "auth", "message": "...", "hint": "..." } }

NO_COLOR=1 or --no-color strips ANSI in table mode. JSON is always uncolored.

Exit codes (parse these, not stderr text)

CodeTypeWhat it means
0successcontinue
1genericprint and bail
2usagebad flags - fix and retry
3authtell the user to run prevu auth login
4not_foundenv/key doesn't exist; create or pick another
5conflictalready exists / wrong status - usually benign
6rate_limitback off >=30s and retry
7servertransient; retry once
8timeoutenv wait ran out - open the dashboard

Idiomatic recovery sketch:

prevu env get my-project --format json >/dev/null 2>&1
case $? in
  0) ;;                                    # exists
  4) prevu env create my-project --format json ;;
  3) echo "Run \`prevu auth login\`" >&2; exit 1 ;;
  *) exit 1 ;;
esac

Hard rules - please don't break these

  1. Envs are persistent paid products. Reuse them deliberately; never auto-destroy on TTL or end-of-session.
  2. One env per project, not per task. Reuse the same slug across sessions; the user comes back to the same workspace.
  3. Use HTTPS exposure for browser previews (default). TCP mode is for non-HTTP services like Postgres.
  4. Print public URLs prominently. The user is often on their phone; don't bury the URL in shell output.
  5. Use env service for long-running app processes. Don't hand-write nohup, PID files, or broad pkill -f commands.
  6. The CLI/API is the only supported surface. Don't try to infrastructure tools at it.

When to load deeper detail

  • references/auth.md - sign-in flows, where the token lives, recovering from exit code 3.
  • references/env.md - every env subcommand with inputs, examples, and the SSH-key resolution rules.
  • references/keys.md - saved SSH key model, dedup, when --ssh-key-id saves keystrokes.
  • references/lifecycle.md - status state machine, when wait returns, and destructive-action guidance.
  • references/troubleshooting.md - concrete failure modes and their fixes.

When NOT to load this skill

  • Pure local file edits or read-only repo work - Prevu is for running code remotely.
  • Production deploys / CI - Prevu is staging.
  • Anything where the user explicitly said "stay on my laptop."

Workflow scenarios live in prevu-flows

If the user asks for mirror my dev to my phone, let me preview from mobile, share this branch as a URL, I'm AFK keep coding - load the prevu-flows skill instead of (or in addition to) this one. Those flows wire the commands here into a multi-step loop with the right defaults.

Skills associés