CLI

init, start, migrate, keys, status, deploy and invoke: every command and flag.

text
forkbase [--config forkbase.toml] <command>

--config (or FORKBASE_CONFIG) names the configuration file for every command. Logs go to stderr; FORKBASE_LOG sets their level.

forkbase init

Writes a new forkbase.toml and makes the data folder's secrets.

Flag
--db postgres|chronosthe database mode (default postgres)
--database-url <url>postgres mode: your database (or set FORKBASE_DATABASE_URL later)
--forceoverwrite an existing file

forkbase start

Runs the migrations, starts the engine when needed, applies the merge policies, writes the API keys to the data folder and serves. Stops cleanly on Ctrl-C or SIGTERM.

forkbase migrate

Sets up or updates Forkbase's schemas in the database, then exits. start does this too; use migrate in a deploy step that runs before the servers.

forkbase keys

Prints the API keys written at the last start, as JSON: {"anon": "...", "service_role": "..."}.

forkbase status

GET /health on a running server; exits non-zero unless it's healthy.

Flag
--urlthe server (FORKBASE_URL; default http://127.0.0.1:8000)

forkbase deploy <path>

Deploys a function to a running server: one .ts, .js, .mjs or .py file, or a folder (text files only; node_modules, .git, __pycache__, target, dist, venv and dotfiles are left out). Each deploy is a new version.

Flag
--namethe function's name (default: the file's or folder's name)
--entrythe file that's run, in a folder
--agenteach job works in a world of this agent and proposes when it ends well
--cron "<expr>"also schedule it (UTC): "*/5 * * * *", @daily, @every 10m
--timeout-s, --memory-mb, --max-attemptslimits
--env NAME=valuea variable for its processes (repeat it)
--url, --service-keythe server and key (FORKBASE_URL, FORKBASE_SERVICE_KEY; default: server.listen and the keys file in the data folder)

forkbase invoke <name>

Starts a job and prints it. Exits non-zero if the job failed.

Flag
--payload '<json>'the job's input (default null)
--wait <s>wait up to this long for it to end (default 30, at most 60)
--url, --service-keyas for deploy

forkbase --version, forkbase help

Something wrong or missing? Edit this page on GitHub or open an issue.

CLI · Forkbase