# Cody CLI

AINative Studio's AI-powered coding assistant. A full-featured terminal-based AI coding tool with streaming chat, tool use, MCP server support, and OAuth authentication.

## Install

```bash
# npm (global)
npm install -g @ainative/cody-cli

# npx (no install)
npx @ainative/cody-cli

# curl installer (macOS / Linux)
curl -fsSL https://ainative.studio/install-cody.sh | sh

# Homebrew
brew tap ainative-studio/cody
brew install cody
```

## Quick Start

```bash
# Set your API key
export ANTHROPIC_API_KEY=your-key
export ANTHROPIC_BASE_URL=https://api.ainative.studio

# Interactive mode
cody

# Single prompt
cody -p "Write a function to sort an array"

# Print mode (pipe-friendly)
cody --print "What is 2+2?"

# Specify model
cody --model qwen-coder-7b -p "Explain this error"
```

## Models

| Model | Parameters | Best For |
|-------|-----------|----------|
| `qwen-coder-32b` | 32B | Default — best code quality |
| `qwen-coder-7b` | 7B | Fast iteration, simple tasks |
| `nouscoder-14b` | 14B | Balanced code model |
| `gemma-9b` | 9B | General text and reasoning |
| `deepseek-r1-distill-qwen-7b` | 7B | Step-by-step reasoning |

## Features

- **Streaming chat** — real-time token streaming with Ink-based TUI
- **Tool use** — file read/write, bash execution, search
- **MCP servers** — connect to Model Context Protocol servers
- **OAuth 2.1 + PKCE** — secure browser-based authentication
- **Settings sync** — sync preferences across devices
- **Auto-update** — checks for new versions automatically

## Documentation

| Guide | Description |
|-------|-------------|
| [Architecture](docs/ARCHITECTURE.md) | System design and build pipeline |
| [Development](docs/DEVELOPMENT.md) | Setup, build, and contribute |
| [Distribution](docs/DISTRIBUTION.md) | Packaging, publishing, and releases |
| [Testing](docs/TESTING.md) | E2E test suite and CI |
| [OAuth Guide](docs/OAUTH_GUIDE.md) | Authentication flow details |
| [Models](docs/MODELS.md) | Available models and selection |

## Agents: Self-Provision Here

Point your agent here to programmatically self-provision AINative services — no human required:

```
https://ainative.studio/agent.md
```

DNS discovery: `dig TXT _agents.ainative.studio`

Supports OpenClaw agents, MCP-native agents, and any agent that can follow onboarding instructions.

## Community

- **Discord**: [discord.gg/paipalooza](https://discord.gg/paipalooza)
- **Website**: [ainative.studio](https://ainative.studio)
- **Support**: support@ainative.studio

## License

UNLICENSED — All Rights Reserved. Copyright (c) 2026 AINative Studio.
