CLI tools self-updating

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 else ollama launch supports.
  • Reads the model's real context window from /api/show and exports CLAUDE_CODE_MAX_CONTEXT_TOKENS, so Claude Code stops assuming 200k.
  • Passes everything after -- (or the first argument starting with -) to the agent literally: no eval, no re-splitting, and the agent's exit status becomes ol'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 main on every run, and only replaces itself with a candidate that contains ollama launch and passes bash -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 ~/bin on the next run; use OL_SOURCE while developing.
  • Set OLLAMA_HOST for a remote Ollama, or OL_NO_UPDATE=1 to skip the sync.
  • The zsh completion is written to the standard pattern but has had less keystroke testing than the bash one.

Source