Canica

CLI

Installed with curl -fsSL https://get.canica.app | sh; in an app, also npx canica. canica help prints this:

canica — full-stack TypeScript apps with a reactive database

  canica new <dir>         create an app from the starter template
  canica dev [--port <n>]  run the app locally (vite dev + backend on one port)
  canica build             build the client into dist/, with icons and manifest (deploy builds by itself)
  canica lint              check app code against Canica's rules
  canica storyboard        every screen, modal and state as one interactive canvas, rendered inertly from server/seed.ts (.canica/storyboard/index.html)
       --url <url>       use a running dev server (default: start one)
  canica emails            render every email template with its preview props into .canica/emails/*.html (and .txt)
                           and list them (the dev server shows them, and what the app sent, at /_canica/dev/emails)
  canica emails retry <id> try a deployed app's email again now (the relay sends an id once: a repeat is not sent twice)
  canica routes            regenerate src/routes.gen.ts (and server/apis.gen when server/apis.ts changed)
  canica apis [--refresh]  generate typed clients for the APIs in server/apis.ts into server/apis.gen/
                           (specs cached in .canica/apis; --refresh downloads them again)
  canica theme [random|<code>]  apply a shadcn preset (https://ui.shadcn.com/create)

  Deploying (to <name>.canica.run; you need to sign in once):
  canica login | logout | whoami
  canica deploy [--name <name>] [--org <slug>] [--skip-checks]   typecheck, lint, test, build, migrate the database, then deploy
                           (canica.json says which app; the first deploy reserves --name, default the package
                           name, and stops if someone has it)
  canica apps              your apps and your organizations' apps
  canica apps move <name> --org <slug> | --personal   give an app to an organization (or take it back)
  canica access [public|signedIn|org|private|reset]   who may use the deployed app: anyone (guests too), anyone
                           signed in with Google, the organization (or you), only its admins (or you). It wins over
                           app({ access }) in the code until `canica access reset`
  canica secrets set <NAME> | list | unset <NAME>   secrets for actions (ctx.secrets.NAME); set reads the value
                           from stdin (typed hidden, or piped); they apply on the next `canica deploy`
                           (before the first deploy, `set` reserves the app: [--name <name>] [--org <slug>])
  canica logs              the deployed app's last log entries
  canica usage             today's requests and changes, its storage, files and emails, against the app's limits
  canica rollback          serve the previous version again (the data stays as it is)
  canica delete            delete the deployed app and its data (asks to confirm)
  canica token create [label] | list | revoke <id>   tokens for CI (CANICA_TOKEN)

  Organizations (they own apps; owners and admins manage them, members see them):
  canica org create <slug> [--name <name>] | list | members <slug> | delete <slug>
  canica org invite <slug> <email> [--role member|admin|owner]   (joins when they sign in)
  canica org remove <slug> <email> | role <slug> <email> <role>
  canica org domain <slug> <domain|none>   whoever signs in with that Google domain joins as a member

  Database (the deployed app, or --url <the dev server's URL> for the dev server):
  canica db plan           what deploying the current code would do to the data (deploy checks this too)
  canica db history        schema versions, with restore bookmarks
  canica db purge <table>[.<field>]   delete a hidden table or field for good (asks to confirm)
  canica run <name> [json args] [--batch]       run an internal mutation or action; --batch repeats while it returns done: false

  Operators (the platform itself deploys from the repository: pnpm platform):
  canica deploy --skip-migration   an emergency deploy without the database check and
                           migration (the new version migrates when it starts); needs the operator secret