Every stitchdb command and its options.
Run stitchdb <command> --help for all options. Global options: --project-ref <ref>, --workdir <dir>, --json, -y/--yes, --debug.
#Account and projects
| Command | Description |
|---|
login [--token <token>] [--no-browser] | Store an access token |
logout | Remove the stored token |
projects list | Projects you can access |
projects api-keys | API URL and keys |
init [--github] [--force] | Create stitchdb/ (and the GitHub workflow) |
link --project-ref <ref> | Link this folder to a project |
unlink | Forget the linked project |
#Local development
| Command | Description |
|---|
start [-x services] [--ignore-health-check] | Start the local stack |
stop [--no-backup] | Stop it (and delete the data) |
status | Services, URLs and keys |
#Database and migrations
| Command | Description |
|---|
migration new <name> [--stdin] | New migration file |
migration list [--local] | Files vs database |
migration up | Apply to the local database |
migration repair <version> --status applied|reverted [--local] | Fix the history |
db push [--dry-run] | Apply pending migrations to the project |
db pull [name] | Bring remote changes into migration files |
db diff [--linked] [-f name] [-s schemas] | Schema changes not in migrations |
db reset | Rebuild the local database |
db dump [-f file] [--data-only] [-s schemas] [--local] | SQL dump |
db query "<sql>" [-f file] [--local] [--read-only] | Run SQL |
gen types typescript|dart|swift|kotlin [--local|--linked|--project-ref ref] [-s schemas] [-o file] [--watch] | Types for the SDKs |
types [--lang l] --watch -o file | Rewrite a types file on every schema change |
#Edge Functions and secrets
| Command | Description |
|---|
functions new <name> | New function |
functions serve | Run locally with live reload |
functions deploy [names] [--all] [--no-verify-jwt] [--if-present] | Deploy |
functions list | Deployed functions |
functions download <name> | Download deployed code |
functions delete <name> | Delete |
secrets list | Secret names and digests |
secrets set NAME=value … | --env-file <file> | Set secrets |
secrets unset NAME … | Remove secrets |
#Preview branches
| Command | Description |
|---|
branches list | Branches of the linked project |
branches create <name> [--wait] [--no-seed] | New branch (idempotent) |
branches get <name> | Status, URL and keys |
branches switch <name|main> | Point remote commands at a branch |
branches merge <name> [--dry-run] [--delete] | Apply its migrations to production |
branches delete <name> [--if-exists] | Delete |
#Dashboard features
These commands manage the same features as the dashboard, through the Management API. They work on the linked project (or --project-ref, or a ref as the first argument). Commands that restore, delete, change the size or cost money ask first; pass --yes in scripts. Add --json to get the full answer. With a read-only token you can run the commands that only read. Organization tokens need the scopes listed in the API reference. Bodies can come from --file <json> or from key=value pairs (dots reach nested fields, for example limits.egress_gb=100).
#Restart
| Command | Description |
|---|
projects restart [ref] [--yes] | Restart the project's Auth and REST services |
#Backups
| Command | Description |
|---|
backups list [ref] | Backups of a project, the plan's retention and the point-in-time window |
backups create [ref] | Start a manual backup now (one per hour) |
backups restore [ref] <backup id> [--yes] | Restore a backup (the current state is backed up first, so it can be undone) |
backups download [ref] <backup id> [--files] | A signed download link of a backup (prints the URL) |
backups export [ref] | A signed link that streams a fresh dump of the current data (prints the URL) |
backups pitr [ref] | Point-in-time recovery: the window you can restore to |
backups restore-time [ref] <ISO time> [--branch <name>] [--yes] | Restore to a point in time (or into a new preview branch with --branch) |
backups jobs [ref] [job id] | Restore and backup jobs with their progress (or one job) |
backups restore-table [ref] <schema.table> --time <ISO time> [--mode copy|replace|merge] [--where <sql>] [--yes] | Restore one table or some rows to a point in time |
#Compute
| Command | Description |
|---|
compute get [ref] | Compute size: the current size, where it can move and any dedicated server |
compute sizes [ref] [--location <name>] [--kind cloud|auction|large] [--need-gb <n>] | Compute sizes with their size_key and price |
compute estimate [ref] <size_key> | What a compute size costs (changes nothing) |
compute set [ref] <size_key> [--yes] | Change the compute size (billed from the prepaid balance) |
#Replicas
| Command | Description |
|---|
replicas list [ref] | Read replicas with their connection details, price and failover state |
replicas add [ref] [--yes] | Add a read replica (billed hourly from the prepaid balance) |
replicas remove [ref] <node id> [--yes] | Remove a read replica |
replicas auto get [ref] | Automatic read replicas: settings, running replicas and cost |
replicas auto set [ref] [key=value]... [--file settings.json] | Change the automatic read replica settings |
#Budget
| Command | Description |
|---|
budget get [ref] | Budget of the project: limits per resource, alerts and what stops at the limit |
budget set [ref] [key=value]... [--file budget.json] | Set the budget (from a JSON file or key=value fields) |
budget delete [ref] [--yes] | Remove the budget |
budget test [ref] | Send a test budget alert |
#Export
| Command | Description |
|---|
export list [ref] | Full exports and imports with their download / upload links |
export start [ref] | Start a full export (database, Storage files, functions and settings) |
export import [ref] | Start a full import: prints the upload link for an export archive |
export restore [ref] <import id> [--no-functions] [--no-settings] [--yes] | Restore an uploaded export archive into this project (organization owner) |
export delete [ref] <id> [--yes] | Delete an export or import |
#Feature flags
| Command | Description |
|---|
flags status [ref] | Feature flags: state, flags and segments |
flags on [ref] | Turn feature flags on |
flags off [ref] [--yes] | Turn feature flags off |
flags create [ref] <key> [--type boolean|string|number|json] [--description <text>] [--enabled] [--file flag.json] [key=value]... | Create a feature flag |
flags update [ref] <key> [--enabled | --no-enabled] [--description <text>] [--file flag.json] [key=value]... | Change a flag (rules, rollout, variations, enabled) |
flags delete [ref] <key> [--yes] | Delete a flag |
flags stats [ref] <key> | How often a flag was evaluated per variation (30 days) |
flags segments create [ref] <key> [--name <name>] [--file segment.json] [key=value]... | Create a segment (users by id or by conditions) |
flags segments update [ref] <key> [--name <name>] [--file segment.json] [key=value]... | Change a segment |
flags segments delete [ref] <key> [--yes] | Delete a segment |
flags history [ref] [--key <key>] [--kind flag|segment] [--limit 50] [--before <id>] | Change history of flags and segments |
flags restore [ref] <history id> [--side before|after] | Restore a flag as it was after (or before) a change |
flags test [ref] [--file ctx.json] [--user <id|email>] [--attr key=value]... | Evaluate every flag for a test context (changes nothing) |
#Rate limits
| Command | Description |
|---|
rate-limits get [ref] | Rate limit rules and recent blocks |
rate-limits set [ref] --file rules.json | Replace the rate limit rules (from a JSON file) |
rate-limits sql install [ref] | Install the SQL rate-limit function in the database |
rate-limits sql remove [ref] [--yes] | Remove the SQL rate-limit function |
#Inbound webhooks
| Command | Description |
|---|
inbound status [ref] | Inbound webhooks: state and endpoints |
inbound on [ref] | Turn inbound webhooks on |
inbound off [ref] [--yes] | Turn inbound webhooks off |
inbound endpoints create [ref] --provider <name> [--name] [--secret <s>] [--function <fn>] [--slug <slug>] [--file endpoint.json] | Add an endpoint (provider, signing secret, handler) |
inbound endpoints update [ref] <endpoint> [--name] [--secret] [--function] [--enabled | --no-enabled] [--keep-days n] [--file endpoint.json] | Change an endpoint |
inbound endpoints delete [ref] <endpoint> [--events] [--yes] | Delete an endpoint (--events also deletes its events) |
inbound endpoints test [ref] <endpoint> [--payload <json file>] | Send a test event to an endpoint |
inbound events list [ref] [--endpoint <slug>] [--status <status>] [--search <text>] [--limit 50] [--before <id>] | Received events, newest first |
inbound events get [ref] <event id> | One event with its payload |
inbound events redeliver [ref] <event id> | Process an event again |
inbound events delete [ref] <event id> [--yes] | Delete an event |
#Status page
| Command | Description |
|---|
status-page get [ref] | Status page: state, settings, components and incidents |
status-page on [ref] | Turn the status page on |
status-page off [ref] [--yes] | Turn the status page off |
status-page set [ref] --file <json> | key=value... | Change the page (title, components, checks, notifications) from JSON |
status-page incidents create [ref] --title <text> --message <text> [--impact minor] [--status investigating] [--components api,db] | Post an incident or scheduled maintenance |
status-page incidents update [ref] <incident id> [--status <status>] [--message <text>] [--title] [--impact] [--components] | Add an update to an incident or change it |
status-page incidents delete [ref] <incident id> [--yes] | Delete an incident |
status-page incidents edit-update [ref] <incident id> <update index> --message <text> | --delete [--yes] | Edit (or delete) one update of an incident |
status-page subscribers list [ref] | E-mail subscribers of the status page |
status-page subscribers remove [ref] <subscriber id> [--yes] | Remove a subscriber |
#Cron
| Command | Description |
|---|
cron list [ref] | Scheduled jobs (pg_cron) and their last run |
cron runs [ref] [--job <id>] | Recent runs of the scheduled jobs (newest first) |
cron create [ref] <name> --schedule <cron> --command <sql> [--inactive] | Schedule a job (pg_cron) |
cron update [ref] <job id> [--schedule <cron>] [--command <sql>] [--active | --no-active] | Change a job (schedule, command, active) |
cron delete [ref] <job id> [--yes] | Unschedule a job |
#Queues
| Command | Description |
|---|
queues list [ref] | Queues (pgmq) with their length and age |
queues create [ref] <name> [--type standard|unlogged] | Create a queue |
queues delete [ref] <name> [--yes] | Delete a queue and its messages |
queues messages [ref] <name> [--archived] | Messages of a queue (newest 100; --archived for the archive) |
queues send [ref] <name> <json> [--delay <seconds>] | Send a message (JSON) to a queue |
queues read [ref] <name> [--qty 1] [--vt 30] | Read messages (they stay invisible for --vt seconds) |
queues archive [ref] <name> <message id> | Move a message to the queue's archive |
queues delete-message [ref] <name> <message id> [--yes] | Delete a message |
#Push notifications
| Command | Description |
|---|
push settings [ref] | Push credentials on file (never the keys), devices and recent messages |
push configure [ref] --ios-p8 <file> --key-id <id> --team-id <id> --bundle-id <id> [--sandbox] | --android-service-account <file> | --remove-ios | --remove-android | Set the APNs (.p8) or FCM credentials |
push test [ref] <user id> [--title <text>] [--body <text>] | Send a test notification to a user |
push disable [ref] [--yes] | Turn push notifications off and remove the credentials |
#Purchases
| Command | Description |
|---|
purchases settings [ref] | In-app purchases: store credentials on file (never the keys), products, webhooks, deliveries |
purchases configure [ref] --file <json> | key=value... | Set the App Store / Google Play credentials, products and webhooks (JSON) |
purchases webhook-test [ref] <webhook id> | Send a test event to a purchase webhook |
purchases retry [ref] <delivery id> | Deliver a failed purchase webhook again |
purchases disable [ref] [--yes] | Turn in-app purchases off and remove the credentials |
#Deep links
| Command | Description |
|---|
links status [ref] | Deep links and short links: state and settings |
links on [ref] | Turn links on |
links off [ref] [--yes] | Turn links off |
links settings set [ref] --file <json> | key=value... | Change the link settings (apps, app stores, fallback, domain) from JSON |
links list [ref] [--search <text>] [--limit 50] [--offset 0] | Short links |
links create [ref] --path <path> [--code <code>] [--data <json>] [--expires-at <ISO>] | Create a short link |
links get [ref] <code> [--days 30] | One link with its click statistics |
links update [ref] <code> [--path] [--data <json>] [--expires-at <ISO>|none] [--disabled | --no-disabled] | Change a link |
links delete [ref] <code> [--yes] | Delete a link |
#Usage metering
| Command | Description |
|---|
metering status [ref] | Usage metering: state, meters, alerts and the Stripe push |
metering on [ref] | Turn usage metering on |
metering off [ref] [--yes] | Turn usage metering off |
metering settings set [ref] --file <json> | key=value... | Change meters, plans and alerts (JSON) |
metering stripe set [ref] --file <json> | key=value... | Set the Stripe push (secret key, meters) from JSON |
metering stripe customers [ref] [set <customer>=<cus_id|null>... | set --file customers.json] [--search <text>] [--limit 50] | End customers and their Stripe customer ids (set <customer>=<cus_…> to link) |
metering stripe retry [ref] | Push failed usage to Stripe again |
#Job monitoring
| Command | Description |
|---|
monitors setup [ref] | Job monitoring: state, alert settings and monitors |
monitors on [ref] | Turn job monitoring on |
monitors off [ref] [--yes] | Turn job monitoring off |
monitors alerts set [ref] --file <json> | key=value... | Change the job monitoring alerts (e-mail, webhook, Slack) from JSON |
monitors create [ref] <name> [--kind ping|cron|job] [--schedule <cron> | --every 1h] [--grace 5m] [--target <job>] | Add a monitor (ping URL, pg_cron job or background job) |
monitors update [ref] <monitor id> [--name] [--schedule | --every] [--grace] [--paused | --no-paused] | Change a monitor |
monitors delete [ref] <monitor id> [--yes] | Delete a monitor |
monitors rotate [ref] <monitor id> [--yes] | A new ping URL for a monitor (the old one stops working) |
monitors test-alert [ref] | Send a test job monitoring alert |
#Crash reporting
| Command | Description |
|---|
crashes settings [ref] | Crash reporting: state and alert settings |
crashes on [ref] | Turn crash reporting on |
crashes off [ref] [--yes] | Turn crash reporting off |
crashes alerts set [ref] --file <json> | key=value... | Change the crash alerts (new issue, regression, spike; e-mail, webhook, Slack) from JSON |
crashes test-alert [ref] | Send a test crash alert |
#SAML SSO providers
| Command | Description |
|---|
auth sso list [ref] | SAML SSO providers |
auth sso add [ref] --metadata-url <url> | --metadata-file <xml> --domain <a.com>... [--attribute-mapping <json>] | Add a SAML SSO provider (turn SAML on in the Auth settings first) |
auth sso update [ref] <provider id> [--metadata-url <url> | --metadata-file <xml>] [--domain <a.com>]... [--attribute-mapping <json>] | Change a SAML SSO provider |
auth sso remove [ref] <provider id> [--yes] | Remove a SAML SSO provider |
#Recycle bin
| Command | Description |
|---|
recycle-bin list [ref] [--table <schema.table>] [--limit 50] | Deleted rows kept by the recycle bin and the tables it covers |
recycle-bin enable [ref] <schema.table> | Turn the recycle bin on for a table |
recycle-bin disable [ref] <schema.table> [--yes] | Turn the recycle bin off for a table |
recycle-bin restore [ref] <id>... | Restore deleted rows |
recycle-bin purge [ref] <id>... [--yes] | Delete rows from the bin for good |
#Change history
| Command | Description |
|---|
history list [ref] [--table <schema.table>] [--pk <primary key>] [--limit 50] [--before <id>] | Row changes and the tables that keep a history |
history enable [ref] <schema.table> | Turn the change history on for a table |
history disable [ref] <schema.table> [--yes] | Turn the change history off for a table |
history revert [ref] <change id> [--yes] | Revert one change |
#Shared views
| Command | Description |
|---|
shared-views list [ref] | Shared table views (read-only links for people without dashboard access) |
shared-views create [ref] --name <name> --table <table> --columns <a,b> [--editable <a,b>] [--filters <json>] [--file view.json] | Create a shared view of a table |
shared-views get [ref] <view id> | One shared view with its members |
shared-views update [ref] <view id> [--name] [--columns] [--editable] [--filters <json>] [--disabled | --no-disabled] [key=value]... | Change a shared view |
shared-views delete [ref] <view id> [--yes] | Delete a shared view |
shared-views members add [ref] <view id> <email>... [--no-send] | Give people access to a shared view by e-mail |
shared-views members remove [ref] <view id> <email> [--yes] | Remove a person from a shared view |
shared-views audit [ref] <view id> [--limit 100] [--before <id>] | Who opened or changed the view and when |
#Cloudflare
| Command | Description |
|---|
cloudflare list [ref] | Cloudflare Workers and Pages projects linked to this project (variable sync) |
cloudflare browse [ref] [--token <token>] [--account <id>] | Accounts, Workers and Pages projects a Cloudflare token can reach |
cloudflare link [ref] <worker|pages project name> [--kind worker|pages] [--account <id>] [--token <token>] [--targets production,preview] [--prefix VITE_] | Link a Cloudflare Worker or Pages project and write its variables |
cloudflare update [ref] <link id|name> [--targets <list>] [--prefix <p>] [--service-key | --no-service-key] [--database-url | --no-database-url] [--hyperdrive | --no-hyperdrive] [--token <t>] | Change a Cloudflare link (targets, prefix, variables, token) and sync |
cloudflare sync [ref] <link id|name> | Write the variables to Cloudflare again now |
cloudflare unlink [ref] <link id|name> [--remove-variables] [--yes] | Unlink a Cloudflare Worker or Pages project |
stitchdb backups restore-time 2026-11-01T12:00:00Z --branch before-incident --yes
stitchdb flags create new-checkout --type boolean --enabled
stitchdb compute sizes --json
stitchdb cloudflare link api-worker --kind worker
#Environment variables
| Variable | Use |
|---|
STITCHDB_ACCESS_TOKEN | Access token (CI); wins over stitchdb login |
STITCHDB_PROJECT_REF | Project when the folder is not linked |
STITCHDB_HOME | Where credentials and local stacks are kept (default ~/.stitchdb) |
NO_COLOR | Plain output |