CLI

CLI reference

For your agentCopy this and give it to the AI you're building with.
Use the cubek CLI for this project: run `cubek <command> --help` before a command you have not used, and add `--json` when you read its output.
On a 401 or 403, run `cubek whoami` and tell me what it says.

Every command takes --help and --json. [project] defaults to name in ./cubek.json.

Project

  • cubek init [name] [--dir D]
    Create a starter project (in ./<name>, or D).
  • cubek init --workspace <name>
    A workspace of several apps (apps/<a>, cubek-workspace.json; --apps a,b names them).
  • cubek dev [dir] [--port 8787]
    Serve locally, recompile on save (http://127.0.0.1:8787).
  • cubek dev --workspace [dir]
    Every app of the workspace in one process, one port each.
  • cubek dev --stop [dir]
    Stop that project's (or workspace's) dev server only.
  • cubek task run <name> [json]
    Run a task now on the dev server, or deployed with --project P (task list: tasks and cron).
  • cubek sql --dev "<SQL>" [--write]
    SQL on the dev database (also without --dev when not logged in).
  • cubek secrets --dev set|get|list|rm
    The dev secrets in .cubek/secrets.json.
  • cubek check [dir | file.ts]
    Compile and report errors with their canonical fix.
  • cubek check --workspace [dir]
    Check every app and the calls, events and bindings between them.
  • cubek test [dir] [-- bun args]
    Run the project's *.test.ts with bun (needs bun).
  • cubek types [dir]
    (re)write the SDK into <dir>/.cubek/sdk.

Deploy and operate

  • cubek login [--url URL] [--provider github|google]
    Sign in with the browser.
  • cubek login [--url URL] --token T
    Headless: a personal token or a tenant API key.
  • cubek logout | whoami
    Whoami: user, organization and role.
  • cubek deploy [dir] [--prod] [--allow-destructive] [-m msg] [--project P]
  • cubek deploy --workspace [dir] [--prod]
    Every app of the workspace, in dependency order.
  • cubek revisions [project]
    List revisions (* = production).
  • cubek promote [project] <rev>
    Make a revision production.
  • cubek rollback [project] <rev> [--with-db]
  • cubek preview rm [project] <rev>
    Delete a preview and its database clone.
  • cubek project list
    Your projects: production revision, URL, domains.
  • cubek project delete <name> --yes
    Delete a project and all its data, irreversibly.
  • cubek logs [project] [--follow] [--level L] [--lines N]
  • cubek metrics [project] [--window 1h|24h|7d]
    Requests, errors, latency, CPU, DB time, storage.
  • cubek sql [project] "<SQL>" [--write] [--rev N]
  • cubek secrets set|get|list|rm [project] ...
  • cubek domains add|verify|list|redirect [project] ...
  • cubek snapshots list|prune [project] [--dry-run]
  • cubek db restore [project] --to <instant> [--onto preview|production]
    Point-in-time recovery.
  • cubek db restore [project] --promote [--rev N] | db archive [project]
  • cubek org list | create <slug> | switch <slug>
  • cubek org members list | add-role <email> <role> | remove <email>
  • cubek org invite <email> --role R | invite accept <token> | invitations [revoke <id>]
  • cubek tokens list | create <name> [--scope S] | revoke <id>
  • cubek tenant keys list | create [name] | revoke <id>
    [--tenant T].

Agents

  • cubek mcp
    MCP server on stdio.
  • cubek skill [topic]
    Print the Skill (SKILL.md) for agents, or a sub-skill (skill/README.md).

Exit codes: 0 ok, 1 failed, 2 usage, 3 environment.