CLI
arka-deck exposes a single CLI to start, stop and reboot the local web server.
Source of truth: bin/arka-deck, scripts/arka-cli.mjs.
Binary command
Section titled “Binary command”./bin/arka-deck [flags]Direct launch of the web server. By default, listens on 127.0.0.1:3117 (strict loopback).
| Flag | Effect |
|---|---|
--port <n> | HTTP port (default 3117) |
--host <addr> | Explicit bind address |
--lan | Alias for --host 0.0.0.0 (enables LAN) |
--no-lan | Force strict loopback |
npm wrappers
Section titled “npm wrappers”scripts/arka-cli.mjs orchestrates the lifecycle in detached mode.
npm run arka:start
Section titled “npm run arka:start”npm run arka:start [-- --lan|--no-lan]- Builds the UI if needed
- Spawns
bin/arka-deckdetached - Redirects logs to
.arka-web.log - Writes PID to
.arka-pid - Pings
/api/healthuntil ready (or fails after timeout)
npm run arka:stop
Section titled “npm run arka:stop”npm run arka:stop- Kills the process via PID (
.arka-pid) lsoffallback if PID is stale- Cleans up
.arka-pidand.arka-token
npm run arka:reboot
Section titled “npm run arka:reboot”npm run arka:reboot [-- --lan|--no-lan]Equivalent to arka:stop followed by arka:start. Useful after a LAN preference change or a modification touching the bootstrap.
LAN mode priority order
Section titled “LAN mode priority order”Four sources can enable or disable LAN mode. The first applicable wins:
- CLI flag (
--lanor--no-lan) — maximum priority. - Environment variable
ARKA_DECK_WEB_LAN=1|true|yes. - Persisted preference
~/.arka-deck/preferences/network.json(Settings toggle). - Default:
false(strict loopback).
Session token (LAN mode)
Section titled “Session token (LAN mode)”When LAN is active:
- A token is regenerated at each start.
- Stored in
.arka-tokenat the arka-deck project root (mode0o600). - Displayed in logs at boot (non-sensitive in local mode).
- Required in the
X-Arka-Tokenheader for any request from a remote device. - Removed on clean shutdown.
In strict loopback mode (default), the token is not required for requests from 127.0.0.1.
Signals
Section titled “Signals”The server stops cleanly on SIGINT (Ctrl+C) and SIGTERM:
- Cancels in-progress chat sessions
- Closes EventBus subscriptions (each addon’s
unsubscribe()) - Closes SQLite databases
- Stops the Cortex Lite sidecar if applicable
SIGKILL (kill -9) bypasses everything — avoid unless necessary (the project marker and SQLite remain consistent thanks to atomic writes).
Main environment variables
Section titled “Main environment variables”| Variable | Effect |
|---|---|
ARKA_DECK_WEB_PORT | HTTP port |
ARKA_DECK_WEB_HOST | Bind address |
ARKA_DECK_WEB_LAN | Enable LAN (priority 2) |
ARKA_DECK_HOME | Override ~/.arka-deck/ |
ARKA_DECK_LOG | Fastify log level |
ARKA_DECK_RATE_LIMIT_MAX | Rate limit ceiling |
Full list: ./variables-env.
See also
Section titled “See also”- HTTP API: ./api-http
- Environment variables: ./variables-env
- LAN access (Product): ../../produit/08-reseau-lan