Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
The Restaurant at the End of the Universe — an AI terminal for macOS and Linux
Jump to setup instructionsFetched from the repository for this visit.
Secure MilliWays: all clients in one place, shared memory, shared sessions, one security layer, delivered through one security control plane.
Milliways is an AI terminal for macOS and Linux. Berget, MiniMax, Claude, Codex, Pool, Gemini, Copilot, Kimi, DeepSeek, and local models all run from the same workspace, with the same observable control plane around them.
Open a tab and you're talking to a runner. Hand off mid-session with /takeover, which carries a structured briefing from the active turn log to the next runner. Hit a quota limit and milliways rotates to the next available runner automatically — re-run your prompt (or /retry) on it to continue. Daemon event history, metrics, and security posture are persisted and surfaced while you work (project memory too, when MemPalace is configured); the live REPL turn log stays in memory until it is compacted, handed off, or written through the daemon.
The security focus is simple: AI clients should not each invent their own workstation safety story in isolation. Milliways adds a terminal-owned control plane for startup scans, client profile checks, command risk classification, command shims, output scanning, quarantine planning, SBOM evidence, and CRA readiness. It is not a magic shield, but it gives you one place to see and manage risk before, during, and after agent work.
It wraps the CLIs and APIs you already have set up. It does not run hosted models or manage cloud credentials. Bring your own towel.
Architecture updates: memory, persistence, and observability · Secure MilliWays · the security control plane · local GPU model installs.
| Layer | What Milliways adds |
|---|---|
| Startup | First-workspace posture scan for package hooks, client config, task runners, IOC files/domains, user services, and macOS LaunchAgents. |
| Client switch | Per-client checks for Berget, MiniMax, Claude, Codex, Copilot, Gemini, Pool, Kimi, DeepSeek, and local endpoints before handoff. |
| Protection state | Navigation and status surfaces show protected only when Milliways has real control-plane coverage for that client; otherwise they show unprotected or preflight-only. |
| Command path | Deterministic firewall and broker shims for package installs, persistence, secret reads, exfiltration patterns, network download, shell eval, IOC hits, and complex commands. |
| Output path | Generated/staged file planning for secrets, SAST, dependency changes, SBOM refresh, and strict/CI blocking. |
| Operations | Security mode, warnings, quarantine, rule updates, scanner detection, and observability cockpit badges. |
| Evidence | Durable policy audit, generated-shim audit events, SPDX SBOM generation, and EU Cyber Resilience Act readiness tracking without pretending NVD is the compliance model. |
Useful commands:
milliwaysctl security status # mode, scanners, shims, clients, warnings, blocks
milliwaysctl security audit # policy decisions by workspace/client/session
milliwaysctl security shims status # command broker readiness
milliwaysctl security sbom # SPDX SBOM for the current workspace
Inside the terminal, /security status shows the same posture summary without leaving the active client session.
curl -sSf https://raw.githubusercontent.com/mwigge/milliways/master/install.sh | bash
Auto-detects your distro and installs the right package. On macOS also installs MilliWays.app to /Applications.
The installer attempts to set up optional features in one shot: MemPalace (project memory), python-pptx (/pptx), CodeGraph (code intelligence), and the agent toolkit (20+ agents + 50+ skills). Native packages can also auto-detect the app-managed tool locations under /usr/share/milliways. Verify the actual local state with:
milliwaysctl check
Installation binaries tested for: Ubuntu 24.04 · Fedora 41 · Arch Linux · macOS (arm64 + amd64)
Each release ships .deb, .rpm, and .pkg.tar.zst packages containing all three binaries (milliways, milliwaysd, milliwaysctl) installed to /usr/bin. The one-liner picks the right one automatically, or install directly:
| Distro | Command |
|---|---|
| Ubuntu / Debian | dpkg -i milliways_VERSION_amd64.deb |
| Fedora / RHEL | rpm -i milliways-VERSION-1.x86_64.rpm |
| Arch Linux | pacman -U milliways-VERSION-1-x86_64.pkg.tar.zst |
Download from Releases.
Install priority (one-liner):
dpkg / rpm / pacmangit, go, gcc)git clone https://github.com/mwigge/milliways.git
cd milliways
./install.sh
go install github.com/mwigge/milliways/cmd/milliways@latest
milliwaysctl upgrade # upgrade to latest release
milliwaysctl upgrade --check # check if a newer version is available without installing
Or use the slash command inside the REPL:
/upgrade
.deb / .rpm / .pkg.tar.zst)/usr/bin/
milliways # chat and one-shot CLI
milliwaysd # background daemon
milliwaysctl # ops and install tool
/usr/share/milliways/scripts/
install_local.sh # local model server installer
install_local_swap.sh # llama-swap installer (hot swap)
install_feature_deps.sh # MemPalace, CodeGraph, python-pptx installer
upgrade.sh # package/binary refresh helper used by milliwaysctl upgrade
/usr/share/milliways/python/
bin/python # app-managed Python venv for MemPalace + /pptx
/usr/share/milliways/node/
bin/codegraph # app-managed CodeGraph when not already installed
~/.local/bin/
milliways
milliwaysd
milliwaysctl
~/.local/share/milliways/scripts/
install_local.sh
install_local_swap.sh
install_feature_deps.sh
upgrade.sh
~/.local/share/milliways/python/
bin/python
~/.local/share/milliways/node/
bin/codegraph
~/.config/milliways/
local.env # persisted settings (/login, /path, /model etc.)
~/.local/state/milliways/
sock # daemon Unix socket (milliwaysd creates this)
metrics.db # SQLite metrics store (OTel + cost tracking)
observe.cur # latest compact UI/observability snapshot
history/<runner>.ndjson # bounded daemon event history per runner
~/.local/share/milliways/models/ # (after /install-local-server)
*.gguf # downloaded model files
~/.mempalace/ # user-writable MemPalace data store
MilliWays.app is a native macOS terminal built on a patched wezterm. Every new window opens a split workspace: the color-coded client navigator sits in the upper-left pane, the compact observability cockpit sits in the lower-left pane, and the main prompt stays on the right. The title bar is kept as MilliWays:<current path>.
┌ clients ───────────┐┌ prompt ───────────────────────────────────────┐
│ ● claude ready ││ claude ▶ │
│ ● minimax active ││ │
├ observability ─────┤│ │
│ span ok 0.5ms ││ │
│ tok 1.2k/340 ││ │
└────────────────────┘└────────────────────────────────────────────────┘
Ctrl+Space)| Key | Action |
|---|---|
a | Open milliways pane split below |
1 … 9 | Switch to the corresponding runner |
r | Resume modal — shows wake summary, re-opens last agent |
k | Context overlay |
w | Observability render overlay |
z | Plain shell tab (escape hatch) |
When the laptop wakes from sleep, the status bar shows an orange woke Xm ago badge for 5 minutes. Press Ctrl+Space r to see a resume modal and optionally reopen the last runner session.
Start the AI terminal with milliways (default when no arguments are given). The launcher starts milliwaysd if needed, then execs milliways-term.
milliways v1.0.1
/login [client] set up auth /help show all commands /exit quit
/1 berget /2 minimax /3 claude /4 codex /5 copilot /6 kimi /7 deepseek /8 gemini /9 local /10 pool
▶ /claude
→ claude model: claude-opus-4-5 (claude CLI)
[claude] ▶ explain the auth flow
...streaming...
($0.02 · 1.2k→0.8k tok)
Session state is split deliberately:
| State | Persistence |
|---|---|
| Current REPL turn log | In memory for the active milliways process |
/history daemon events | Persisted per runner in ~/.local/state/milliways/history/*.ndjson with a bounded retention window |
| Metrics, cost, latency, errors | Persisted in ~/.local/state/milliways/metrics.db |
| Login, model, path, and local settings | Persisted in ~/.config/milliways/local.env |
| Project memory and takeover handoff | Persisted through MemPalace when configured |
| Legacy/headless named sessions | Persisted through the pantry/checkpoint path |
Context fragments expand inline before dispatch: @file, @git, @branch, @shell.
Tab completion is available for all commands. Type / and press Tab to see the full list; commands are filtered as you type.
Routing
| Command | Description |
|---|---|
/berget /minimax /claude /codex /copilot /kimi /deepseek /gemini /local /pool | Switch to a runner |
/1 … /10 | Numeric shortcut for the runner list |
/switch <runner> | Same as /<runner> |
/model | Show active model and available choices (fetched live from the provider API) |
/model <name> | Switch model for the active runner |
/agents | Show all runners with auth status |
Session context
| Command | Description |
|---|---|
/ring [r1,r2,...] | Show or set the auto-rotation ring; /ring off disables |
/history | Show the current in-memory turn log and recent daemon history |
/cost | Token usage per runner (last hour) |
/retry | Re-send the last user prompt |
/undo | Drop the last user + assistant turn pair |
/compact | Summarise the session with the active runner, replace turn log with the summary |
/clear | Wipe the local turn log |
/quota | Raw quota snapshot from daemon |
/login [client] | Auth setup — API key prompt or CLI steps |
/metrics | Live rolling metrics table (1min / 1h / 24h / 7d / 30d) |
Artifacts (all runners)
| Command | Description |
|---|---|
/pptx <topic> | Ask the active runner to generate a python-pptx script; validated via Python AST before execution, saved to cwd |
/drawio <topic> | Ask the active runner to generate draw.io XML, save .drawio to cwd |
/review [focus] | Get git diff HEAD and ask the active runner to review it |
Local-model bootstrap
| Command | Description |
|---|---|
/install-local-server | Install or refresh rs-llmctl + the default local model, generate a local API key, restart services, and switch to /local |
/install-local-gpu-server | Detect NVIDIA/AMD/macOS GPU memory, install the largest fitting curated model through rs-llmctl, restart services, and switch to /local |
/install-local-swap | Install and activate llama-swap for existing llama-server workers |
/list-local-models | Show models the backend serves |
/switch-local-server <kind> | Switch backend: rs-llmctl | llama-server | llama-swap | ollama | vllm | lmstudio |
/download-local-model <repo> | Fetch a GGUF from HuggingFace |
/setup-local-model <repo> | Download, register for llama-swap, and activate/update the current local server when possible |
OpenSpec
| Command | Description |
|---|---|
/opsx-list | List OpenSpec changes |
/opsx-status <change> | Show change progress |
/opsx-show <change> | Show full change detail |
/opsx-archive <change> | Archive a completed change |
/opsx-validate <change> | Validate a change |
Client-native commands
Some runners expose their own slash commands that milliways passes through directly. These appear in tab completion when the runner is active.
| Runner | Native commands |
|---|---|
| copilot | /diff /pr /review /plan /delegate /research /resume /compact /share |
| pool | /mode |
| claude | /compact /clear |
| codex | /compact |
| gemini | /clear /chat |
System
| Command | Description |
|---|---|
/help | Show all commands |
/exit | Exit (Ctrl+D also works) |
!<cmd> | Run a shell command inline |
Install clients
/install claude # install claude CLI
/install codex # install codex CLI
/install copilot # install copilot CLI
/install gemini # install gemini CLI
/install local # install local model server
/install berget # configure BERGET_API_KEY (HTTP runner, no CLI)
The primary milliways UX is milliways-term (a wezterm-based terminal where every tab opens milliways). Slash commands inside any tab dispatch via milliwaysctl — see cmd/milliwaysctl/README.wezterm.md for the Leader + / palette. The CLI surface below exists for scripting, one-shot prompts, and CI — when you don't want to open the AI terminal.
# One-shot prompts
milliways "explain the auth flow" # route to best kitchen via sommelier
milliways -k claude "review this" # force a specific kitchen (--kitchen)
milliways -e "refactor store.py" # show routing decision; do not execute (--explain)
milliways -v "design JWT middleware" # print sommelier reasoning to stderr (--verbose)
milliways -j "explain this" # structured JSON output for scripting (--json)
milliways -r <recipe> "prompt" # run a named multi-course recipe (--recipe)
milliways --async "long-running job" # dispatch in background; returns a ticket ID
milliways --detach "long-running job" # dispatch detached so it survives shell exit
milliways --session <name> "follow-up" # resume a named session
milliways --switch-to claude --session foo # rebind a session to a different kitchen
milliways --timeout 10m "long task" # override the 5m default dispatch timeout
# Editor / IDE integration
milliways --context-stdin "..." # read editor context bundle JSON from stdin
milliways --context-file ctx.json "..." # read editor context bundle JSON from a file
milliways --context-json '{...}' "..." # pass the bundle directly on the CLI
# Subcommands
milliways status # kitchen availability + pantry health + ledger stats
milliways setup <kitchen> # install + authenticate a kitchen
milliways login <kitchen> # authenticate to a kitchen
milliways login --list # show auth status for every kitchen
milliways report # ledger routing statistics
milliways report --tiered # tiered-CLI performance analysis
milliways init # initialise a new milliways config
milliways mode # show / set the current routing mode
milliways trace # OTel trace inspection
milliways pantry ... # pantry (quota / ledger) management
milliways ticket <id> # inspect an async-dispatch ticket
milliways tickets # list all async tickets
milliways rate # rate limit inspection
See milliways --help for the canonical authoritative flag/subcommand list. The legacy --repl built-in line-reader was removed in this release; the milliways-term path is now the only interactive surface.
Agent runners (used in the AI terminal with /switch or shorthand /claude, /codex etc.):
| Runner | Color | Best At | Cost |
|---|---|---|---|
| berget | orange | General purpose, fast responses (berget.ai) | Cloud |
| minimax | purple | Reasoning, image/music/lyrics generation | Cloud |
| claude | green | Thinking, planning, code review | Cloud |
| codex | amber | Agentic coding, tool use | Cloud |
| kimi | blue | Long-context coding and agent tasks | Cloud |
| deepseek | green | Cost-efficient coding and reasoning | Cloud |
| copilot | red | GitHub Copilot chat | Subscription |
| pool | cyan | Large codebase navigation, ACP agent | Cloud |
| gemini | blue | Research, web search, 1M-token context | Free tier |
| local | green | Offline coding on your laptop (Qwen, DeepSeek, …) | Free, runs locally |
CLI kitchens (routed by the sommelier in headless mode):
| Kitchen | CLI | Best At | Cost |
|---|---|---|---|
| claude | claude | Thinking, planning, review | Cloud |
| opencode | opencode run | Coding, testing | Local ($0) |
| gemini | gemini | Research, search | Free |
| aider | aider --message | Multi-file editing | Cloud/Local |
| goose | goose | MCP tools, databases | Local |
| cline | cline -y --json | Parallel fleet | Cloud |
Milliways wraps each AI CLI as a first-class runner. They all speak the same interface internally — you switch between them with /claude, /codex, /pool etc. and milliways handles context injection, history, and output streaming the same way for all of them.
you milliways runner (claude / codex / pool / …)
│ │ │
│ "explain auth" │ │
├─────────────────────>│ │
│ │ inject history │
│ │ + rules + context │
│ ├─────────────────────────>│
│ │ │ ● Read auth/middleware.go
│ streamed output │ stream tokens │ ● Bash go test ./...
│<─────────────────────┤<─────────────────────────│
│ │ │
│ │ session limit? │
│ │ ────────────── │
│ │ /ring active? │
│ │ yes → rotate to next │
│ ├─────────────────────────>│ (next runner)
When a runner hits a context or quota limit, milliways rotates to the next available runner in your ring and skips exhausted ones. Re-run your prompt (or /retry) on the new runner to continue where you left off.
Website: claude.ai/code
Claude Code is probably the strongest all-rounder in the lineup. It has the deepest tool-use loop (Bash, file read/write, MCP servers, computer use), a thinking mode for hard problems, and three reasoning levels you can dial up or down. If you're doing architecture reviews, debugging gnarly issues, or anything that needs genuine reasoning over a lot of context — this is your runner.
milliways feeds it history and rules as synthetic input turns over --input-format stream-json, and parses --output-format stream-json for progress lines and cost tracking.
▶ /claude
▶ /model claude-opus-4-7 # switch model live
Website: github.com/openai/codex
Codex is OpenAI's open-source agentic coding CLI. Its standout feature is the sandbox: every shell command and file edit runs inside a configurable approval policy, which you can set to fully autonomous (auto-edit or none) for unattended runs. It emits structured JSON events that milliways parses for the same ● ToolName detail progress display used for Claude.
Good pick for: autonomous coding tasks where you want tight sandboxing control.
▶ /codex
▶ /model o4-mini # switch model live; list fetched from OpenAI API
Website: minimaxi.com
MiniMax is the odd one out in a good way — it's the only runner that does text, image, music, lyrics, and speech generation all through the same API. The M2.7 model handles reasoning and code fine, but the real reason you'd reach for it is when a task crosses into creative or multimodal territory that the other runners can't touch.
milliways connects to the MiniMax HTTP API directly (no CLI wrapper), so you configure it in carte.yaml rather than pointing at a binary.
kitchens:
minimax:
http_client:
base_url: https://api.minimax.io/v1
auth_key: MINIMAX_API_KEY
model: MiniMax-M2.7
▶ /minimax
▶ /model MiniMax-M2.7 # switch model live; list fetched from MiniMax API
Website: platform.kimi.ai
Kimi is an OpenAI-compatible HTTP runner backed by Moonshot AI. Milliways uses the same streaming/tool-loop contract as MiniMax: token usage is parsed from SSE chunks, model-requested tools run through the MilliWays registry, and /model switches KIMI_MODEL live.
▶ /login kimi # sets KIMI_API_KEY
▶ /kimi
▶ /model kimi-k2.6
Website: api-docs.deepseek.com
DeepSeek is an OpenAI-compatible HTTP runner for cost-efficient coding and reasoning. The default model is deepseek-v4-flash; /model switches DEEPSEEK_MODEL live, and token/cost metrics are emitted on chunk_end.
▶ /login deepseek # sets DEEPSEEK_API_KEY
▶ /deepseek
▶ /model deepseek-v4-flash
Website: github.com/features/copilot
Copilot's edge is GitHub integration. It runs agentic sessions with native awareness of pull requests, issues, and repository metadata — which makes it unusually useful for tasks like "summarise what changed in this PR" or "write a release note from these commits". Requires a Copilot subscription; scoped to repos the authenticated GitHub account can access.
milliways runs copilot -p <prompt> --allow-all-tools --add-dir <cwd>, with the working directory pinned to prevent it from wandering into system paths.
▶ /copilot
milliways login copilot # auth via GitHub
Website: poolside.ai
Pool is Poolside's coding agent, built on ACP (Agent Communication Protocol) — an open standard for agentic clients that is also used by Gemini. Pool is tuned for large, complex codebases: it indexes your project at session start and keeps a structural understanding of it across turns. The non-interactive pool exec mode supports model and session-mode selection.
milliways runs pool exec -p <prompt> --unsafe-auto-allow with optional --model and --mode.
▶ /pool
▶ /mode plan # plan mode — read-only, no writes (forwarded to pool CLI)
pool login # auth (run once)
Website: github.com/google-gemini/gemini-cli
Gemini's headline number is its context window — 1 million tokens, the largest of any runner milliways supports. That means you can point it at a big codebase or document set and it can read the whole thing in one shot. It also has native Google Search integration, which makes it a natural first pick for research-heavy prompts. The free tier is generous enough that many workloads run at zero cost.
milliways runs gemini -p <prompt> -y (-y auto-approves all tool actions — equivalent to other runners' yolo/unsafe modes).
▶ /gemini
▶ /model gemini-2.5-pro # switch model live; list fetched from Google API
gcloud auth login # auth (run once)
Website: github.com/mwigge/rs-llmctl · unsloth.ai · github.com/ggml-org/llama.cpp
The local runner is for when the wifi is down, the bill is up, or you just want to know what these things actually do without a credit card in the loop. It talks to any OpenAI-compatible endpoint — by default the built-in installer provisions rs-llmctl on http://localhost:8765/v1 with a generated local API key, while llama-swap, vLLM, LMStudio, Ollama, and raw llama.cpp endpoints remain compatible.
▶ /local
▶ /list-local-models # list models the backend serves
▶ /model qwen3-8b # switch model live
There's a full chapter further down — see Local models for architecture, hot-swap setup, memory budgeting, and troubleshooting.
~/.config/milliways/carte.yaml:
kitchens:
claude:
cmd: claude
args: ["-p"]
stations: [think, plan, review, explore]
cost_tier: cloud
daily_limit: 50
five_hour_limit: 15 # rolling 5-hour window
weekly_limit: 200
minimax:
http_client:
base_url: https://api.minimax.io/v1
auth_key: MINIMAX_API_KEY # env var name or literal key
model: MiniMax-M2.7
daily_limit: 100
routing:
keywords:
explain: claude
code: opencode
search: gemini
default: claude
budget_fallback: opencode
Without a config file, milliways uses sensible defaults for all kitchens.
The sommelier picks the kitchen using three tiers:
$ milliways --explain --verbose "refactor store.py"
[sommelier] learned: claude succeeded 94% for refactor
Kitchen: claude Tier: learned Risk: high
Type /<runner> or /switch <runner> to move the visible workspace to a different runner mid-session; this changes which runner you're talking to without carrying a briefing. To hand off with context, use /takeover <runner>: in the same REPL process, milliways builds a structured briefing from the recent turn log and folds it into that runner's next user prompt, so HTTP runners do not answer the briefing as a separate turn. Cross-pane takeover uses MemPalace handoff when project memory is configured; without it, the takeover still works but only has the context available in the current process.
[briefing from claude → codex]
Recent exchange:
user: implement the auth middleware
claude: Added JWT validation...wrote unit tests...
Continue from here. The user's next prompt follows.
Configure a priority ring and milliways auto-rotates when a runner hits its session limit, quota, or context window — for all first-class runners:
▶ /ring claude,codex,minimax,pool # set rotation order
▶ /ring # show ring + which runners are exhausted
▶ /ring off # disable auto-rotation
When claude hits its limit the terminal shows:
⚑ claude session limit — rotating to codex
→ codex model: o4-mini (codex CLI)
[codex] ▶ ▌
milliways switches you to the next available runner and skips exhausted ones automatically — re-run your prompt (or /retry) on it to continue. The exhausted set clears on each new user prompt so runners become available again after a cooling period.
For berget, minimax, kimi, deepseek, and local (HTTP runners with a 100-turn agentic loop), hitting the limit triggers a structured summarisation before rotation:
────────────────────────────────────────
⚑ Reached the 100-turn agentic limit.
────────────────────────────────────────
[summarisation streams here]
⚑ minimax session limit — rotating to local
▶ /takeover codex # switch and carry a structured briefing
▶ /switch codex # switch the visible runner (no briefing)
▶ /compact # summarise + shrink the turn log first
▶ /clear # wipe log for a clean start
milliways keeps the terminal tab and title bar in sync with what it's doing.
| State | Tab | Window title bar |
|---|---|---|
| Switch to runner | ● claude · sonnet-4-6 | milliways · claude |
| Prompt sent | unchanged | milliways · claude · thinking… |
| First token | unchanged | milliways · claude · streaming… |
| Response done | unchanged | milliways · claude · $0.0218 session · 1200→340 tok |
| Ring rotation | ↻ codex | milliways · rotating → codex |
| Runner error | unchanged | milliways · claude (resets to ready) |
| Exit | milliways | milliways |
The window title shows cumulative session cost rather than per-response cost, so a glance at the title bar answers "how much have I spent this session?" The inline hint line ($0.0041 · 1200→340 tok) under each response still shows the per-turn breakdown.
MilliWays.app keeps the operational view visible in the lower-left pane while the right pane stays reserved for the prompt and streamed output. The cockpit is intentionally compact and refreshes in place:
| Signal | Source | What it means |
|---|---|---|
| Latest span | observability.subscribe | Last operation performed (e.g., "claude › chat", "minimax › tool:Bash") |
| Tokens in/out | daemon status and quota snapshots | Input and output token counts for the current session |
| Cost | persisted runner metrics | Running cost total for the session |
| Time to limit | quota burn rate when a quota cap is configured | Estimated time until you hit your daily/usage limit |
| Latency | recent span durations | How long the last operation took |
If no quota cap or burn rate exists yet, time-to-limit is shown as not available rather than guessed.
All session data is stored locally in ~/.local/state/milliways/:
| Data | Location | How to access |
|---|---|---|
| Metrics | ~/.local/state/milliways/metrics.db | milliwaysctl metrics, /metrics in REPL |
| Traces (spans) | stdout (JSON, when MILLIWAYS_OTEL_ENDPOINT unset) or your OTel collector | milliways 2>&1 | jq 'select(.Name)' or configure an endpoint |
| Event history | ~/.local/state/milliways/history/*.ndjson | /history in REPL |
| Daemon logs | stdout of the milliwaysd process | Check your terminal where daemon started |
| Security audit | daemon policy decisions | milliwaysctl security audit or /security audit |
| Quotas | daemon quota snapshots | milliwaysctl quota or /quota in REPL |
To export traces to a collector (Jaeger, Tempo, Honeycomb, etc.):
export MILLIWAYS_OTEL_ENDPOINT=http://localhost:4318
# or persist via:
/login MILLIWAYS_OTEL_ENDPOINT http://localhost:4318
Without MILLIWAYS_OTEL_ENDPOINT set, spans are written to stdout in JSON format.
/metrics (in the REPL) or milliwaysctl metrics (CLI) shows a live rolling table of tokens, cost, and errors across five time windows for every runner:
milliways metrics (refreshes every 5s — Ctrl+C to exit)
runner │ 1 min 1 hour 24 hours 7 days 30 days
───────────┼──────────────────────────────────────────────────────────────────────────
claude │ 2.1k/0.8k $0.02 18k/6k $0.18 42k/14k $0.41 210k/70k $2.05 …
codex │ — 4.2k/1.1k $0.04 — 8k/2k $0.07 …
minimax │ 8k/3k $0.01 — 31k/11k $0.28 … …
gemini │ — — — — …
local │ 1.2k/0.4k — 4k/1.5k — — — …
pool │ — — — — …
copilot │ — — — — …
───────────┼──────────────────────────────────────────────────────────────────────────
total │ 11k/4k $0.03 26k/9k $0.22 73k/25k $0.69 218k/72k $2.12 …
columns: tokens_in / tokens_out cost_usd (— = no activity in window)
▶ /metrics # in the REPL (one-shot table)
milliwaysctl metrics # same, one-shot
milliwaysctl metrics --watch # live refresh every 5s
milliwaysctl metrics --agent claude --tier hourly # filter to one runner + tier
Time windows map to the metrics store tiers:
| Column | Tier | Range |
|---|---|---|
| 1 min | raw | last 60 seconds |
| 1 hour | raw | last 60 minutes (rolling, not wall-clock) |
| 24 hours | hourly | last 24 hourly buckets |
| 7 days | daily | last 7 daily buckets |
| 30 days | daily | last 30 daily buckets |
/quota shows a compact per-agent summary (last hour) without the full table.
Milliways follows the OpenTelemetry Semantic Conventions for Generative AI on all runners.
Span hierarchy:
gen_ai.client.operation (per dispatch)
gen_ai.system = "berget" | "anthropic" | "openai" | "google" | "minimax" | "moonshot" | "deepseek" | "poolside" | "local"
gen_ai.operation.name = "chat"
gen_ai.request.model = "claude-opus-4-5"
gen_ai.usage.input_tokens = 1200
gen_ai.usage.output_tokens = 450
gen_ai.response.finish_reasons = ["stop"]
│
└── gen_ai.execute_tool (per tool call, HTTP runners only)
gen_ai.tool.name = "Bash" | "Read" | "Edit" | "WebFetch" | …
gen_ai.tool.type = "function"
milliways.tool.blocked = false
milliways.tool.duration_ms = 142
CLI runners (claude, codex, copilot, gemini, pool) emit one span per subprocess invocation. HTTP runners (berget, minimax, kimi, deepseek, local) emit one parent span per dispatch plus one child span per tool call in the agentic loop.
Configure the OTel export:
# Export to Jaeger, Tempo, Honeycomb, or any OTLP-compatible collector
export MILLIWAYS_OTEL_ENDPOINT=http://localhost:4318
Set it once with /login MILLIWAYS_OTEL_ENDPOINT http://localhost:4318 and it persists across restarts in ~/.config/milliways/local.env.
Without MILLIWAYS_OTEL_ENDPOINT set, spans are written to stdout in JSON — useful for local debugging with milliways 2>&1 | jq 'select(.Name)'.
The daemon stores all metrics in a SQLite database (~/.local/state/milliways/metrics.db) with automatic rollup from raw 1-second rows into hourly, daily, weekly, and monthly aggregates. Query it directly:
milliwaysctl metrics --metric tokens_in --tier daily --range -30d
milliwaysctl metrics --metric cost_usd --tier hourly --agent claude
milliwaysctl metrics --metric error_count --tier raw --range -1h
Available metrics: tokens_in, tokens_out, cost_usd, error_count, dispatch_count, dispatch_latency_ms.
External Postgres support is planned as a contracted server deployment option for teams that need shared policy, router, and metrics state. SQLite remains the local default. The Postgres deployment contract will preserve the same rollup tiers, policy audit semantics, and local/offline behavior instead of becoming a separate product mode.
The installer provisions fixed tool locations under the install share directory:
/usr/share/milliways for native packages, or ~/.local/share/milliways for the fallback one-liner install. MemPalace data stays in the user-writable ~/.mempalace directory. Optional feature setup is best-effort during package install; run milliwaysctl check after installation to verify the local feature state.
export MILLIWAYS_MEMPALACE_MCP_CMD="/usr/share/milliways/python/bin/python"
export MILLIWAYS_MEMPALACE_MCP_ARGS="-m mempalace.mcp_server --palace ~/.mempalace"
export MILLIWAYS_CODEGRAPH_MCP_CMD="/usr/share/milliways/node/bin/codegraph"
export MILLIWAYS_CODEGRAPH_MCP_ARGS="serve"
Those env vars are written automatically for one-liner installs when feature setup completes. Native package installs can also be auto-detected from /usr/share/milliways without user config.
CodeGraph provides live symbol search and call-graph context. After installing, index your workspace:
milliwaysctl codegraph index # index current directory
milliwaysctl codegraph index /path # index a specific path
Or use the slash command inside the REPL:
/repoindex
The indexed path is written to MILLIWAYS_CODEGRAPH_WORKSPACE in ~/.config/milliways/local.env and picked up automatically on the next prompt. If .codegraph/ is missing, project startup marks CodeGraph as indexing/unavailable and continues without blocking the prompt.
The local runner exists for offline work, privacy-sensitive prompts, and the simple case of "I just want a coder to autocomplete this". It speaks the OpenAI-compatible Chat Completions protocol. The built-in single-model installer now provisions rs-llmctl as the default local control plane, while llama-swap, vLLM, LMStudio, and Ollama's /v1 shim remain compatible backends.
We default to Unsloth dynamic quants because they consistently produce better quality-per-byte than vanilla GGUF (15–30% faster generation, noticeably better code output, especially on smaller models where every bit matters).
There are two deployment shapes, picked by which installer you ran:
┌─────────────────────────────────────┐
│ milliways (/local runner) │
│ POST /v1/chat/completions │
└──────────────────┬──────────────────┘
│
MILLIWAYS_LOCAL_ENDPOINT (default :8765)
│
┌───────────────────────┴────────────────────────┐
│ │
single-server (install_local.sh) swap (install_local_swap.sh)
│ │
┌─────────▼──────────┐ ┌──────────▼──────────┐
│ rs-llmctl │ │ llama-swap proxy │
│ one model loaded │ │ routes by model id │
│ generated API key │ │ llama.cpp workers │
│ port 8765 │ │ port 8765 │
└────────────────────┘ └────┬───────┬───────┘
│ │
┌────────────▼───┐ ┌─▼──────────────┐
│ llama-server │ │ llama-server │
│ qwen-1.5b │ │ deepseek-lite │
│ :9100 │ │ :9101 │
└────────────────┘ └────────────────┘
install_local.sh | install_local_swap.sh (standby) | install_local_swap.sh (HOT_MODE=1) | |
|---|---|---|---|
| Models served | one | many | many |
| Switch latency | restart server (~10s + load) | first hit cold (~5–15s), then warm | sub-second always |
| RAM at rest | one model | none after TTL expires | every model resident |
| Best for | one workload, lowest moving parts | mixed workloads on a memory-tight box | mixed workloads on a roomy box |
For GPU machines, use /install-local-gpu-server --dry-run first. MilliWays reads NVIDIA via nvidia-smi, AMD via Linux DRM sysfs/rocm-smi, and macOS via system_profiler plus unified-memory sizing. It keeps safety headroom for the GGUF, KV cache, graph buffers, desktop apps, and OS memory, then installs the largest curated GGUF inside a conservative budget. Acceleration defaults to CUDA when a CUDA toolchain is present, HIP when ROCm/HIP is present, Vulkan as the Linux fallback, and Metal on macOS. You can force Linux acceleration with --accel vulkan|cuda|hip.

| Hardware | Automatic path | Likely fit | Notes |
|---|---|---|---|
| 8 GB system or unified memory | /install-local-server or /setup-model unsloth/Phi-3.5-mini-instruct-GGUF | Phi-3.5-mini / Mistral-7B | Keep context modest and avoid hot-loading several models. |
| 16 GB NVIDIA/AMD GPU | /install-local-gpu-server | Qwen3-8B Q4_K_M | CUDA/HIP when available, otherwise Vulkan. This is the common balanced local default. |
| 24 GB+ NVIDIA/AMD GPU | /install-local-gpu-server | Qwen3-14B or DeepSeek-Coder-V2-Lite when the budget fits | Larger models improve planning and review, but cold starts and VRAM pressure increase. |
| Apple Silicon 16 GB+ | /install-local-gpu-server | Qwen3-8B or Qwen3-14B depending unified memory | Metal acceleration, with unified-memory headroom kept for macOS and apps. |

| Model | Size (Q4_K_M) | Best use | Tradeoff |
|---|---|---|---|
| Phi-3.5-mini | 2.2 GB | Small machines and quick offline prompts | Lowest memory use, weaker reasoning. |
| Mistral-7B-v0.3 | 4.1 GB | Fast edits and light chat | Good latency, less specialized for code. |
| Qwen2.5-Coder-7B | 4.7 GB | Code edits on modest GPUs | Strong coder, XML tools are translated by MilliWays. |
| Hermes-3 / Llama-3.1 8B | 4.9 GB | Agentic/tool use | Native OpenAI tool calls, less code-specialized than coder models. |
| Qwen3-8B | 5.2 GB | Balanced local coding and reasoning | Great 16 GB GPU fit, slower than smaller 7B-class models. |
| Qwen3-14B | 9.3 GB | Stronger planning and review | Needs more memory and a longer cold load. |
| DeepSeek-Coder-V2-Lite | 9.0 GB | Complex code refactors | MoE quality, but heavier operationally. |
In hot mode you need RAM for the sum of every model you want resident, plus OS and desktop headroom. A 24 GB machine can usually keep one 7B-class coder warm; adding a 14B or MoE model on top should be treated as a deliberate memory tradeoff.
The fastest path uses milliwaysctl local from any milliways-term tab — no leaving the terminal, no hand-editing yaml.
Single model (simplest):
milliwaysctl local install-gpu-server --dry-run
milliwaysctl local install-gpu-server # GPU-aware model pick, service restart, /local activation
# Or on CPU-only / very small machines:
milliwaysctl local install-server
milliways # /local is now ready to use
In milliways-term, the same flow is available via the Leader + / palette: press Ctrl+Space then /, pick local install-gpu-server or local install-server, hit Enter. A new tab spawns the install with output streaming inline.
The ready path is intentionally strict. The installer downloads or reuses the model cache, refreshes the launcher and service files, restarts the local backend, restarts milliwaysd, prints Waiting for services to finish installation, and only prints /local is ready after both the OpenAI-compatible model endpoint and the daemon socket accept connections.
install-server resolves rs-llmctl in this order: RS_LLMCTL_BIN when set, llmctl on PATH, a local checkout from RS_LLMCTL_LOCAL_REPO or a sibling ../rs-llmctl directory, then the published mwigge/rs-llmctl release pinned by RS_LLMCTL_VERSION (default v1.2.1).
Hot-swap between several llama.cpp models:
milliwaysctl local install-server # first model
milliwaysctl local download-model unsloth/Qwen2.5-Coder-7B-Instruct-GGUF
# install llama.cpp's llama-server before enabling llama-swap
milliwaysctl local install-swap --hot # warm every model at startup
# Or for memory-safe (unload after idle):
milliwaysctl local install-swap # standby
The swap path uses llama-swap with llama-server workers, so llama-server must already be on PATH. Use /install-local-server for the rs-llmctl single-model default when you do not need live multi-model routing.
milliwaysctl local setup-model <repo> composes the download + llama-swap config registration + verification in one shot — useful for adding a new model to an already-running swap proxy.
milliwaysctl local switch-server <kind> writes ~/.config/milliways/local.env to point milliways at rs-llmctl, llama-server, llama-swap, ollama, vllm, or lmstudio without re-installing anything.
milliwaysctl local list-models prints what the active backend is currently serving (handy after a setup-model to confirm registration took).
The installer drops launchd plists (macOS) or systemd-user units (Linux) bound to port 8765, so the active single-model server or swap proxy comes back up after reboot.
Fallback (the old script-direct flow): the underlying scripts are still callable for CI or air-gapped setups: ./scripts/install_local.sh and ./scripts/install_local_swap.sh. milliwaysctl local install-server and install-swap wrap those scripts; the other local verbs are ctl-native helpers around endpoint config, model catalogues, server status, and model activation.
These dispatch to milliwaysctl local <verb> via the milliways-term Leader + / palette (Ctrl+Space then /). Pick from the list, fuzzy-filter by typing, hit Enter — or invoke milliwaysctl local <verb> directly in any tab. New shortcuts are added to the palette when the alias table is updated.
| Command | Underlying ctl | Action |
|---|---|---|
/install-local-server | milliwaysctl local install-server | install or refresh rs-llmctl + the default local model, generate a local API key, restart local services, wait for readiness, and switch to /local |
/install-local-gpu-server | milliwaysctl local install-gpu-server | detect NVIDIA/AMD/macOS GPU memory, pick the largest fitting curated model, configure rs-llmctl, restart services, wait for readiness, and switch to /local; add `--accel vulkan |
/install-local-swap | milliwaysctl local install-swap | install and activate llama-swap for existing llama-server workers (memory-safe, unloads on TTL); add --hot to warm every model at startup |
/list-local-models | milliwaysctl local list-models | list models the active backend serves (hits /v1/models) |
/switch-local-server <kind> | milliwaysctl local switch-server <kind> | rebind milliways to rs-llmctl / llama-server / llama-swap / ollama / vllm / lmstudio |
/download-local-model <repo> | milliwaysctl local download-model <repo> | curl a GGUF from HuggingFace into $MODEL_DIR |
/setup-local-model <repo> | milliwaysctl local setup-model <repo> | download → idempotent insert into ~/.config/milliways/llama-swap.yaml → activate/update the current local server when possible → verify |
Advanced maintenance verbs are available from milliwaysctl local: server-status, server-start, server-stop, server-port, server-uninstall, swap-mode, default-model for llama-swap installs, and review-code.
All standard milliways commands work with local. The runner-prefixed forms are still available for muscle memory; the contextual forms work across every runner.
| Command | Action |
|---|---|
/local | switch active runner to local |
/models | list models the backend serves (contextual; same as /list-local-models) |
/model <alias> | switch model (contextual) |
/local-endpoint <url> | point at a different OpenAI-compatible backend (persists across daemon restarts) |
/local-temp <0.0–2.0|default> | sampling temperature; default lets the server choose |
/local-max-tokens <N|off> | cap reply length; off means unlimited |
/local-hot on|off | warm every advertised model (on) or let llama-swap evict on TTL (off) |
/ring claude,local,gemini | set the auto-rotation ring — local works just like cloud runners |
| Variable | Default | Purpose |
|---|---|---|
MILLIWAYS_LOCAL_ENDPOINT | http://localhost:8765/v1 | Where the OpenAI-compatible API lives |
MILLIWAYS_LOCAL_MODEL | installer-selected, default qwen2.5-7b | Initial model id sent in every request |
MILLIWAYS_LOCAL_API_KEY | generated by install-server | Sent as Authorization: Bearer … for rs-llmctl and other strict OpenAI-compatible backends |
MILLIWAYS_LOCAL_TEMP | default (server picks) | Sampling temperature — set via /local-temp; default omits the field |
MILLIWAYS_LOCAL_MAX_TOKENS | off (unlimited) | Cap reply length — set via /local-max-tokens; off omits the field |
Temperature controls how random the model's next-token pick is. The model assigns a probability to every possible next word; temperature divides those scores before sampling — lower temperature sharpens the distribution toward the most-likely token, higher temperature flattens it so unlikely words can win.
| Temperature | Behaviour | When to use |
|---|---|---|
0.0 | Always picks the most-likely token | Deterministic test fixtures; some local models loop at exactly 0 — pick 0.1 if so |
0.2 | Almost always the top pick, with rare deviations | Coding, refactoring, anything where correctness > creativity |
0.7 | Balanced — varied but coherent | Chat, summarisation, commit messages |
1.0+ | More creative, more error-prone | Brainstorming, drafting prose |
1.5+ | Often incoherent | Rarely useful |
Switch at runtime with /local-temp 0.7 or /local-temp default (lets the server pick). The current value shows up in /switch local's settings dump, so you can always check what's active.
HTTP 401: Authorization header missing or malformed — either milliways is missing the generated MILLIWAYS_LOCAL_API_KEY from ~/.config/milliways/local.env, or something else (often a corp SSH tunnel or Spring Boot dev service) is bound to port 8765 and milliways is talking to it. Check ~/.config/milliways/local.env, then find port conflicts with lsof -i :8765, kill the stale process, and restart milliways-local-server. The installer auto-shifts to a free port if 8765 is busy at install-time, but a tunnel started afterwards won't be detected.
Slow first prompt after idle (standby mode) — this is by design. llama-swap evicts the model after TTL_SECONDS of no traffic; the next request pays a 5–15s cold-load. Switch to hot mode (HOT_MODE=1 ./scripts/install_local_swap.sh) or run /local-hot on to keep them resident.
failed to download model from Hugging Face / Zscaler block page — corporate proxies that categorise HF as "Generative AI" often intercept Hugging Face endpoints. The installer downloads with curl; if your proxy blocks the request, request Hugging Face be allowlisted under "Developer Tools" or pre-place the GGUF in $MODEL_DIR.
/model X says "X not in backend models" — with the single-server rs-llmctl install, only the configured local GGUF is active. Run /setup-local-model <repo> or rerun /install-local-server with a different model to change it, or run install_local_swap.sh when you need multiple llama.cpp workers behind a swap proxy.
Memory pressure / OOM — drop to a smaller model (MODEL_REPO=unsloth/Phi-3.5-mini-instruct-GGUF), lower CTX_SIZE, or stay in standby mode (default for swap). top / Activity Monitor will show you which llama-server child is the heavyweight.
Local server died at startup — tail ~/.local/share/milliways/local/server.err. Most common cause: a GGUF that didn't download fully (verify size matches what HuggingFace shows) or a context size larger than the model supports (set CTX_SIZE=4096 and re-run the installer).
Secure MilliWays is the release security theme, not a separate binary and not a repository rename: all clients in one place, shared memory, shared sessions, one security layer, delivered through one security control plane.
Milliways wraps Berget, MiniMax, Claude, Codex, Copilot, Gemini, Pool, Kimi, DeepSeek, and local models behind one terminal surface. That makes the security model explicit: the runner changes, but the workspace, memory, session handoff, observability, and security posture are managed in one place.
The control-plane model is business-casual on purpose: MilliWays does the common safety work once, then shares the signal with every client. Startup scan, client profile checks, command policy, generated-output planning, scanner status, CRA evidence, and policy audit events all report through the daemon. The CLI, terminal slash commands, command shims, and observability badges read that same posture instead of asking each AI client to invent a separate view of risk.
| Layer | Surface | Purpose |
|---|---|---|
| Startup posture scan | milliwaysctl security startup-scan | Fast local scan of workspace and user persistence surfaces. The daemon runs it automatically on first startup per workspace and marks status required/stale until a current scan completes. It checks .claude/, .vscode/tasks.json, package manifests, package-manager policy, known IOC paths/domains/IPs, user systemd units, and macOS LaunchAgents. |
| Client profiles | milliwaysctl security client <name> | Per-client checks for risky configuration such as broad sandbox/write roots, auto-approval modes, unsafe local model endpoints, hooks, MCP config, and CLI path/version state. |
| Dependency scanning | milliwaysctl security scan | OSV-backed dependency findings for lockfiles and manifests, with accepted-risk tracking through security accept. |
| Command firewall | milliwaysctl security command-check -- <command...> | Pre-flight classification for package install, persistence, exfiltration, secret-read, network-download, shell-eval, IOC, and complex-unparsed command risks. |
| Output gate | milliwaysctl security output-plan | Classifies generated and staged paths into secret, SAST, and dependency scan requests before output is trusted or committed. Generated dependency files should trigger an SBOM refresh recommendation. |
| Quarantine planner | milliwaysctl security quarantine | Dry-run remediation planning for suspicious workspace files and auto-run tasks. --apply mutates safe local file actions and records the outcome; service/LaunchAgent changes require explicit operator confirmation. |
| Rule packs | milliwaysctl security rules list|update | Bundled and local rules for IOC, startup, command, package, and persistence checks. Offline mode uses local rule packs only. |
| SBOM generation | milliwaysctl security sbom --output dist/milliways.spdx.json | Offline SPDX JSON generation from local Go, Cargo, npm, pnpm, yarn, Bun, and Python manifests so CRA evidence can be produced without an external compliance service. |
| CRA evidence scaffold | milliwaysctl security cra-scaffold | Creates missing CRA evidence placeholders in a workspace: SECURITY.md, SUPPORT.md, docs/update-policy.md, and docs/cra-technical-file.md. Use --dry-run to preview and --force only when replacing existing placeholders is intentional. |
| CRA readiness | milliwaysctl security cra, /security cra | Tracks EU Cyber Resilience Act evidence: SBOM presence, vulnerability handling process, secure-by-default posture, scanner coverage, support-period metadata, and reporting readiness. CRA is a policy/evidence layer; OSV, Gitleaks, Semgrep, govulncheck, and optional NVD enrichment feed it. |
| Status and warnings | milliwaysctl security status, warnings, mode | One posture summary for CLI, terminal cockpit, and release smoke checks: mode, scanner state, shim readiness, client protected/unprotected state, startup scan required/stale state, scanner gaps, last scan times, warnings, and blocks. |
| Command shims | milliwaysctl security shims status | Broker readiness for common shells, package managers, build tools, network tools, VCS, and persistence commands. Missing broker or shim state is visible instead of silently presented as protected. |
| Policy audit | milliwaysctl security audit, /security audit | Recent command policy decisions across brokered shims, command checks, and internal Bash firewall decisions, filterable by workspace, session, client, and decision. This is the quick "what did the control plane decide?" view for release checks and incident follow-up. |
The layers are intentionally additive. Startup scan is deterministic and local; external scanners add dependency, secret, and SAST depth when installed; client profiles and command checks reduce the risk of handing unsafe work to external CLIs that execute their own tools.
For CLI clients that can inherit a controlled environment, MilliWays also generates security shims for common shells, package managers, build tools, network tools, VCS, and persistence commands. Those shims broker command decisions through the daemon before the real binary runs, then write policy events that show up in milliwaysctl security audit. They fail closed by default if the broker is unavailable; explicit fail-open is opt-in for troubleshooting.
| Surface | MilliWays can block directly | MilliWays currently warns/reports |
|---|---|---|
| HTTP/local tool-loop runners | Command firewall, workspace jail, credential denylist, SSRF guard, output gate recommendations. | Optional external scanner gaps and accepted-risk context. |
| Brokered CLI runners such as Claude, Codex, Gemini, Copilot, Pool | Daemon-side client profile checks, command shims when launched through the controlled environment, command pre-flight, startup scan status, and output/security commands. | Tool execution performed inside the external CLI itself unless the command path is brokered or the CLI exposes a controllable sandbox path. |
| Preflight-only CLI runners | Startup scan, client profile checks, scanner status, output/security commands, and visible preflight-only or unprotected labels. | Command execution is not called protected until the broker path is active. |
| Terminal/app startup | First-workspace startup scan is recorded automatically and status shows required/stale until current. | Agent opens wait for a current startup scan; strict/ci block real client handoff when BLOCK findings remain. |
CRA readiness is treated as more important than NVD enrichment. NVD can improve CVE metadata, but the EU Cyber Resilience Act defines process obligations and evidence a product team must be able to show: cybersecurity risk assessment, secure defaults, vulnerability handling, machine-readable SBOM, support/update posture, and incident reporting readiness. MilliWays should therefore use NVD as one optional input, not as the compliance model.
Router maturity controls are part of the release contract for shared and server deployments: admission and backpressure decisions must be explicit, timeout budgets must be bounded per request and per downstream runner, and non-secret failure responses must avoid leaking prompts, credentials, headers, or tool output while still preserving enough classification for operators.
AQE/OpenAI-compatible governance contract exports are planned for policy and compliance consumers. The export surface should include policy decisions, router maturity posture, scanner posture, SBOM and CRA evidence, accepted-risk metadata, and non-secret request/response classifications in a form that can be consumed beside OpenAI-compatible model gateways without exposing secrets.
| Mode | Behavior | Recommended use |
|---|---|---|
off | Security checks are disabled except for explicit manual commands. | Temporary debugging only. |
observe | Record and render findings without interrupting work. | First rollout in an existing team or noisy repository. |
warn | Default interactive mode: surface warnings and require attention for risky actions, but keep routine work moving. | Developer laptops and shared workspaces. |
strict | Block known-bad IOC, persistence, secret-read, and high-risk package/persistence commands when MilliWays controls the execution path. | Sensitive repositories and unattended agent work. |
ci | Non-interactive strict posture suitable for release and smoke automation. | CI, release packaging, and pre-merge checks. |
Set or inspect the mode with:
milliwaysctl security mode
milliwaysctl security mode warn
milliwaysctl security mode strict
Milliways degrades cleanly when optional scanners are missing, and milliwaysctl security status shows what is installed. Install the scanners you want available on PATH:
# OSV dependency scanner
milliwaysctl security install-scanner
# or:
brew install osv-scanner
go install github.com/google/osv-scanner/v2/cmd/osv-scanner@latest
# Gitleaks secret scanner
brew install gitleaks
# or use the upstream release binary / container image
# Semgrep SAST scanner
brew install semgrep
pipx install semgrep
uv tool install semgrep
# Go vulnerability scanner
go install golang.org/x/vuln/cmd/govulncheck@latest
Official install references: OSV-Scanner, Gitleaks, Semgrep, and govulncheck.
Implementation note: MilliWays currently attaches to the osv-scanner CLI for lockfile/project scanning and uses the OSV API only for targeted package/version queries. It does not vendor or fork the OSV scanner library; that keeps packaging small and lets Linux and macOS use the same installed scanner path.
milliwaysctl security status
milliwaysctl security audit --limit 20
milliwaysctl security cra
milliwaysctl security cra-scaffold --dry-run
milliwaysctl security sbom --output dist/milliways.spdx.json
milliwaysctl security startup-scan --strict
milliwaysctl security scan
milliwaysctl security warnings
milliwaysctl security shims status
milliwaysctl security client codex
milliwaysctl security command-check --mode strict -- npm install left-pad
milliwaysctl security output-plan --generated cmd/app/main.go --staged .env.local
milliwaysctl security quarantine --dry-run
milliwaysctl security rules list
milliwaysctl security harden npm --dry-run
Inside the MilliWays terminal, the same core posture controls are available without leaving the active client:
/security status
/security audit --limit 20
/security cra
/security cra-scaffold --dry-run
/security sbom --output dist/milliways.spdx.json
/security startup-scan --strict
/security scan
/security mode strict
/security client codex
/security command-check --mode strict -- npm install left-pad
startup-scan and most posture RPCs are daemon-backed. If a new milliwaysctl has a command before the running daemon exposes the matching RPC, the CLI prints that the surface is present and will activate when milliwaysd is updated.
When startup scan reports a BLOCK finding for AI-agent package compromise indicators such as router_init.js, router_runtime.js, setup.mjs, tanstack_runner.js, gh-token-monitor, git-tanstack.com, getsession.org, or 83.142.209.194:
milliwaysctl security quarantine --dry-run to see local remediation actions without changing files..claude/, .vscode/tasks.json, package.json, lockfiles, user systemd units, and macOS LaunchAgents for unexpected commands.milliwaysctl security startup-scan --strict, dependency scanning, Gitleaks, and Semgrep before resuming agents.The HTTP-based runners (berget, minimax, kimi, deepseek, local) drive an agentic tool loop that lets the model invoke bash, file read/write/edit, grep/glob, and web_fetch on your machine. Milliways applies guardrails by default; the bars can be raised but should not be lowered for shared or multi-tenant deployments.
| Constraint | Default | Override | Why |
|---|---|---|---|
| Workspace root | process cwd | MILLIWAYS_WORKSPACE_ROOT=<dir> | File read/write/edit/grep/glob and bash's cwd are jailed inside this directory. Paths outside the root are refused. |
| Credential denylist | hardcoded | not overridable | Even inside the workspace, ~/.ssh/, ~/.aws/, ~/.gnupg/, ~/.kube/, ~/.netrc/, ~/.docker/config.json, ~/.config/milliways/local.env, ~/.config/anthropic/auth.json, ~/.config/gh/hosts.yml cannot be read or written. |
| WebFetch SSRF block | on | MILLIWAYS_TOOLS_ALLOW_LOOPBACK=1 | Loopback / RFC1918 / link-local hosts and cloud-metadata IPs (169.254.169.254, metadata.google.internal) are rejected. Redirects are re-validated. The opt-in env var allows loopback only — cloud-metadata blocking is unconditional. |
| Bash command logging | length + sha256 prefix | not overridable | Model-generated commands can contain secrets via env-var interpolation; the full command is intentionally dropped from the daemon log. |
| Tool result wrapping | <tool_result>...</tool_result> markers | not overridable | Tool output is wrapped + system prompt declares it untrusted, mitigating prompt-injection via tool fold-back (a model Read-ing an attacker-planted file can't smuggle directives). |
| Subprocess env | safelisted (PATH/HOME/USER/SHELL/TERM/LANG/LC_/TMPDIR/XDG_ + per-CLI auth keys) | edit safeRunnerEnvKeys in the source | claude/codex/copilot/gemini/pool subprocesses do not inherit the daemon's full env. Closes the codex-printenv exfil path. |
| Codex sandbox | --sandbox workspace-write --ask-for-approval on-request | per-kitchen cfg.Args overrides win | Keeps Codex writable inside the workspace while preserving human approval prompts by default. The trade-off is documented in SECURITY.md. |
| Disable tools entirely | n/a | BERGET_TOOLS=off, MINIMAX_TOOLS=off, KIMI_TOOLS=off, DEEPSEEK_TOOLS=off, MILLIWAYS_LOCAL_TOOLS=off | Chat-only mode for the HTTP runners (debugging, comparison testing). |
| Agentic loop turn cap | 100 | MILLIWAYS_MAX_TURNS=<n> | Hard upper bound on assistant→tool→assistant cycles per dispatch; chunk_end carries max_turns_hit:true when reached. |
CLI-based runners (claude/codex/copilot/gemini/pool) inherit tool execution from their underlying CLI process. Codex's sandbox applies via the kitchen adapter / daemon-side defaults; the others manage their own filesystem/network access.
milliways bundles agent-toolkit-bundle — 20+ agent role definitions and 50+ keyword-routed skills for Claude Code, OpenCode, and Codex. The one-liner installer installs it automatically alongside the binaries.
Verify it's active:
milliwaysctl check # Agent toolkit row should show [PASS]
If it shows [WARN] not installed, run:
bash "$(command -v milliwaysctl | xargs dirname | xargs dirname)/share/milliways/scripts/install_feature_deps.sh"
Or point milliways at any directory of your own agents:
export MILLIWAYS_AGENTS_DIR=~/my-agents
milliways reads from $MILLIWAYS_AGENTS_DIR:
| Path | Purpose |
|---|---|
agents/opencode/*.md | Agent role definitions (frontmatter + system prompt) |
skills/<name>/SKILL.md | Skill content injected before dispatch |
skill-rules.json | Regex rules that map prompt keywords to skills |
AGENTS.md / CLAUDE.md | Global conventions prepended to every context |
milliways prepends your project toolkit bundle — the root CLAUDE.md plus the .claude/{skills,rules,agents,commands} files in your working directory — to every dispatch, so all runners (not just Claude) see your project rules and skills. This bundle is injected whole, up to a size budget; milliways does not keyword-filter it. The keyword-selective activation described by skill-rules.json is applied by the agent CLIs that consume the bundle (Claude Code, OpenCode, Codex), not by milliways' in-process enrichment.
Invoke via @agent-name (Claude Code / OpenCode). All agents are leaf agents — they do not spawn sub-agents.
| Agent | Role |
|---|---|
@architect | Architecture design, ADRs, interface specs |
@ai-developer | LLM integration, RAG, MCP servers, evals |
@api | REST/OpenAPI 3.1 design and review |
@coder-go | Go feature implementation (strict TDD) |
@coder-python | Python feature implementation (strict TDD) |
@coder-rust | Rust feature implementation (strict TDD) |
@coder-sql | SQL migrations, schema design, query optimisation |
@coder-tdd | TDD red phase — failing tests before implementation |
@coder-typescript | TypeScript/React implementation (strict TDD, Vitest) |
@data-analyst | Data analysis, statistical testing, visualisation |
@data-engineer | Pipelines, dbt, Airflow, Spark, Snowflake |
@jira-story | Jira story creation with acceptance criteria |
@observability | OpenTelemetry instrumentation review |
@opsx | OpenSpec workflow — propose, apply, archive changes |
@product-owner | User stories, backlog prioritisation, OKRs |
@refactor | Refactoring — extract, rename, simplify, pay debt |
@reviewer | Adversarial 4-lens code review |
@security | Security review — OWASP, secrets, auth, deps |
@sre | Deployment safety, SLOs, runbooks, rollback |
@tester | Test strategy, coverage analysis, TDD red phase |
Skills are auto-activated by keyword matching (skill-rules.json) inside the agent CLIs that read the bundle (Claude Code, OpenCode, Codex). You can also invoke them explicitly with /skill-name in Claude Code or OpenCode.
Languages & runtimes
| Skill | Keywords |
|---|---|
python | Python, pytest, FastAPI, Django, Flask |
typescript | TypeScript, React, Next.js, Vitest, Vite |
golang | Go, goroutine, channel, Go module |
golang-patterns | Idiomatic Go, Go best practices |
rust | Rust, Cargo, lifetime, borrow |
nodejs | Node.js, Express, Fastify, NestJS, npm |
Databases
| Skill | Keywords |
|---|---|
database | SQL, Postgres, MySQL, migration, schema |
DevOps & infrastructure
| Skill | Keywords |
|---|---|
ci-cd | CI/CD, GitHub Actions, GitLab CI, pipeline, deployment |
docker-expert | Docker, container, Dockerfile, Compose |
kubernetes-patterns | Kubernetes, k8s, Helm, kubectl |
iac-patterns | Terraform, Pulumi, IaC, CDK |
Observability & reliability
| Skill | Keywords |
|---|---|
observability | OTel, OpenTelemetry, tracing, span, Jaeger |
sre | SRE, SLO, SLA, error budget, toil |
incident-response | Incident, postmortem, oncall, runbook |
chaos-engineer | Chaos, fault injection, resilience, circuit breaker |
Architecture & design
| Skill | Keywords |
|---|---|
microservices-architect | Microservice, service mesh, gRPC, protobuf |
multi-tenancy | Multi-tenant, tenant isolation |
performance-engineer | Performance, latency, throughput, profiling |
api-designer | REST API, OpenAPI, endpoint, Swagger |
web-design-guidelines | CSS, UI, design system, Tailwind, accessibility |
Quality
| Skill | Keywords |
|---|---|
tdd-workflow | TDD, test-driven, red-green, failing test |
verification-loop | Verify, validate, smoke test, integration test |
refactoring-specialist | Refactor, clean up, extract method, tech debt |
pr-review | PR review, code review, pull request |
Security & compliance
| Skill | Keywords |
|---|---|
security-review | Security, OWASP, vulnerability, injection, XSS |
oauth | OAuth, OIDC, JWT, authentication, SSO |
compliance | Compliance, audit, GDPR, PCI-DSS, SOC2 |
Data
| Skill | Keywords |
|---|---|
data-analyst | Data analysis, exploratory, statistics |
data-engineer | Data pipeline, dbt, Airflow, Spark |
statistical-analysis | Statistical, regression, hypothesis, p-value |
time-series | Time series, forecast, seasonality, ARIMA |
data-visualisation | Visualisation, chart, plot, matplotlib, Plotly |
AI & LLM
| Skill | Keywords |
|---|---|
ai-developer | LLM, RAG, MCP, evals, prompt engineering, embeddings |
prompt-engineer | Prompt design, system prompt, few-shot, chain-of-thought |
Productivity & communication
| Skill | Keywords |
|---|---|
documentation | Documentation, README, changelog, wiki |
presentation | Presentation, slide, deck, pitch |
product-owner | Product owner, user story, sprint, OKR, roadmap |
confluence | Confluence, Atlassian |
Memory & code intelligence
| Skill | Keywords |
|---|---|
mempalace | MemPalace, palace, memory store |
codegraph | CodeGraph, call graph, blast radius, symbol search |
OpenSpec workflow
| Skill | Keywords |
|---|---|
openspec-apply-change | OpenSpec, /opsx |
openspec-explore | OpenSpec explore |
openspec-propose | OpenSpec propose |
openspec-archive-change | OpenSpec archive |
Specialised
| Skill | Keywords |
|---|---|
caveman | Caveman — token-compressed output (~75% savings) |
pdm-expert | PDM, Python dependency management |
skill-rules.json at the bundle root maps regex patterns to skill names. You can add your own rules or override existing ones:
[
{ "pattern": "\\bdjango\\b|\\bdrf\\b", "skill": "python" },
{ "pattern": "\\bmy-company-framework\\b", "skill": "my-custom-skill" }
]
Rules are matched in order; the first match for a skill name wins. milliways also checks $MILLIWAYS_AGENTS_DIR/.claude/skill-rules.json as a fallback.
~/.config/milliways/milliways.db (SQLite, ~2 MB):
| Table | Contents |
|---|---|
mw_ledger | Every dispatch: kitchen, duration, outcome |
mw_routing | Learned kitchen preferences |
mw_quotas | Daily usage per kitchen |
mw_gitgraph | File churn and stability |
mw_tickets | Async dispatch tracking |
Human-readable audit trail: ~/.config/milliways/ledger.ndjson
"A towel is about the most massively useful thing an interstellar hitchhiker can have." A context window is a close second. milliways keeps track of both.
Apache License 2.0 — see LICENSE for the full text.
The crates/milliways-term directory contains a modified fork of
WezTerm (MIT licensed). See
MILLIWAYS_NOTICE.md and NOTICE for
attribution details.
GitHub checked 255h ago - refresh overdue. Recently viewed repositories target hourly refresh.
Find a documented setup for your client. No sign-in, installation, or tool execution.
If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.