Metadata-Version: 2.4
Name: oi-chat
Version: 0.1.0
Summary: Command-line chat interface for multiple LLM providers, with streaming output, persistent chats, and YAML-based model aliases.
Project-URL: Homepage, https://github.com/dansclearov/oi
Project-URL: Repository, https://github.com/dansclearov/oi
Project-URL: Issues, https://github.com/dansclearov/oi/issues
Project-URL: Changelog, https://github.com/dansclearov/oi/blob/main/CHANGELOG.md
Author-email: Dan Sclearov <dansclearov@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: ai,anthropic,chat,claude,cli,gemini,llm,openai
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Requires-Dist: anthropic>=0.52.2
Requires-Dist: colored>=2.3.0
Requires-Dist: openai>=1.84.0
Requires-Dist: platformdirs>=4.3.8
Requires-Dist: prompt-toolkit>=3.0.51
Requires-Dist: pydantic-ai<2.0,>=1.100.0
Requires-Dist: python-dotenv>=1.1.0
Requires-Dist: pyyaml>=6.0.2
Requires-Dist: rich>=14.0.0
Requires-Dist: send2trash>=1.8.3
Description-Content-Type: text/markdown

# oi

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

![Demo](https://raw.githubusercontent.com/dansclearov/oi/main/demo.gif)

## 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.
- Chat bookmarks with `/bookmark` in-chat plus bookmark/filter controls in the selector.
- Optional search and thinking traces when the selected model supports them.
- Paste images with `Alt+V` on vision-capable models.
- User config in `~/.config/oi/` merges with built-in defaults.

## Install

```bash
uv tool install git+https://github.com/dansclearov/oi.git
```

For local development:

```bash
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):

```bash
export ANTHROPIC_API_KEY=...
export OPENAI_API_KEY=...
export GEMINI_API_KEY=...
export OPENROUTER_API_KEY=...
```

Start chatting:

```bash
oi
oi -P concise -m sonnet
```

## Common Commands

```bash
# Pick prompt + model
oi -P concise -m gpt

# Continue or resume chats
oi -c
oi -r
oi -r chat_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
/bookmark
/vim

# Slash commands complete with Tab

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

# 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:

```yaml
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.

## 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`:

```json
{
  "default_prompt": "concise"
}
```

An explicit `-P` still wins, for example `oi -P general`.

## Development

```bash
uv run pytest
uv run ty check
```

## License

MIT. See `LICENSE`.
