ViteHub is still experimental. Expect bugs and breaking changes.

Provisioning

Create missing provider resources and write non-secret provider ids into local provision state.

Provision is the ViteHub CLI workflow that creates missing provider resources required by app Definitions. Provision Steps are package-contributed, idempotent, and create-only; they never delete or mutate existing resources.

Preview the plan

Run a dry run first. The CLI loads the Vite config, collects Provision Steps from active package integrations, and prints the actions for one provider.

Terminal
pnpm vitehub provision run --provider cloudflare --dry-run
pnpm vitehub provision run --provider vercel --dry-run

The output labels each action as exists or create. A dry run does not call apply() and does not write Provision State.

Output
create  d1-database  app-content
exists  r2-bucket    uploads

Apply the plan

Set provider credentials only when you want the CLI to apply actions. Cloudflare and Vercel use different credential sets.

Terminal
CLOUDFLARE_ACCOUNT_ID=... CLOUDFLARE_API_TOKEN=... pnpm vitehub provision run --provider cloudflare
VERCEL_TOKEN=... VERCEL_TEAM_ID=... pnpm vitehub provision run --provider vercel

After a successful apply, the CLI writes non-secret ids to .vitehub/provision.json. Vite Integrations may read that file as a binding-id source during dev or build.

.vitehub/provision.json
{
  "cloudflare": {
    "d1": {
      "default": "database-id"
    }
  }
}

Resource ownership

OwnerResponsibility
ViteHub CLILoads Vite config, collects Provision Steps, validates provider credentials, and writes Provision State.
Primitive packagePlans and applies resources for the primitive it owns.
ProviderOwns cloud resources, credentials, and existing-resource lookup behavior.
Vite IntegrationReads Provision State when generated Provider Output needs resource ids.

Production boundary

Provision is not a build step. Builds may read Provision State, but they must not create provider resources.

Do not commit .vitehub/provision.json unless a project deliberately decides that non-secret provider ids belong in source control. The root repository ignores .vitehub/** by default.

Next steps

Copyright © 2026