CLI & operations
Every supported lifecycle operation is an explicit subcommand. Global data scope comes first; command-specific paths and behavior follow.
Global data scope
| Option | Environment | Default |
|---|---|---|
--database | BUNFORK_DB | data/bunfork.db |
--key-file | BUNFORK_KEY_FILE | .bunfork.key |
--tenant | BUNFORK_TENANT | default |
--model | BUNFORK_MODEL | default |
Secret files take precedence over BUNFORK_DB_KEY and BUNFORK_API_TOKEN.
Command reference
| Command | Purpose |
|---|---|
keygen | Create a private 256-bit key or token file. |
build | Run one explicit frontend command with a reduced environment, then admit its output. |
admit | Inventory a completed browser directory and atomically write its deterministic manifest. |
doctor | Verify every admitted file, digest, length, and manifest invariant without listening. |
dev | Serve native pages with request-time route rescans, or a frozen static artifact. |
serve | Run the production native or static server. start is an alias. |
migrate | Apply embedded migrations transactionally and verify the exact schema. |
backup | Create and verify an encrypted, atomic, no-overwrite backup. |
restore | Verify and restore a backup while preserving the previous live database. |
vector | Put, search, or delete tenant/model-scoped vector records. |
test | Run locked Rust tests plus native route, migration, vector, and backup smoke checks. |
deploy | Test, release-build, and atomically install a digest-owned local bundle. |
A small operational loop
# before a release
./target/release/bunfork test
./target/release/bunfork backup --out backups/pre-release.db
# create a verified local release directory
./target/release/bunfork deploy
# production probes
curl --fail http://localhost:3100/_bunfork/health
curl --fail http://localhost:3100/_bunfork/ready
Health reports status, service, version, and uptime_seconds. Readiness returns {"message":"ok"}; native mode answers HTTP 503 with {"message":"unavailable"} if its encrypted database check fails.
deploy runs its own checks and release build. It creates a local bundle; it does not upload, provision, configure DNS/TLS, or delete old releases.
Server controls
--address- Defaults to
0.0.0.0:3100; environment:BUNFORK_ADDRESS. --pages- Native page root; defaults to
app/pages. --public- Native asset root served below
/assets; defaults topublic. --token-file- Bearer token source; defaults to
.bunfork.token. --public-origin- Canonical HTTP(S) origin allowed for browser mutations; environment:
BUNFORK_PUBLIC_ORIGIN. --static+--manifest- Enter data-free static mode. The two options are required together.