oi
Command-line chat interface for multiple LLM providers, with streaming output, persistent chats, and YAML-based model aliases.
Highlights
- One CLI for multiple providers through
pydantic-ai(openai,openai-responses,anthropic,google,openrouter,moonshotai, and others you add in YAML). - Fast model switching via aliases like
sonnet,gpt,gemini-pro. - Chat history with resume/continue flows and an interactive selector that can search, preview, and open chats in your editor (
$EDITOR). - Chat bookmarks with
/bookmarkin-chat plus bookmark/filter controls in the selector. - Optional web search and thinking traces when the selected model supports them.
--searchalso lets the model read a URL you give it, and/searchturns it on partway through a chat. - Full-screen TUI (the default) that renders responses as live-streamed
markdown.
↑on an empty prompt walks back through your messages: edit one to branch the conversation from there, and switch between branches later — the old one is kept, never lost. The classic scrollback UI is still there:--no-tuifor one run, or"tui": falseinconfig.json(--tuioverrides that for a run). - Paste images with
Alt+V(Ctrl+Von Mac) on vision-capable models. - LaTeX math in the TUI, rendered as real typeset formulas (inline and display,
including
align, matrices andcases) in terminals that speak the kitty graphics protocol (kitty, Ghostty, WezTerm). Needs thelatexextra:uv tool install "oi-chat[latex]". Elsewhere the LaTeX source is shown. - User config in
~/.config/oi/merges with built-in defaults.
Install
uv tool install oi-chat # recommended
# or
pipx install oi-chat
For local development:
git clone https://github.com/dansclearov/oi.git
cd oi
uv install --group dev
uv run oi --help
Quick Start
Set one or more provider API keys (you only need keys for providers you use):
export ANTHROPIC_API_KEY=...
export OPENAI_API_KEY=...
export GEMINI_API_KEY=...
export OPENROUTER_API_KEY=...
To keep oi's billing separate from your shell environment, put keys in
~/.config/oi/env (dotenv format, same variable names) instead — keys set
there take precedence over the environment.
If ANTHROPIC_API_KEY is set, longer chats get an auto-generated title via a
tiny Haiku call (a fraction of a cent); without it, chats just keep their
first-message title.
Alternatively, bill OpenAI models to a ChatGPT subscription instead of an API
key with oi auth openai login; eligible models then route through the
subscription automatically (set OI_NO_SUBSCRIPTION=1 to force the API key).
Start chatting:
oi
oi -P concise -m sonnet
Common Commands
# Pick prompt + model
oi -P concise -m gpt
# Continue or resume chats
oi -c
oi -r
oi -r 20240622_143022_a1b2c3d4
# Headless: send one message and exit
oi -p "what's 2+2"
oi -c -p "follow up on the last chat"
oi --ephemeral -p "quick question, don't save it"
oi -c --ephemeral -p "probe an existing chat without dirtying it"
# In-chat local commands
/btw <question> # one-off question with full context, not saved to the chat
/search # turn web search on for the rest of the chat
/bookmark
/vim
/tui
# Slash commands complete with Tab
# Model features
oi --search -m sonnet
oi --no-thinking -m gpt
oi --hide-thinking -m gpt
# Classic scrollback UI instead of the TUI, for one run
oi --no-tui
# Show config/data paths
oi --user-paths
Configuration
Default models and aliases live in src/oi/models.yaml.
User overrides live in ~/.config/oi/models.yaml and are merged on top of defaults.
Example user overrides:
aliases:
default: r1
r1: openrouter/deepseek/deepseek-r1-0528
openrouter:
deepseek/deepseek-r1-0528:
supports_thinking: true
supports_search: true
Notes:
- Top-level keys starting with
_are ignored (useful for YAML anchors/metadata). extra_paramsis passed through for provider-specific model settings.- On first run,
~/.config/oi/models.yamlis auto-created from a template. oi docs modelsprints the full guide to adding models (config shape, pydantic-ai model names, API keys, the built-in defaults). It's written for LLM agents — if you use a coding agent like Claude Code, just ask it to add the model and it will find the guide viaoi --help.
Prompts
Prompts are loaded from:
~/.config/oi/prompts/(user overrides)src/oi/prompts/(built-ins)
Naming format is prompt_<name>.txt, used as oi -P <name>.
Set the default prompt for new chats in ~/.config/oi/config.json:
{
"default_prompt": "concise"
}
With nothing configured, chats start with no system prompt (empty). An
explicit -P still wins, for example oi -P general.
Development
uv run pytest
uv run ty check
License
MIT. See LICENSE.
Metadata
Release files for oi-chat 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| oi_chat-0.3.1.tar.gz | 4.3 MB | Without provenance | Details for oi_chat-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| oi_chat-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for oi_chat-0.3.1-py3-none-any.whl |
Total release size: 4.4 MB
Release files / oi_chat-0.3.1.tar.gz
| Download URL | oi_chat-0.3.1.tar.gz |
|---|---|
| Size | 4.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e67e4f1add81dfbf7cc38ddb6cc0506750f0234607048ce6d618c16d6f4a4b58
|
|
BLAKE2b-256 checksum How to use checksums |
b5bcafbfa0762ca653faceafd63c0aa2f6bb521f782b34715f057c903b1ef123
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / oi_chat-0.3.1-py3-none-any.whl
| Download URL | oi_chat-0.3.1-py3-none-any.whl |
|---|---|
| Size | 127.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bd1243429200403fb72cbe4d5483ecf4250c6d4288fc292f643a5e4aade35a32
|
|
BLAKE2b-256 checksum How to use checksums |
b21bde3e5e9bb68db6732285e545706442a35893829a8a6dd3385e112f4735b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for oi-chat 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.