Skip to content

start / stop / restart / status

Start the Snippbot daemon server.

Terminal window
snippbot start # Start with defaults
snippbot start --port 9000 # Custom port
snippbot start --host 0.0.0.0 # Bind to all interfaces
snippbot start --dev # Dev mode with auto-reload
OptionDefaultDescription
--port18781 (from config / fallback)API port
--host"" — dual-stack bind (IPv4 + IPv6)Host to bind. Client commands resolve "" to 127.0.0.1 when dialing.
--devoffAuto-reload on code changes

Once running, the daemon serves:

  • API: http://{host}:{port}/api
  • UI: http://{host}:{port}/
  • Health: http://{host}:{port}/health

Stop the running daemon.

Terminal window
snippbot stop # Graceful stop (SIGTERM, 15s timeout)
snippbot stop --force # Force kill (SIGKILL)
snippbot stop --port 9000 # Stop daemon on custom port
snippbot stop --strict # Exit 1 if no daemon was running
OptionDefaultDescription
--portfrom config (default 18781)Port the daemon is running on
--hostfrom config (default "" → 127.0.0.1)Host to target. Symmetrical with start --host / status --host.
--forceoffForce kill instead of graceful shutdown
--strictoffExit non-zero if no daemon was running (script-friendly)

The graceful stop sends SIGTERM and waits up to 15 seconds for in-flight requests to complete. Use --force if the daemon is unresponsive.

By default snippbot stop exits 0 even when there was nothing to stop (so repeated invocations are idempotent). Pass --strict in scripts that need to distinguish “stopped one” from “none to stop”.


Stop the running daemon, then start it again — one command instead of snippbot stop followed by snippbot start.

Terminal window
snippbot restart # Graceful stop, then start
snippbot restart --force # Force kill, then start
snippbot restart --port 9000 # Restart the daemon on a custom port
snippbot restart --dev # Restart in dev mode with auto-reload
OptionDefaultDescription
--portfrom config (default 18781)API port (used for both the stop and the start)
--hostfrom configHost to target and bind
--devoffStart in dev mode with auto-reload
--forceoffForce kill the running daemon instead of a graceful stop

If no daemon is running, restart simply starts one. After stopping, it waits up to ~10 seconds for the port to free before starting; if the port is still held it exits 1 (retry with --force).

When the OS service is installed (snippbot service install) and no --dev / --port / --host override is given, restart goes through the service supervisor (same as snippbot service restart) so it doesn’t race the service’s own auto-restart. Otherwise the daemon runs in the foreground of your terminal, exactly like snippbot start.


Check whether the daemon is running.

Terminal window
snippbot status # Table output
snippbot status --json # JSON output
OptionDefaultDescription
--jsonoffJSON output
--port18781API port to check
--host"" (dual-stack)Host to check

Example output:

┌──────────┬──────────────────────────────┐
│ Property │ Value │
├──────────┼──────────────────────────────┤
│ Status │ running │
│ Uptime │ 2h 15m │
│ Host │ 127.0.0.1 │
│ Port │ 18781 │
│ API │ http://127.0.0.1:18781/api │
│ UI │ http://127.0.0.1:18781 │
└──────────┴──────────────────────────────┘

JSON output:

{
"running": true,
"status": "ok",
"host": "127.0.0.1",
"port": 18781,
"uptime_seconds": 8100
}

The daemon exposes three health endpoints (no auth required):

EndpointPurpose
GET /healthBasic liveness
GET /health/readyReadiness (databases loaded)
GET /health/liveKubernetes liveness probe
Terminal window
curl http://localhost:18781/health
# {"status": "ok", "version": "0.5.0", "uptime_seconds": 3600}