Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Web Server

Use swarmie web to run the HTTP frontend (REST + SSE).

Primary sources:

  • CLI web command: crates/cli/src/cmd/server.rs
  • Server config and middleware: crates/server/src/lib.rs
  • Routes: crates/server/src/routes/mod.rs
  • Basic auth middleware: crates/server/src/auth.rs

Start server

swarmie web
swarmie web --port 8080 --hostname 0.0.0.0
swarmie web --password "secret" --cors https://app.example.com --no-open

Password resolution:

  1. --password
  2. SWARMIE_SERVER_PASSWORD

If password is set, HTTP Basic auth is enabled with username swarmie.

API surface

Core endpoints:

  • Health: GET /health
  • Sessions: GET/POST /sessions, GET/DELETE /sessions/{id}
  • Messaging: POST /sessions/{id}/messages, POST /sessions/{id}/abort
  • Session controls: mode/model/agent/objective/plan/undo/compact endpoints
  • Events: GET /events and GET /sessions/{id}/events (SSE)

CORS behavior

Default allowed origins include local dev hosts:

  • http://localhost:*
  • http://127.0.0.1:*

Use --cors <origin> repeatedly for additional origins.

Server config notes ([server])

TOML schema for [server] exists in crates/core/src/config/toml_types.rs (port, hostname, password, cors).

Current swarmie web runtime uses CLI/env wiring from crates/cli/src/cmd/server.rs; it does not currently read [server] values from resolved runtime config.