Menu
Public repository / 914ea2e9a5a571cafc5fbfc99962b4c9037f4ea3
AkurAI-Framework / site/content/docs/cli.md
Latest change 0ebc2057fd9a65182855334c219522ae944ad484 - docs: /docs guides for routing, forms, storage, middleware, SEO, styling + dev server by Ólafur Búi Ólafsson
# CLI The `akurai` binary is the whole toolchain. It has no subdependencies and runs anywhere a Linux binary runs. ## `akurai new <path>` Scaffold a new project from embedded templates. Creates `frontend/`, `backend/`, and `data/`, plus `akurai.toml`. Fails if the target exists and is non-empty. ``` akurai new myapp ``` ## `akurai serve` Serve the current project. Registers every `frontend/*.html` as a template, renders pages against `backend/page.json`, routes through `backend/routes.json` (see [Routing](/docs/routing)), and persists data to `data/store.db` (see [Storage](/docs/storage)). ``` akurai serve --dir frontend --host 127.0.0.1 --port 8090 ``` - `--dir` — frontend directory (default `frontend`) - `--host` — bind address (default `127.0.0.1`) - `--port` — bind port (default `8090`) ## `akurai dev` The same as `serve`, plus **live reload**. The dev server watches `frontend/`, `content/`, and `backend/` and, on any change, pushes a reload to connected browsers over Server-Sent Events (a tiny `EventSource` script is injected into dev pages). Edit a template or stylesheet and the page refreshes itself — no plugin, no build step. ``` akurai dev --dir frontend --port 8090 ``` Live reload is strictly a `dev` feature: `akurai serve` starts no watcher, injects nothing, and reserves the internal `/_dev/*` namespace as `404`. ## `akurai version` Print the version. ## Deploying The binary is self-contained, so deployment is "copy the file and run it." Build a static binary for portability: ``` cargo build --release --target x86_64-unknown-linux-musl ``` Put it behind nginx for TLS and run it under systemd. That is exactly how `akurai-framework.olibuijr.com` — the site you are reading — is deployed.