Prebit Developer Docs

CLI

The prebit developer CLI — create, login, dev, build, publish.

The Prebit developer CLI, built around the actual developer journey:

create → login → dev → build → publish

Install

npm install -g @prebit/cli

The package is scoped (@prebit/cli), but the command it installs is plain prebit — set by the package's own bin field, independent of the package name (same pattern as @angular/cli installing ng).

Commands

prebit create <name>

Clones the official starter (prebit-app-template-next) into <name>/.

prebit login [--token <t>]

Not the same credential as an OAuth access token

This is a personal CLI token (prcli_...), generated from the Developer Portal's /developers/settings/tokens page. It authenticates you, a developer, to management routes (submitting releases, tailing webhook deliveries) — not an installation's OAuth access token. See Authentication.

Verifies the token and stores it at ~/.prebit/credentials.json. Every other command below resolves credentials in this order: --token flag > PREBIT_TOKEN env var > the stored file.

prebit dev [--port 3000]

Prints the redirect/webhook URLs to register, opens a cloudflared tunnel if installed (manual instructions otherwise), and tails webhook deliveries if .prebitrc.json has an org/app configured.

prebit build [dir]

Parses prebit.app.toml and runs the same Review System scan the server runs, locally — stages a submission-ready dist/.

prebit publish [dir]

Re-runs build's checks, then submits to the real release endpoint (POST /api/developer/orgs/{orgId}/apps/{appId}/releases).

prebit validate <manifest> [assetsDir]

Same parse+scan as build, without staging dist/ — useful in CI.

prebit logout / prebit whoami

Clear or inspect the stored credential.

prebit webhook listen

Tails real webhook delivery attempts (status/attempts/last error) for your app — read-only. It never replays or re-signs a payload; doing so would require exposing your installation's webhook secret over a dev-facing endpoint, which this deliberately doesn't do.

prebit deploy

Not applicable — your app's own backend deploys itself (Vercel/Railway/ your own host). Prints an explanation.

Project config — .prebitrc.json

{ "orgId": "...", "appId": "...", "baseUrl": "https://admin.prebit.in" }

Put this in your app's root so build/publish/webhook listen don't need --org/--app on every call.

Roadmap (not built yet)

prebit doctor, prebit version, prebit update, and prebit init (add Prebit to an existing Next.js app, distinct from create's full scaffold) are planned but not built — see prebit-cli/ROADMAP.md.

On this page