Skip to main content

oi

Command-line chat interface for multiple LLM providers, with streaming output, persistent chats, and YAML-based model aliases.

Demo

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, sol, 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 /bookmark in-chat plus bookmark/filter controls in the selector.
  • Optional web search and thinking traces when the selected model supports them. --search also lets the model read a URL you give it, and /search turns 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-tui for one run, or "tui": false in config.json (--tui overrides that for a run).
  • Paste images with Alt+V (Ctrl+V on Mac) on vision-capable models.
  • Yomitan dictionary popups in the TUI: hover or click a Japanese word in the chat to see Yomitan's entry for it, with your own dictionaries and deinflection. Needs yomitan-api (the extension's local API) running in your browser; /yomitan toggles hover, click always works.
  • LaTeX math in the TUI, rendered as real typeset formulas (inline and display, including align, matrices and cases) in terminals that speak the kitty graphics protocol (kitty, Ghostty, WezTerm). Needs the latex extra: 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 sol

# 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
/yomitan          # toggle hover dictionary lookups (click still works)

# Slash commands complete with Tab

# Model features
oi --search -m sonnet
oi --no-thinking -m sol
oi --hide-thinking -m sol

# 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_params is passed through for provider-specific model settings.
  • On first run, ~/.config/oi/models.yaml is auto-created from a template.
  • oi docs models prints 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 via oi --help.

Prompts

Prompts are loaded from:

  1. ~/.config/oi/prompts/ (user overrides)
  2. 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.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oi-chat 0.5.1
File Size Uploaded Provenance Actions
oi_chat-0.5.1.tar.gz 4.3 MB Without provenance Details for oi_chat-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for oi-chat 0.5.1
File Interpreter ABI Platform Actions
oi_chat-0.5.1-py3-none-any.whl Python 3 none any Details for oi_chat-0.5.1-py3-none-any.whl

Total release size: 4.4 MB

Release files / oi_chat-0.5.1.tar.gz

Download URL oi_chat-0.5.1.tar.gz
Size 4.3 MB
Tags Source
SHA-256 checksum
How to use checksums
e9ccc78a50e7bfca6950d6cd0965d4f9fce427c05e0e4c791fa48598c6ad2831
BLAKE2b-256 checksum
How to use checksums
eaf3e03fda1e21d1f190374939902453c24fc1e5e1bf52208eef4a23251bb5f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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.5.1-py3-none-any.whl

Download URL oi_chat-0.5.1-py3-none-any.whl
Size 135.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab4fd840f63a5d7ce005915359ad20e513f9c840a0e446cdfe754223c7a6629e
BLAKE2b-256 checksum
How to use checksums
14717b10d8f8d4bbef1f79758d2d81e1e5a0583222a9d284a2b21854b14d29eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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.5.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page