Documentation menu

CLI & operations

Every supported lifecycle operation is an explicit subcommand. Global data scope comes first; command-specific paths and behavior follow.

Global data scope

OptionEnvironmentDefault
--databaseBUNFORK_DBdata/bunfork.db
--key-fileBUNFORK_KEY_FILE.bunfork.key
--tenantBUNFORK_TENANTdefault
--modelBUNFORK_MODELdefault

Secret files take precedence over BUNFORK_DB_KEY and BUNFORK_API_TOKEN.

Command reference

CommandPurpose
keygenCreate a private 256-bit key or token file.
buildRun one explicit frontend command with a reduced environment, then admit its output.
admitInventory a completed browser directory and atomically write its deterministic manifest.
doctorVerify every admitted file, digest, length, and manifest invariant without listening.
devServe native pages with request-time route rescans, or a frozen static artifact.
serveRun the production native or static server. start is an alias.
migrateApply embedded migrations transactionally and verify the exact schema.
backupCreate and verify an encrypted, atomic, no-overwrite backup.
restoreVerify and restore a backup while preserving the previous live database.
vectorPut, search, or delete tenant/model-scoped vector records.
testRun locked Rust tests plus native route, migration, vector, and backup smoke checks.
deployTest, 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 to public.
--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.