Metadata-Version: 2.4
Name: nexus-ai-cli
Version: 0.4.0
Summary: Ultra-minimal multi-provider AI framework
Project-URL: Homepage, https://github.com/saadiqhorton/nexus-ai
Project-URL: Documentation, https://github.com/saadiqhorton/nexus-ai#readme
Project-URL: Repository, https://github.com/saadiqhorton/nexus-ai
Project-URL: Bug Tracker, https://github.com/saadiqhorton/nexus-ai/issues
Project-URL: Changelog, https://github.com/saadiqhorton/nexus-ai/blob/master/CHANGELOG.md
Author-email: Saadiq Horton <hortonsaadiq@gmail.com>
Maintainer-email: Saadiq Horton <hortonsaadiq@gmail.com>
License: MIT
License-File: LICENSE
Keywords: ai,anthropic,chatgpt,cli,llm,ollama,openai
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Requires-Dist: aiofiles<24.0,>=23.0
Requires-Dist: anthropic~=0.18
Requires-Dist: click<9.0,>=8.1
Requires-Dist: cryptography>=41.0.0
Requires-Dist: keyring>=24.0.0
Requires-Dist: openai~=1.12
Requires-Dist: prompt-toolkit<4.0,>=3.0
Requires-Dist: pydantic<3.0,>=2.0
Requires-Dist: python-dotenv<2.0,>=1.0
Requires-Dist: pyyaml<7.0,>=6.0
Requires-Dist: rich<14.0,>=13.0
Provides-Extra: dev
Requires-Dist: hypothesis>=6.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
Requires-Dist: pytest-mock>=3.11; extra == 'dev'
Requires-Dist: pytest>=7.4; extra == 'dev'
Requires-Dist: requests<3.0,>=2.31; extra == 'dev'
Requires-Dist: responses>=0.24; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# Nexus AI

Ultra-minimal multi-provider AI CLI framework.

**Available on PyPI as `nexus-ai-cli`**

## Features

- **Unified Interface**: Single CLI for OpenAI, Anthropic, Ollama, and OpenRouter
- **Session Management**: Persistent conversations with search and export
- **Prompt Library**: Save and reuse system prompts
- **Smart Defaults**: Interactive model selection and fuzzy search
- **Streaming Output**: Real-time response streaming

## Installation

### Quick Install (Recommended)

```bash
pipx install nexus-ai-cli
```

**pipx** creates an isolated environment for Nexus AI, preventing conflicts with other Python packages.

### Alternative Installation Methods

**Using pip:**
```bash
pip install nexus-ai-cli
```

**Development install:**
```bash
git clone https://github.com/saadiqhorton/nexus-ai.git
cd nexus-ai
pip install -e .
```

### Updating

```bash
pipx upgrade nexus-ai-cli
# or
pip install --upgrade nexus-ai-cli
```

### System Requirements

- Python 3.8 or higher
- API keys for at least one AI provider (OpenAI, Anthropic, or OpenRouter)
- Ollama users: Ollama server running at http://localhost:11434

## Environment Setup

Copy the example environment file and add your API keys:

```bash
cp .env.example .env
```

Required environment variables (set at least one provider):

| Variable | Description |
|----------|-------------|
| `OPENAI_API_KEY` | OpenAI API key |
| `ANTHROPIC_API_KEY` | Anthropic API key |
| `OPENROUTER_API_KEY` | OpenRouter API key |

For local Ollama, no API key is needed - just ensure the server is running at `http://localhost:11434`.

## Quick Start

```bash
# Use default model
nexus "your prompt"

# Specify model
nexus -m gpt-4o "your prompt"

# Include file contents
nexus -f file.txt "explain this"

# Pipe content
cat file.txt | nexus "summarize"

# Interactive chat
nexus chat --session myproject
```

## Commands

| Command | Description |
|---------|-------------|
| `nexus "prompt"` | Send a prompt |
| `nexus chat` | Interactive REPL |
| `nexus models` | List available models |
| `nexus providers` | Show configured providers |
| `nexus config` | Display configuration |
| `nexus -d [model]` | Set default model |
| `nexus sessions` | Manage conversations |
| `nexus prompts` | Manage prompt library |
| `nexus completion` | Setup shell completion |

## Configuration

Config stored at `~/.nexus/config.yaml`:

```yaml
providers:
  openai:
    api_key: ${OPENAI_API_KEY}
  anthropic:
    api_key: ${ANTHROPIC_API_KEY}
  ollama:
    base_url: http://localhost:11434
  openrouter:
    api_key: ${OPENROUTER_API_KEY}

defaults:
  provider: openai
  model: gpt-4o
  temperature: 0.7
  max_tokens: 2000
  stream: true
```

## Development

```bash
# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run tests with Ollama integration
NEXUS_OLLAMA_URL=http://localhost:11434 pytest

# Linting
ruff check .
ruff format .
```

## Architecture

```
nexus/
├── cli/           # Click CLI commands
├── core/          # App, ProviderManager, CompletionHandler
├── providers/     # AI provider implementations
├── config/        # ConfigManager and models
├── session/       # Session persistence
├── prompts/       # Prompt library
└── utils/         # Cache, logging, errors
```
