CLI Commands

Full reference for all Koolbase CLI commands.

Scaffolding

koolbase create <app_name>

Create a Flutter app wired to your Koolbase project — opinionated architecture, authentication generated, running in about two minutes. See Scaffolding for what it produces.

--projectKoolbase project ID (skips the picker)
--flavorsgenerate dev/staging/prod entrypoints
--templateinclude a template, e.g. chat or [email protected]
--skip-pub-getdo not run flutter pub get afterwards
koolbase create my_app
koolbase create my_app --flavors --template chat
koolbase add <template>

Install a template into an existing Flutter project. Reads your package name and Koolbase project from the app itself. Existing files are listed and refused rather than overwritten.

--forceoverwrite existing files
--projectKoolbase project ID (when the app has no generated config)
--dirthe Flutter project to add to (default .)
koolbase add chat
koolbase add [email protected] --force

Auth

koolbase login

Authenticate with your Koolbase account. Opens your browser to sign in with Google by default; use --github for GitHub, or --password for email and password. Saves your session to ~/.koolbase/config.json.

--githubSign in with GitHub instead of Google
--passwordSign in with email and password instead of Google
koolbase login --github
koolbase connect <provider>

Link an additional sign-in provider (google or github) to your account. You must be logged in first. Opens a browser flow and attaches the provider to your existing account rather than creating a new session.

koolbase connect github
koolbase logout

End your session on the server and remove saved credentials from this machine. Local credentials are cleared even if the server can't be reached.

koolbase logout
koolbase whoami

Show which account the CLI is logged in as — verified live against the API. A stale or revoked session reports as such instead of failing later mid-command.

koolbase whoami

API Keys

koolbase keys create

Mint an organization API key for programmatic access (CLI, MCP server, CI). The secret is shown once and printed with a ready-to-paste MCP config. Requires a logged-in session — keys cannot mint keys.

--nameHuman-readable key name, e.g. claude-desktop — required
--scoperead, write, or admin (the hard ceiling on every operation)
koolbase keys create --name claude-desktop --scope write
koolbase keys list

List your organization's API keys with prefix, scope, last-used time, and revoked status.

koolbase keys list
koolbase keys revoke <key_id>

Revoke an API key. Takes effect immediately — anything authenticating with it stops working on its next request.

koolbase keys revoke 4e1cd5b6-bc92-4c2d-98f1-a47dd6931828

MCP Server

koolbase mcp install

Wire the Koolbase MCP server into Claude Desktop in one command: writes the config entry pointing at this binary, preserving any existing servers and backing up the old file. Then fully quit and reopen Claude Desktop.

--keyKoolbase API key for the assistant (kb_live_...) — required
--codepush-mutationsAlso enable the code-push publish/recall tools (admin key required)
koolbase mcp install --key kb_live_your_key_here
koolbase mcp serve

Run the MCP server over stdio. MCP clients (Claude Desktop, Cursor, others) launch this — you rarely run it directly. Requires the KOOLBASE_API_KEY environment variable; it will not fall back to your login session.

--enable-codepush-mutationsRegister the code-push publish/recall tools (off by default; production-affecting, admin-scoped)
KOOLBASE_API_KEY=kb_live_... koolbase mcp serve

Designer

koolbase export apply <zip>

Apply a Designer export to a project on disk. Koolbase's files — lib/generated/, test/generated/ and lib/l10n/app_en.arb — are replaced whole; everything else is yours and is left alone. Refuses rather than overwrite if a generated file was edited by hand.

--intoProject directory to apply into (default: the current one)
koolbase export apply ~/Downloads/koolbase_export.zip --into ./my_app
# Exported 34 files into ./my_app
# lib/generated/ is Koolbase's and is replaced on re-export.
# Everything else is yours; build outside lib/generated/.

Projects

koolbase projects list

List the projects in the organization you are signed in to, with their IDs, so you can find a project ID without opening the dashboard. Your saved default project is marked with *.

--orgOrganization ID (defaults to the one you are signed in to)
--jsonPrint the projects as JSON
koolbase projects list
koolbase projects list --json

Functions

koolbase deploy <name>

Deploy a function from a local file. Runtime is auto-detected from the file extension — .ts deploys to Deno, .dart deploys to the Dart runtime.

