CAKE20

AI Web PaaS

Cake20 Runtime CLI

Create, validate, and develop Cake20 projects locally, and manage databases, server source, and Releases.

CLI installation

@cake20/cli installs an exact, compatible @cake20/runtime version. The primary command is cake; cake20 remains available as a compatibility alias.

Only the @cake20 scope uses the Cake20 Package registry. Public dependencies continue to use the package manager's default registry, so do not replace the global registry.

Installations through npm, pnpm, or Yarn verify Bun 1.3 or later. If Bun is missing or outdated, install it with the displayed command and then repeat the CLI installation.

Regular commands show the Cake20 CLI version and official website on the first line. cake --version prints only the CLI version; cake -v prints both CLI and Runtime versions.

npm config set @cake20:registry https://package.cake20.com
npm install -g @cake20/cli

Available commands

Use cake --help to see the exact commands and options in the installed version. The current CLI provides the following command groups.

  • Projects and AI docs: init, prepare, doctor, ai
  • Development and execution: dev, design, preview, build, start, test
  • Database: db version, db export, db import
  • Account and server source: login, logout, whoami, sites, pull, sync, deploy
  • Archives and maintenance: run, update, version
cake --help

Create a project

cake init creates a minimal project with a hello typing screen and prepares the Cake20 View, Cake20 UI, and Cake20 types. --standard is an alias for the standard tmp-e1fc3d0b0947 template.

Use --template with a public tmp-* template or one of your web-* website IDs. The downloaded source is ready for development immediately.

A non-empty target asks for yes/no confirmation. Entering yes moves all existing items, including hidden files, to the operating system Trash.

  • Empty folders proceed immediately, and --yes skips confirmation.
  • The CLI refuses to empty a filesystem root, the home directory, a parent of the current directory, or a symbolic link.
  • Use cake init . to target the current folder.
  • Existing items, including .DS_Store, are moved to the operating system Trash instead of being permanently deleted.
# Basic project
cake init ./my-site

# Public Template ID
cake init ./my-site --template tmp-e1fc3d0b0947

# One of your website IDs
cake init ./my-site --template web-fe61cd26e3b5

# Shorter options for the same standard template
cake init ./my-site --standard

# Replace the current folder without prompting and install the standard template
cake init . --standard --yes

Develop with VS Code or Zed

cake prepare generates Cake20 View auto-import, Cake20 UI component, and Cake20 global types. Projects created by cake init are already prepared; run it again when an existing project is missing generated types.

Cake20 keeps package.json and tsconfig.json visible in VS Code and Zed. Generated Runtime directories remain system-managed.

  • After updating the type, restart the editor's TypeScript server.
  • app, server, shared, public, package.json, and tsconfig.json are visible in the project.
  • package.json is the editable source of website settings and dependencies.
cake prepare .

# VS Code
code .

# Zed
zed .

Develop, design, build, and run

  • dev runs UI HMR, APIs, files, SSE, WebSocket, and local PostgreSQL together.
  • dev and build apply the database schema and sync new or changed model seeds.
  • design and preview are the same UI-only mode for work that does not need APIs or a database.
  • build creates a production Release; start runs the current Release.
  • dev, design, preview, and start use port 5201 by default. Change it with --port.
  • A Runtime version mismatch produces a warning and continues when compatibility allows.
# Full development mode: UI HMR + API + DB + seed
cake dev . --open

# Screen-only design mode
cake design . --open
cake preview . --open

# Production Release
cake doctor .
cake build .
cake start . --open

Isolated test environment

  • cake test always runs in an isolated test environment without a separate mode selection.
  • Pass only the test file in the current project. For another project, pass its path first.
  • Use --suite to run the same file as a test suite.
  • Tests use the build/current Release, so run build first.
# Current project
cake test server/api/status.get.ts

# Another project
cake test ./my-site server/api/status.get.ts

Inspect, export, and import PostgreSQL data

