---
name: vibiz-deploy
description: Create a Vibiz Stack project and deploy it - vibiz init, the development env for local work, deploy to <slug>.vibiz.app, previews, promote and instant rollback, run the app on another host with one key, or export it (code, database, env guide) to take it elsewhere. Use when an app should go live on Vibiz or a Vibiz project needs a new deployment or a rollback.
---

# Vibiz deploy

**Connect first.** Not logged in (a tool answers `unauthorized` with `reason: not_logged_in`, or the CLI says "Not logged in")? Run `npx @vibiz/cli login`: show the person the link it prints and ask them to click Authorize (their account is opened on the way if they have none), then go on. Or connect the remote MCP server, nothing to install: `claude mcp add --transport http vibiz https://app.vibiz.app/mcp` (the client opens the same sign-in on first use). Never ask the person to paste a key into the chat. **Keep the CLI current:** a command named here that your `vibiz` doesn't have (an unknown-command or usage error) means the CLI is out of date, not that Vibiz can't do it: run `npm install -g @vibiz/cli@latest` (or `npx -y @vibiz/cli@latest <command>`) and retry, and refresh these skills with `vibiz skills add --global`. Never tell the person something isn't possible because an old CLI lacks the command.

## Start a project

- New folder: `vibiz_create_project { name, resources? }` (or `vibiz init "<name>"`, `--template nextjs-saas` for the starter app). Default resources: hosting, database, auth (sign-in), analytics; `email`, `ai`, `replay` are opt-in. The tool waits until resources are ready.
- **Analytics comes with session replay.** Unless the person said no to recordings, ask for replay too: `vibiz init "<name>" --resources hosting,database,auth,analytics,replay` or `vibiz_create_project { name, resources: ["hosting","database","auth","analytics","replay"] }` (on an existing project: `vibiz add replay` / `vibiz_add_resources { project_id, resources: ["replay"] }`). Recording starts only after the visitor consents (the `nextjs-saas` template shows the banner by itself). Tell the person replays are on and give them the link to watch them (`console_url` from `vibiz_replay_insights`). The vibiz-analytics skill has the details.
- `./vibiz.json` then holds the project id: read it, don't ask for it.
- Building the UI: if the person named a site they like or has a site of their own, run `vibiz design <url> --tailwind` first and build to the brief it writes (the vibiz-design skill). A reference is a pattern: keep their own colors, logo and copy.
- Limits: 10 projects per account and 30 builds per project per UTC day (both `rate_limited`; a build's carries `details.resets_at`). Check `vibiz_usage` before many builds.

## Work locally

`vibiz_dev_env { project_id, write_to: "<app>/.env.development.local" }` (an absolute path; or `vibiz dev`): its own database branch with no production rows, its own sign-in (trusts http://localhost:3000) and AI key. Values are written, not shown: never print them. `vibiz dev -- npm run dev` passes them to one command without a file; `vibiz dev --reset` (`reset: true`) throws the copy away.

## Deploy

- `vibiz_deploy { project_id, path, target? }` (or `vibiz deploy [dir]`). On the remote MCP server it can't read your folder and answers with the command to run instead: `npx @vibiz/cli deploy --project <id>`. Production is the default; pass `target: "preview"` (`--preview`) for a separate URL to check first, then `vibiz_promote`.
- The CLI never uploads `node_modules`, `.git`, `.next`, `dist`, `.vercel`, `.turbo`, `vibiz.json`, `.env*` or key and credential files, and refuses a home or config folder. Deploy the app's own folder. At most 10,000 files, 50 MB each.
- No `hosting` resource: the deploy answers `dependency_not_ready`. Add it (`vibiz add hosting`) only if the app is moving to Vibiz.
- A failed build comes back as `deployment_failed` with the build's `error`: read it, fix, deploy again.
- Something broke live? `vibiz_rollback { project_id }` (or `vibiz rollback`) switches back to the previous production deployment instantly; `deployment_id` picks an earlier one. `vibiz_project_status { project_id }` lists the deployments and which one is live.

## Their own domain

The app always keeps `<slug>.vibiz.app`. To also serve it at a domain the business owns, run `vibiz domains add shop.example.com` (an agent key may: analytics counts it at once, and sign-in trusts it once proven, `trusted_for_sign_in`: if you can edit its DNS, add the TXT record in `trust_record` and run `vibiz domains verify <domain>`; otherwise the owner confirms it in the console. A domain bought through Vibiz is trusted at once). `vibiz_domains` (or `vibiz domains`) shows each domain's `status` and the exact `records_to_set` (type, name, value) to add where they bought the domain; show those to the person as they are. `pending_dns` → they add the records; `verifying` → wait a few minutes; `active` → live with HTTPS, which turns on by itself. `vibiz_domains { project_id, action: "verify", domain }` checks again now. Adding `example.com` also brings `www.example.com` as a redirect. At most 10 domains per project; one used by another project answers `409 domain_taken`. Removing a domain is the owner's (`owner_only`).

## Buying a domain

Every app gets `<slug>.vibiz.app` for free; only when they want a name of their own, buy one. `vibiz_buy_domain { action: "search", query: "sellshelf" }` (or `vibiz domains search sellshelf`) lists available names with `price_cents` (the full first-year price, USD) and `renewal_price_cents` a year: show them the options and prices. Then `quote` the one they pick with `project_id`, tell them the price and the balance after. If the quote's `can_buy` is true (the owner lets agents buy domains up to a price, in Billing), buy it once they say yes (`action: "buy"` with `expected_price_cents` from the quote); otherwise send the owner its `buy_url` (paid from the account's credits, registered to their saved owner details, live on the app within a minute or two, HTTPS by itself, no DNS to set). Short of credits (`enough_credits: false`), give them the Billing link in `next_step`. Never make up the owner's name, address or phone: if the quote says the owner details are missing, the owner fills them in at `buy_url`. `vibiz_buy_domain { action: "owned" }` lists what the account bought. Renewals come from credits by themselves about 30 days before expiry (auto-renew). Turning auto-renew off (`vibiz domains auto-renew <domain> off`), renewing early (`vibiz domains renew <domain>`), the transfer code (`vibiz domains transfer-code <domain>`) and the owner details (`vibiz domains owner`) are the owner's: tell them the command. A new domain's owner must confirm their contact details within 15 days (an email from Vibiz with a console link). See `references/domains.md`.

## Another host

**An app already live elsewhere** (Vercel, Netlify, its own server…): ask where it's live (or read `.vercel/project.json`, `vercel.json`, the README) before anything, and create the project with that domain (`vibiz init <name> --resources … --domain yourapp.com`, no `hosting`). Don't add hosting to an app that isn't moving to Vibiz: sign-in, analytics and payment webhooks then point at its real domain, not `<slug>.vibiz.app` where nothing answers.

The project doesn't need Vibiz hosting, and any one service works alone: `vibiz init <name> --resources auth` (or `email`, `ai`, `analytics`, `database`, or `none` for payments, files, web data, social, company and connectors). Add the domain with `vibiz domains add <domain> --elsewhere` (`vibiz_domains { action: "add", elsewhere: true }`; an agent key may, sign-in then waits for its TXT record or the owner). The host gets the env one of two ways: the owner connects it once (`vibiz hosts add <host> <app>`, owner key: vercel, netlify, render, railway, fly, heroku, cloudflare-workers, cloudflare-pages, github-actions) and Vibiz keeps it in sync, or the host holds only `VIBIZ_APP_KEY` and the app calls `await vibiz.loadEnv()` at boot. `vibiz_hosts { project_id }` shows connected hosts; `sync: true` pushes again (after adding a resource). `vibiz connect` in the folder says which way fits. Buying a domain needs Vibiz hosting (`hosting_required`): for another host, they buy it anywhere and connect it with `--elsewhere`. The vibiz-use-one skill has every service's steps.

## Export: taking the app elsewhere, or a backup

`vibiz_export { project_id }` (or `vibiz export`) packs the live deployment's source with `VIBIZ-EXPORT.md` (what it uses, running it locally, hosting it anywhere with one key, or moving everything) and `.env.example` (names, never values), plus the database as SQL that `psql` restores. `include` replaces that default: `["code", "database", "database_csv", "env_guide"]` adds each table as CSV. It waits by default; `vibiz_export { project_id, action: "status" }` checks a running one. Give the person the `files[].url` links (they work for a day, no key) or `console_url`. You get development by default (its database has the tables, no production rows); the production database answers `owner_only`, and secret values are never given to agents: the owner downloads the `.env` from the console's Export page. One export at a time, 10 a day per project; the code needs a deployment on Vibiz.

## Images and files the app serves

A logo or product photo: `vibiz files upload <path>` prints its permanent link. Generated images, video and audio are saved in the project's Files by themselves. The vibiz-files and vibiz-ai skills have the details.

## Never

- Never read or paste the production env; agents get names only (`vibiz_project_env`).
- Don't delete a project (`vibiz_delete_project`) to "start over" without the user's say-so: its site goes offline at once (data kept 7 days, `vibiz_restore_project` undoes it). A project holding live payment money, with a withdrawal on its way or a subscription still charging can't be deleted (`409`, `reason: payments_held`).

**Console links**: projects and deployments come back with `console_url`. Give the user that link to see the project or one deploy in the web console. `vibiz_docs console-urls` lists every page and its parameters.

## References

- `references/hosting.md`, `references/quickstart.md`, `references/keys.md`.
