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 afterwardskoolbase create my_app
koolbase create my_app --flavors --template chatkoolbase 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] --forceAuth
koolbase loginAuthenticate 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 Googlekoolbase login --githubkoolbase 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 githubkoolbase logoutEnd 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 logoutkoolbase whoamiShow 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 whoamiAPI Keys
koolbase keys createMint 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 writekoolbase keys listList your organization's API keys with prefix, scope, last-used time, and revoked status.
koolbase keys listkoolbase 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-a47dd6931828MCP Server
koolbase mcp installWire 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_herekoolbase mcp serveRun 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 serveDesigner
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 listList 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 JSONkoolbase projects list
koolbase projects list --jsonFunctions
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_123koolbase functions listList all deployed functions in a project with version, runtime, timeout, and last deployed date.
--project, -pProject IDkoolbase functions list --project proj_123koolbase 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 functionkoolbase 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 50Triggers
koolbase triggers listList the project's triggers: ID, function, event, target, whether each is enabled, and when it was created.
--project, -pProject IDkoolbase triggers list --project proj_123koolbase triggers createBind 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 IDkoolbase 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.registeredkoolbase triggers delete <trigger-id>Delete a trigger. The function stays deployed; it just stops firing for that event.
--project, -pProject IDkoolbase triggers delete 3f2c9a1e --project proj_123koolbase 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 IDkoolbase triggers replay 3f2c9a1e --project proj_123 --dry-run
koolbase triggers replay 3f2c9a1e --project proj_123Webhooks
koolbase webhooks createSend 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 IDkoolbase webhooks create --url https://example.com/hook --collection orders --event insert
koolbase webhooks create --url https://example.com/hook --collection orders --event insert,update,deletekoolbase webhooks listList the project's webhooks: ID, collection, enabled, events and URL. Secrets are never shown.
--project, -pProject IDkoolbase webhooks list --project proj_123koolbase 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 IDkoolbase webhooks deliveries 3f2c9a1e --project proj_123koolbase webhooks redeliver <delivery-id>Send a delivery again, from the first attempt.
--project, -pProject IDkoolbase webhooks redeliver 8d1e44b2 --project proj_123koolbase webhooks delete <webhook-id>Delete a webhook and its delivery log.
--project, -pProject IDkoolbase webhooks delete 3f2c9a1e --project proj_123Queue
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 IDkoolbase queue enqueue send-welcome-email --payload '{"userId":"u_123"}' --delay 60koolbase queue listPending jobs, soonest first: job ID, function, attempt, when it runs, and the last error if it has failed before.
--project, -pProject IDkoolbase queue list --project proj_123koolbase queue cancel <job-id>Remove a job before it runs.
--project, -pProject IDkoolbase queue cancel e6d97d4f --project proj_123Crons
koolbase crons listList all cron schedules in a project with their expressions, status, and last run time.
--project, -pProject IDkoolbase crons list --project proj_123koolbase 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 IDkoolbase crons add send-email --cron "0 9 * * *" --project proj_123
koolbase crons add cleanup --cron "*/5 * * * *" --project proj_123koolbase crons toggle <cron-id>Enable or disable a cron schedule without deleting it.
--enableEnable the schedule--disableDisable the schedule--project, -pProject IDkoolbase crons toggle 18f79c3a --disable --project proj_123
koolbase crons toggle 18f79c3a --enable --project proj_123koolbase crons delete <cron-id>Permanently delete a cron schedule.
--project, -pProject IDkoolbase crons delete 18f79c3a-1965-44a5-8ff2-1d35ac58ede8 --project proj_123