ollie/scripts
Levi Neely 2148c8c668 update docs: unify b/ into s/, introduce s/bfg and s/bbg
Batch and session namespaces are now a single s/ concept. s/bfg blocks
until the agent finishes and writes to stdout; s/bbg returns immediately
and prints the session path. s/b is the core one-shot runner. Remove all
b/ references from README, USAGE, ARCHITECTURE, and scripts/README.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 08:31:15 +02:00
..
s sh: fix is_idle for multi-word state values 2026-04-24 15:39:42 +02:00
u unify s/ and b/ namespaces: batch jobs now live under s/ 2026-04-23 18:50:05 +02:00
x sh: multi-line input with C-j/C-m via readmulti 2026-04-24 15:38:38 +02:00
README.md update docs: unify b/ into s/, introduce s/bfg and s/bbg 2026-04-25 08:31:15 +02:00

README.md

scripts

Shell scripts for interacting with the ollie 9P filesystem. All scripts read OLLIE (default: $HOME/mnt/ollie) for the mount path.

mk scripts installs them and exposes them via the mounted filesystem, so they are available without any $PATH changes:

exec $OLLIE/s/sh              # start interactive shell
$OLLIE/s/ls                   # list sessions
$OLLIE/s/kill <id>            # kill a session
$OLLIE/s/bfg "my prompt"      # foreground one-shot query; blocks until done
$OLLIE/s/bbg "my prompt"      # background one-shot query; prints session path
$OLLIE/s/cleanup              # remove all idle sessions
$OLLIE/u/optimize "prompt"    # generate and return best optimized prompt

Scripts are organized by the filesystem namespace they are hosted under:

  • s/ — session management and one-shot query scripts
  • u/ — utility scripts; compositions of other ollie primitives

s/sh

Interactive chat interface for ollie sessions. Resumes the most recent session for the current directory by default; creates a new one if none exists.

s/sh [-new] [-resume] [-session ID] [-cwd DIR] [-backend B] [-model M] [-agent A]

Flags

Flag Description
-new Always create a new session
-resume Resume last session for the cwd; error if none
-session ID Attach to a specific session by ID
-cwd DIR Working directory (default: pwd)
-backend B Backend override (e.g. ollama, anthropic)
-model M Model override
-agent A Agent config name

Input

At the > prompt:

Input Action
<text> Submit prompt, stream response
/q <text> Enqueue prompt for later
/<cmd> Send to session ctl (e.g. /compact, /clear)
/kill Kill the session and exit
Ctrl-C Interrupt running turn (or exit if idle)

Examples

s/sh                          # resume or create session for pwd
s/sh -new -model gpt-4o       # fresh session with model override
s/sh -session 1745123456-abc  # attach to a specific session

s/ls

List all active sessions.

s/ls

s/kill

Kill a session by ID and remove it.

s/kill <id>

s/bfg

Foreground one-shot query. Submits a prompt to a new session, blocks until the agent is done, writes the result to stdout, then removes the session. Exit code is non-zero on failure. Thin wrapper around s/b.

s/bfg [flags] [prompt...]
echo "prompt" | s/bfg [flags]

Accepts the same flags as s/b.

Examples

s/bfg "Summarize this repo in one sentence"
cat error.log | s/bfg "What is causing this error?"
s/bfg -output json "List the top 3 risks as JSON"
s/bfg -parallel 4 -keep "Write a haiku about filesystems"
s/bfg -backend ollama -model qwen3:8b "Explain this function" < main.go

s/bbg

Background one-shot query. Submits a prompt to a new session and returns immediately; prints the s/{id} path for each job. Thin wrapper around s/b -bg.

s/bbg [flags] [prompt...]
echo "prompt" | s/bbg [flags]

Accepts the same flags as s/b.

Examples

path=$(s/bbg "write a limerick about Go")
until [ "$(cat $path/statewait)" = "idle" ]; do :; done
tail -c +$(($(cat $path/offset) + 1)) $path/chat

s/b

Core one-shot runner. Submits a prompt to a new session, optionally waits, and handles parallel fan-out. s/bfg and s/bbg are both wrappers around this script.

s/b [flags] [prompt...]
echo "prompt" | s/b [flags]

Flags

Flag Description
-name N Base session name; sessions are suffixed -1, -2, ...
-cwd DIR Working directory (default: pwd)
-agent A Agent config name
-backend B Backend override
-model M Model override
-json Append JSON-only instruction to prompt
-parallel N Run the same prompt N times in parallel (default: 1)
-keep Do not remove session(s) after printing result
-bg Submit and exit immediately; prints session path(s); implies -keep
-failfast On first failure, cancel remaining parallel jobs and exit

s/cleanup

Remove all idle sessions.

s/cleanup

u/optimize

Generates N candidate optimized prompts, judges them, and returns the best one to stdout. Debugging output (progress messages) goes to stderr.

u/optimize [flags] [prompt...]
echo "prompt" | u/optimize [flags]

Flags

Flag Description
-n N Number of candidates to generate (default: 3)
-cb B Candidate generation backend
-cm M Candidate generation model
-jb B Judge backend
-jm M Judge model

Examples

u/optimize "Summarize this document"
u/optimize -n 5 -cm qwen/qwen3-8b -jm anthropic/claude-opus-4.6 "Write a haiku"
u/optimize "generate a hello world program. use c++." >[2]/dev/null | s/bfg

Outputs to stdout, making it composable with other pipeline stages.