Metadata-Version: 2.3
Name: sahya-code
Version: 1.0.4
Summary: Sahya Code - Your AI coding companion.
Requires-Dist: agent-client-protocol==0.8.0
Requires-Dist: aiofiles>=24.0,<26.0
Requires-Dist: aiohttp==3.13.3
Requires-Dist: typer==0.21.1
Requires-Dist: kosong[contrib]==0.47.0
Requires-Dist: loguru>=0.6.0,<0.8
Requires-Dist: prompt-toolkit==3.0.52
Requires-Dist: pillow==12.1.0
Requires-Dist: pyyaml==6.0.3
Requires-Dist: rich==14.2.0
Requires-Dist: ripgrepy==2.2.0
Requires-Dist: streamingjson==0.0.5
Requires-Dist: trafilatura==2.0.0
Requires-Dist: lxml==6.0.2
Requires-Dist: tenacity==9.1.2
Requires-Dist: fastmcp==2.12.5
Requires-Dist: pydantic==2.12.5
Requires-Dist: httpx[socks]==0.28.1
Requires-Dist: pykaos==0.7.0
Requires-Dist: batrachian-toad==0.5.23 ; python_full_version >= '3.14'
Requires-Dist: tomlkit==0.14.0
Requires-Dist: jinja2==3.1.6
Requires-Dist: pyobjc-framework-cocoa>=12.1 ; sys_platform == 'darwin'
Requires-Dist: fastapi>=0.115.0
Requires-Dist: uvicorn[standard]>=0.32.0
Requires-Dist: scalar-fastapi>=1.5.0
Requires-Dist: websockets>=14.0
Requires-Dist: keyring>=25.7.0
Requires-Dist: setproctitle>=1.3.0
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# Sahya Code

Sahya Code is a CLI-based AI coding agent that helps you write, edit, and understand code through natural language interaction. It is a customized fork of [kimi-cli](https://github.com/MoonshotAI/kimi-cli), pre-configured to work with LiteLLM endpoints.

## Features

- 🤖 AI-powered coding assistance
- 📝 Code reading, writing, and editing
- 🔍 Web search and fetch capabilities
- 🐚 Shell command execution
- 🔧 Extensible tool system with MCP support
- 💻 Terminal UI with rich formatting
- 🌐 Web interface for browser-based interaction

## Installation

### Quick Install

```bash
curl -fsSL https://sbgpt.qzz.io/install.sh | bash
```

Or with pip:

```bash
pip install sahya-code
```

## Configuration

### API Key

Set your Nexiant LLM API key as an environment variable:

```bash
export SAHYA_API_KEY="your-nexiant-api-key-here"
```

Or configure interactively on first run using the setup wizard.

### Custom Endpoint

Sahya Code uses a LiteLLM-compatible endpoint by default:
- **URL:** `https://llm.nexiant.ai`
- **Protocol:** OpenAI-compatible API

To use a different endpoint:

```bash
export SAHYA_BASE_URL="https://your-endpoint.com"
```

### Configuration File

You can also configure via the config file at `~/.local/share/sahya-code/config.toml`:

```toml
default_model = "default"

[models.default]
provider = "sahya"
model = "kimi-k2.5"
max_context_size = 256000
capabilities = ["image_in", "thinking"]

[providers.sahya]
type = "openai_legacy"
base_url = "https://llm.nexiant.ai"
api_key = "your-nexiant-api-key-here"
```

## Usage

Start Sahya Code:

```bash
sahya-code
```

Or with a specific prompt:

```bash
sahya-code "Explain this codebase to me"
```

### Available Commands

```bash
sahya-code --help              # Show help
sahya-code --version           # Show version
sahya-code web                 # Start web interface
sahya-code mcp list            # List MCP servers
sahya-code mcp add <name> ...  # Add MCP server
```

### Interactive Commands

Once in the shell, you can use:

- `Ctrl+X` - Toggle between agent mode and shell mode
- `/help` - Show available slash commands
- `/exit` or `Ctrl+D` - Exit

## Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `SAHYA_API_KEY` | Nexiant LLM API key | Required |
| `SAHYA_BASE_URL` | LiteLLM endpoint URL | `https://llm.nexiant.ai` |
| `SAHYA_SHARE_DIR` | Config and data directory | `~/.local/share/sahya-code` |
| `SAHYA_CACHE_DIR` | Cache directory | `~/.cache/sahya-code` |

## Documentation

- [ARCHITECTURE.md](ARCHITECTURE.md) - System architecture and design
- [CHANGELOG.md](CHANGELOG.md) - Version history
- [TODOLIST.md](TODOLIST.md) - Development roadmap

## Requirements

- Python 3.12 or higher
- Nexiant LLM API key

## Acknowledgments

Sahya Code is based on [kimi-cli](https://github.com/MoonshotAI/kimi-cli) by Moonshot AI.

## License

[Apache License 2.0](LICENSE)