cake db version shows the current PostgreSQL version and the resolved local or server data mode. A .dump preserves the complete local PGlite database, while a .sql file moves data between Cake20 PostgreSQL environments.

The local database is stored in data/postgres. Import refuses to replace existing data by default; --force explicitly permits replacement. Database imports do not restore files or project source.

cake db version
cake db export ./backup.dump
cake db export ./backup.sql
cake db import ./backup.dump
cake db import ./backup.sql

# Explicitly replace existing local DB
cake db import ./backup.sql --force

Download and synchronize server source

pull downloads the server project into the selected local directory. A non-empty target asks for yes/no confirmation before moving all entries to Trash.

sync local applies server source locally. sync server applies local source to the server and creates a Git commit.

The Core web editor and CLI synchronization can be used at the same time. If they update the same file, the last saved content wins.

  • sync local downloads changes, while sync server applies changes to the server.
  • Use cake test for testing. It always runs in an isolated test environment.
# Download a server project to a local directory
cake pull web-fe61cd26e3b5 ./my-site

cd ./my-site
cake sync local
cake sync server

Log in and deploy to Cake20

The first remote command opens browser login automatically. The CLI never receives your ID or password; it stores only the connection token in your user settings directory.

On the first deploy, if package.json name is not a registered web-* ID, the CLI confirms the project name and creation, Core assigns a new website ID, and the CLI saves it as the system-managed name.

An unregistered web-* name is never trusted as an arbitrary remote target. Later deploys upload to the connected website, run build/debug review, and publish the production Release.

cake push web-* is a compatibility command; use cake deploy for websites. Administrator tmp-* template pushes still update that template immediately.

  • .git, .vscode, .zed, node_modules, build, data, files, and tmp are not pushed.
  • Runtime-generated files and server management files are also excluded from pushes.
  • Logging out removes only the CLI connection stored on the device; it does not delete the Cake20 account.
cake login

# Create and deploy an unconnected local project
cake deploy ./my-site

# Deploy the connected website again
cake deploy ./my-site --yes

# Administrator compatibility command for immediate template updates
cake push tmp-e1fc3d0b0947 ./my-template

cake logout

Run a Cake20 ZIP directly

run validates the ZIP, creates a run directory, and performs doctor, build, and start without requiring manual extraction. It opens the default browser when the Runtime is ready.

The default run directory for hello.cake.zip is hello.cake. When the ZIP changes, only archive-managed source is updated; data/postgres and files are preserved.

  • Supported formats are .zip, .cake.zip, and .cake.
  • package.json must be at the ZIP root or inside a single top-level folder. Legacy archives containing project.ts are migrated when imported.
  • The CLI rejects path traversal, Runtime data folders, and archives over the file-count or size limits.
  • --memory uses an operating-system temporary directory and removes source, database data, and files on exit.
  • run resolves automatic data mode locally and does not connect to Cake20 production services.
cake run ./hello.cake.zip

# One-time run that leaves no user task folder behind
cake run ./hello.cake.zip --memory

# Specify location, browser and port
cake run ./hello.cake.zip --dir ./workspace --no-open --port 5300

Manage CLI and Runtime versions

update detects the package manager that installed the current CLI and installs the latest CLI with a compatible Runtime. Use --manager to select bun, npm, pnpm, or yarn.

cake --version prints only the numeric CLI version. cake -v displays both CLI and Runtime versions, while cake version displays the Runtime version.

# Check for updates without installing
cake update --check

# Update the CLI and its compatible Runtime
cake update

# Select the package manager explicitly
cake update --manager bun

# Show versions
cake --version
cake -v
cake version

Use the CLI with AI and automation

  • AI development tools can call prepare, doctor, dev, and build directly in a Cake20 project.
  • CI can combine doctor, the required tests, and build to verify Runtime compatibility.
  • cake version shows the Runtime version used by the CLI.
  • Cake20 Core is the visual control plane; the CLI is the local terminal and automation interface.