ollie/scripts/README.md

3.5 KiB

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 to ~/.config/ollie/scripts/ and exposes them via the mounted filesystem under s/, so they are available without any $PATH changes:

exec $OLLIE/s/sh              # start interactive shell
$OLLIE/s/job "my prompt"      # batch job (foreground)
$OLLIE/s/q "my prompt"        # foreground one-shot query
$OLLIE/s/sched "my prompt"    # background job; prints b/ path
$OLLIE/s/ls                   # list sessions
$OLLIE/s/kill <id>            # kill a session

osh

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

osh [-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

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

oq

Non-interactive one-shot query. Submits a prompt to b/new, waits for completion, prints the result to stdout, then removes the job. Exit code is non-zero on failure.

oq [flags] [prompt...]
echo "prompt" | oq [flags]

Flags

Flag Description
-name N Base job name; jobs are suffixed -0, -1, ...
-cwd DIR Working directory (default: pwd)
-agent A Agent config name
-backend B Backend override
-model M Model override
-output json Append JSON-only instruction to prompt
-parallel N Run the same prompt N times in parallel (default: 1)
-keep Do not remove job(s) after printing result

Examples

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

With -parallel N and N > 1, results are separated by === {id} === headers.


optimize

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

optimize [flags] [prompt...]
echo "prompt" | 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

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

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