Overview
Siclaw ships two ways to run on a single workstation:- Standalone TUI —
siclaw, no server, reads.siclaw/config/settings.json - Local Portal —
siclaw local, a single process that runs Portal + Runtime + embedded SQLite and serves a Web UI athttp://localhost:3000
Why pair them
Running the TUI standalone works, but every change lives inside one.siclaw/config/settings.json file on one machine:
- Adding a provider API key on laptop A means re-adding it on laptop B
- Adding a kubeconfig inside one TUI session doesn’t help the next session in a different directory
- Teammates can’t share the investigation set-up you just built
- Portal stores providers, credentials, skills, MCP servers, agents, knowledge pages in a local SQLite database
- The Web UI at
localhost:3000is where you edit them - Every paired TUI pulls the same snapshot and materializes it into an ephemeral cache for that session
- Changes in the Web UI are visible to the next TUI session — no restart of the Portal server required
How it works
On startup, the TUI looks in the current working directory for.siclaw/local-secrets.json (written by siclaw local) and probes http://127.0.0.1:3000/api/health. If both succeed, the TUI:
- Reads the dedicated
cliSnapshotSecretfrom.siclaw/local-secrets.json - Fetches
GET /api/v1/cli-snapshot(or?agent=<name>when--agentis given), presenting the secret in theX-Siclaw-Cli-Snapshot-Secretheader - Materializes the response into
.siclaw/.portal-snapshot/{skills,knowledge,credentials}/ - Points the agent’s Read tool,
local_script, kubectl, and SSH config at those ephemeral paths - Registers a cleanup hook: the directory is wiped on
SIGINT,SIGTERM, or normal exit
.siclaw/config/settings.json flow — Portal is an optional upgrade, never a hard dependency.
Portal rejects the request if any of three conditions fail: the enableCliSnapshot flag is off (prod Portal leaves it off), the request origin is not loopback, or the secret doesn’t match. The secret is distinct from Portal’s jwtSecret on purpose — reading the snapshot does not also grant the caller the ability to self-sign admin JWTs against every other Portal route.
Cwd-scoped pairing
The TUI decides which Portal to pair with by looking for.siclaw/local-secrets.json in its own cwd. Consequences:
siclawin~/projectAsees thesiclaw localstarted from~/projectA. It will not see a Portal running from~/projectB, even if that Portal is reachable at127.0.0.1:3000.- Running
siclaw localin two different cwds on the same machine will fail to start the second one — port 3000 is already bound by the first. - A shared workstation model is therefore “one Portal, one cwd”; anyone who wants to use that Portal must run
siclawfrom the same cwd.
Session commands
These slash commands are read-only observers of the current Portal snapshot. Mutations always happen in the Web UI.Agent scoping
A Portal agent bundles a curated set of skills, credentials, knowledge, MCP servers, and a preferred LLM model. The TUI can scope a whole session to one agent:siclaw agents exits non-zero if Portal is unreachable.
First-run wizard
When you runsiclaw for the first time in a cwd that has a running local Portal but no .siclaw/config/settings.json yet, the wizard does not write a local settings file. Instead it:
- Prints a note explaining that provider setup has moved to Portal
- Asks an interactive Y/n: “Open
http://localhost:3000/settings/modelsin your browser now?” - If yes, launches the default browser (macOS
open, Windowsstart, Linuxxdg-open) and exits - If no, prints the URL so you can visit it later and exits
- If the browser launcher throws, falls back to a “couldn’t launch a browser automatically, please open this URL manually” message — the URL stays visible either way
siclaw after configuring a provider in Portal and it will pick up the provider automatically. This design avoids a per-workstation “ghost provider” in a local settings.json that silently desyncs across machines.
Standalone TUI (no Portal in the cwd) keeps the legacy presets picker — OpenAI / Anthropic / Compatible API — unchanged.
Filesystem layout
Standalone TUI writes and reads under.siclaw/:
When to use which
Related
- CLI & Local Server install guide
- Skills architecture
- Architecture invariants:
docs/design/invariants.md§1.4 (snapshot contract, materialization, skill filter)