--file, -fPath to the function file (.ts or .dart) — required
--project, -pProject ID
--runtime, -rOverride runtime: deno or dart
--timeoutExecution timeout in ms (default: 10000, max: 30000)
koolbase deploy send-email --file ./send_email.ts --project proj_123
koolbase deploy process --file ./process.dart --project proj_123
koolbase functions list

List all deployed functions in a project with version, runtime, timeout, and last deployed date.

--project, -pProject ID
koolbase functions list --project proj_123
koolbase invoke <name>

Invoke a deployed function with an optional JSON body. Prints the status code, response body and log ID. If the function fails, it says so, names the ctx.db call that failed and its status when that is the cause, shows the log ID, and exits with a non-zero code so scripts and CI notice.

--project, -pProject ID
--data, -dJSON body to send to the function
koolbase invoke send-email --project proj_123
koolbase invoke send-email --project proj_123 --data '{"to":"[email protected]"}'
koolbase logs <name>

View recent execution logs for a function. Shows status, duration, output, and errors.

--project, -pProject ID
--limitNumber of logs to fetch (default: 20)
koolbase logs send-email --project proj_123
koolbase logs send-email --project proj_123 --limit 50

Triggers

koolbase triggers list

List the project's triggers: ID, function, event, target, whether each is enabled, and when it was created.

--project, -pProject ID
koolbase triggers list --project proj_123
koolbase triggers create

Bind a function to an event, using the event names on the Triggers page, such as db.record.created, storage.object.created or auth.user.registered. insert, update and delete are accepted as short names for the db.record.* events. The server rejects an unknown event and lists every supported one.

--functionFunction to run (required)
--eventEvent to fire on (required)
--collectionThe collection for db.* events, the bucket for storage.* events; not used for auth.* events
--project, -pProject ID
koolbase triggers create --function notify --event db.record.created --collection orders
koolbase triggers create --function resize --event storage.object.created --collection avatars
koolbase triggers create --function welcome --event auth.user.registered
koolbase triggers delete <trigger-id>

Delete a trigger. The function stays deployed; it just stops firing for that event.

--project, -pProject ID
koolbase triggers delete 3f2c9a1e --project proj_123
koolbase triggers replay <trigger-id>

Run a db.record.created or db.record.updated trigger for the records already in its collection, oldest first, as if each had just been created or updated. For data seeded before the trigger existed. Deliveries are paced through the retry queue. Run with --dry-run first: it only counts.

--dry-runOnly count what would be queued
--limitQueue at most this many records (default 1000, max 5000)
--project, -pProject ID
koolbase triggers replay 3f2c9a1e --project proj_123 --dry-run
koolbase triggers replay 3f2c9a1e --project proj_123

Webhooks

koolbase webhooks create

Send a collection's record events to an HTTPS URL (port 443 or 8443), signed, with retries. Prints the signing secret once: store it straight away. Owners and admins only. See Database > Webhooks for the payload and how to verify the signature.

--urlHTTPS URL to send events to (required)
--collectionCollection to watch (required)
--eventdb.record.created, updated, deleted, or insert/update/delete; repeat or comma-separate (required)
--project, -pProject ID
koolbase webhooks create --url https://example.com/hook --collection orders --event insert
koolbase webhooks create --url https://example.com/hook --collection orders --event insert,update,delete
koolbase webhooks list

List the project's webhooks: ID, collection, enabled, events and URL. Secrets are never shown.

--project, -pProject ID
koolbase webhooks list --project proj_123
koolbase webhooks deliveries <webhook-id>

Recent deliveries for a webhook: event, status (pending, delivered or failed), attempt, the receiver's HTTP code and any error.

--limitHow many to show (default 20, max 100)
--project, -pProject ID
koolbase webhooks deliveries 3f2c9a1e --project proj_123
koolbase webhooks redeliver <delivery-id>

Send a delivery again, from the first attempt.

--project, -pProject ID
koolbase webhooks redeliver 8d1e44b2 --project proj_123
koolbase webhooks delete <webhook-id>

Delete a webhook and its delivery log.

--project, -pProject ID
koolbase webhooks delete 3f2c9a1e --project proj_123

Queue

koolbase queue enqueue <function>

Run a function in this project later, with retries (the same schedule and dead-letter queue as triggers). Owners and admins only. From inside a function, use ctx.queue.enqueue instead. See Functions > Queues.

