Core CLI — statikapi
The core CLI currently provides:
statikapi buildstatikapi dev- global
--help - global
--version
It is the CLI used by the normal local workflow, not the Cloudflare adapter workflow.
Global usage
statikapi --help
statikapi --version
statikapi build
statikapi dev
statikapi build
Builds JSON endpoints into the configured output directory.
Default directories:
- source:
src-api - output:
api-out
Common flags
--srcDir <dir>--outDir <dir>--pretty--minify=false--listIndex=true|false--listIndexPick id,title
Examples
pnpm statikapi build
pnpm statikapi build --srcDir api --outDir public/api --pretty
pnpm statikapi build --listIndex=true --listIndexPick id,title
What it writes
- route JSON files
api-out/.statikapi/manifest.json
Notes
- output is minified by default
--prettywrites readable JSON- dynamic and catch-all routes without
paths()are skipped instead of failing the whole build
statikapi dev
Starts the local watch/build/preview flow.
Common flags
--srcDir <dir>--outDir <dir>--host <host>--port <port>--no-ui--no-open--keep-alive--serve--listIndex=true|false--listIndexPick id,title
Examples
pnpm statikapi dev
pnpm statikapi dev --port 8788 --srcDir src-api --outDir api-out
pnpm statikapi dev --no-open
What it does
- builds an initial output set
- watches your source tree
- rebuilds on change
- removes stale output when routes disappear
- updates the local manifest
- serves the preview UI at
/_ui/
Non-TTY behavior
In non-interactive environments, dev behaves like a stub unless you force it with:
--keep-alive--serveSTATIKAPI_FORCE_DEV=1
That is useful when running under tools like concurrently.
Route output model
The regular CLI emits filesystem JSON:
/->api-out/index.json/users/1->api-out/users/1/index.json
If config.listIndex is enabled on a dynamic or catch-all route, it can also emit a parent collection route:
/posts/1/posts/2/posts
See Configuration and Dynamic Routes.
Manifest shape
The local manifest written to .statikapi/manifest.json currently includes:
routeoutFilesrcFilefilePathbytesmtimehash
The preview UI uses that manifest to show route lists and load payloads.
JSON restrictions
Route output must be JSON-serializable.
Allowed:
- objects
- arrays
- strings
- booleans
null- finite numbers
Rejected:
- functions
- symbols
BigIntDate- class instances
- circular structures
NaNInfinity