ol
One small command in front of ollama launch — with the
context window set correctly and arguments passed through untouched.
What it does
- Launches any Ollama integration:
claude,codex,pi,opencode,chatgpt, and whatever elseollama launchsupports. - Reads the model's real context window from
/api/showand exportsCLAUDE_CODE_MAX_CONTEXT_TOKENS, so Claude Code stops assuming 200k. - Passes everything after
--(or the first argument starting with-) to the agent literally: noeval, no re-splitting, and the agent's exit status becomesol's. - Tab completion for bash and zsh: integrations first, then model names from your default, running models, recently launched models, and local pulls.
- Self-updating: the installed copy syncs from
mainon every run, and only replaces itself with a candidate that containsollama launchand passesbash -n.
Install
curl -fsSL https://raw.githubusercontent.com/yakovkhalinsky/ai-things/main/install.sh | sh -s -- ol
Installs ol into ~/bin. From a checkout,
./tools/ol/install.sh does the same thing.
The install is a rename into ~/bin, records
~/.ol-version, installs tab completion for your shell,
adds the guarded sourcing line, and adds ~/bin to your
PATH if needed.
Set OL_TARGET to install somewhere else; PATH and completion
setup are then skipped. Installing is a one-time step — after that,
ol keeps itself current.
Usage
ol # claude, model from ~/.model
ol codex # another integration
ol claude gpt-oss:20b # pick the model
ol claude -- -p "brief" --output-format json
ol claude gpt-oss:20b -p "$(cat brief.md)" --output-format json
Permissions
--dangerously-skip-permissions is only added for
claude, and only for a classic interactive launch: stdin is a
terminal and no arguments are passed through. Headless and scripted runs
keep Claude Code's normal permission handling, so
--allowedTools, --disallowedTools, and
--permission-mode mean what they say.
Force it with OL_SKIP_PERMISSIONS=1, or force it off with
OL_SKIP_PERMISSIONS=0.
Good to know
ol installs and runs whatever is on main on
every run. The sanity checks blunt accidents such as a truncated
push — they do not protect against malice.
- Changes ship only once committed and pushed to
main. Uncommitted local edits are replaced in~/binon the next run; useOL_SOURCEwhile developing. - Set
OLLAMA_HOSTfor a remote Ollama, orOL_NO_UPDATE=1to skip the sync. - The zsh completion is written to the standard pattern but has had less keystroke testing than the bash one.
Source
- README tools/ol/README.md
- ol the launcher itself
- install.sh installer, PATH setup, and rc line
- Completion files ol-completion.bash, ol-completion.zsh