--payloadJSON object passed to the function as ctx.request.payload
--delaySeconds to wait before running (0 to 604800, i.e. 7 days)
--project, -pProject ID
koolbase queue enqueue send-welcome-email --payload '{"userId":"u_123"}' --delay 60
koolbase queue list

Pending jobs, soonest first: job ID, function, attempt, when it runs, and the last error if it has failed before.

--project, -pProject ID
koolbase queue list --project proj_123
koolbase queue cancel <job-id>

Remove a job before it runs.

--project, -pProject ID
koolbase queue cancel e6d97d4f --project proj_123

Crons

koolbase crons list

List all cron schedules in a project with their expressions, status, and last run time.

--project, -pProject ID
koolbase crons list --project proj_123
koolbase crons add <function-name>

Add a cron schedule for a deployed function using a standard 5-field cron expression.

--cronCron expression e.g. "0 9 * * *" — required
--project, -pProject ID
koolbase crons add send-email --cron "0 9 * * *" --project proj_123
koolbase crons add cleanup --cron "*/5 * * * *" --project proj_123
koolbase crons toggle <cron-id>

Enable or disable a cron schedule without deleting it.

--enableEnable the schedule
--disableDisable the schedule
--project, -pProject ID
koolbase crons toggle 18f79c3a --disable --project proj_123
koolbase crons toggle 18f79c3a --enable --project proj_123
koolbase crons delete <cron-id>

Permanently delete a cron schedule.

--project, -pProject ID
koolbase crons delete 18f79c3a-1965-44a5-8ff2-1d35ac58ede8 --project proj_123

Code Push

koolbase bundle deploy

Package a bundle directory and deploy it to your app. Creates a draft, uploads the artifact, updates the checksum, and publishes — all in one command.

--appProject (app) ID — required
--platformios or android — required
--channelChannel to deploy to (default: stable)
--base-app-versionMinimum app version that can receive this bundle — required
--max-app-versionMaximum app version that can receive this bundle — required
--bundle-dirPath to bundle directory (default: ./bundle)
--rolloutRollout percentage 0–100 (default: 100)
--dry-runValidate and package without uploading
koolbase bundle deploy   --app d2bc2c2c-fb42-4891-b758-45e48a1cd871   --platform ios   --channel stable   --base-app-version 1.2.0   --max-app-version 1.2.99   --bundle-dir ./bundle   --rollout 10
koolbase bundle list

List all bundles for an app showing version, status, platform, channel, rollout percentage, size, and created time.

--appProject (app) ID — required
koolbase bundle list --app d2bc2c2c-fb42-4891-b758-45e48a1cd871
koolbase bundle recall

Recall a published bundle. Devices on this bundle will revert to the previous version on their next cold launch.

--appProject (app) ID — required
--bundleBundle ID to recall — required
koolbase bundle recall   --app d2bc2c2c-fb42-4891-b758-45e48a1cd871   --bundle bndl_fd05c5d5-5a71-465e-8d1d-0108cc02b92c
koolbase patch ios build

Author an iOS VM patch from your changed Dart source: compiles it against your installed Koolbase engine and packs the patch artifact (KBPI). See the Code Push CLI reference for the full iOS flow.

--sourcePath to the changed Dart file — required
--app-packageHost app package name — required
--engineInstalled Koolbase engine version — required
--outputOutput path (default: <app-package>_patch.kbpi)
koolbase patch ios build   --source lib/main.dart   --app-package myapp   --engine 3.44.4-koolbase.4
koolbase patch push-ios

Ship an iOS VM patch in one command: signs the KBPI, derives the release build_id from your app binary, creates or matches the release, uploads, and publishes.

--appProject (app) ID — required
--kbpiKBPI from patch ios build
--binaryBase App binary (build_id source) — required with --kbpi
--keyEd25519 private key — required with --kbpi
--channelRelease channel (default: stable)
--rolloutRollout percentage 0–100 (default: 100)
--no-publishLeave the patch as a draft
koolbase patch push-ios   --app <project_id>   --kbpi myapp_patch.kbpi   --binary ./Runner.app/Frameworks/App.framework/App   --key ./private.key
koolbase patch recall

Recall a published VM patch. Devices running it revert on their next check-in.

--appProject (app) ID — required
--patchPatch ID to recall — required
koolbase patch recall --app <project_id> --patch <patch_id>