# olliesrv A 9P server that exposes [ollie](https://github.com/lneely/ollie) agent sessions as a virtual filesystem. Mount it with `9pfuse` and interact with AI sessions using ordinary shell tools. The goal is integration, not self-sufficiency. Rather than providing orchestration, scheduling, or workflow primitives, olliesrv exposes a stable surface — sessions as directories, conversation as files — and defers everything else to the surrounding environment. Scripting, chaining, monitoring, and automation come from composing olliesrv with tools that already exist, not from building those capabilities into the server. For usage examples, see [doc/USAGE.md](https://github.com/lneely/ollie/blob/main/doc/USAGE.md) in the monorepo. ## Filesystem layout ``` ollie/ a/ dir: agent configs (r/w, backed by ~/.config/ollie/agents/) .json r/w: agent config; supports mv, cp, rm backends read: list of ollie-provided backends help read: help file (backed by ~/.config/ollie/help.md) p/ dir: prompt templates (read, backed by ~/.config/ollie/prompts/) tools-file.md read: text editing instructions tools-reasoning.md read: reasoning instructions tools-memory.md read: memory instructions tools-subagent.md read: subagent usage tools-elevate.md read: controlled escape from execute_code sandbox Prompt files have no automatic effect. They are injected into the system prompt by the `prime` script (x/prime), typically via preTurn hooks in agent configs. The base system prompt (SYSTEM_PROMPT.md) is loaded directly by Go at session creation and is not served via p/. The assembled system prompt is visible at s//systemprompt. s/ dir: sessions and session management scripts new r/w: read: KV template; write: create session idx read: index of all sessions (id, state, cwd, backend, model — one per line) sh exec: interactive chat shell ls exec: list active sessions kill exec: kill a session by ID b exec: one-shot query: create session, submit prompt, wait, print result, kill bfg exec: batch foreground: submit prompt, wait, print result bbg exec: batch background: submit prompt, print session path, return immediately cleanup exec: kill all idle sessions Session directories (multi-turn, idle<=>running): / rm -r to kill; mv to rename cfg r/w: KV snapshot of config and current state; write partial KV to mutate read fields: state, backend, model, agent, cwd, maxTokens, temperature, frequencyPenalty, presencePenalty writable fields: backend, model, agent, cwd, maxTokens, temperature, frequencyPenalty, presencePenalty (state is read-only; silently ignored on write) chat read: cumulative conversation history context read: full message history as JSONL (one message per line) cost read: cumulative cost in USD (if reported by backend) ctl write: stop | ctxsz read: estimated context size vs context window env read: session environment variables (OLLIE_SESSION_ID, OLLIE_*) fifo.in write: queue a prompt for later execution fifo.out read: pop the next queued prompt models read: available models from the backend offset read: byte offset in chat immediately after the last user prompt plan r/w: scratch space for agent planning (persisted per session) prompt write: submit a prompt to the agent prompt.prev read: the last submitted prompt statewait read: blocks until state changes; returns new state systemprompt read: fully rendered system prompt for this session tail exec: exec tail -f chat usage read: token counts (input, output, requests; [estimated] if not reported by backend) t/ dir: tool scripts (r/w, backed by ~/.config/ollie/tools/) idx read: tool index (name, description, args — synthesized at read time)