Metadata-Version: 2.4
Name: quasar-ai
Version: 1.1.0
Summary: 🚀 QUASAR - AI-powered CLI code editor with agentic capabilities
Author: Sunil Kumawat
License: MIT
Project-URL: Homepage, https://github.com/sunilkumawat/quasar-ai
Project-URL: Documentation, https://github.com/sunilkumawat/quasar-ai#readme
Project-URL: Repository, https://github.com/sunilkumawat/quasar-ai
Keywords: ai,cli,code-editor,llm,agent,langchain
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
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: Topic :: Software Development :: Code Generators
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.9.0
Requires-Dist: rich>=13.0.0
Requires-Dist: fastapi>=0.109.0
Requires-Dist: uvicorn[standard]>=0.27.0
Requires-Dist: python-multipart>=0.0.6
Requires-Dist: pydantic>=2.5.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: langchain>=0.1.0
Requires-Dist: langchain-core>=0.1.0
Requires-Dist: langchain-openai>=0.0.5
Requires-Dist: langchain-groq>=0.0.1
Requires-Dist: langchain-ollama>=0.0.1
Requires-Dist: websockets>=12.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# 🚀 QUASAR - AI-Powered CLI Code Editor

An intelligent command-line assistant that can understand your codebase, generate code, fix bugs, and execute tasks using AI.

## Installation

```bash
pip install quasar-ai
```

## Setup API Keys

**IMPORTANT**: You must provide your own API keys. QUASAR does not include any API keys.

### Option 1: Using `.env` file (Recommended)

Create a `.env` file in your project directory:

```env
# Groq (recommended - fast inference)
GROQ_API_KEY_1=gsk_your_key_here
GROQ_API_KEY_2=gsk_your_second_key_here

# Cerebras
CEREBRAS_API_KEY_1=csk_your_key_here

# Ollama runs locally - no API key needed
```

### Option 2: Using Environment Variables

```bash
# Groq
export GROQ_API_KEY_1="gsk_your_key_here"
export GROQ_API_KEY_2="gsk_your_second_key_here"

# Cerebras
export CEREBRAS_API_KEY_1="csk_your_key_here"
```

### Multiple Keys & Fallback Behavior

You can add multiple keys per provider (e.g., `GROQ_API_KEY_1`, `GROQ_API_KEY_2`, `GROQ_API_KEY_3`).

**In Auto mode** (default):
- If the first key hits rate limits or fails, QUASAR automatically tries the second key
- If all keys for a provider fail, it falls back to the next provider
- Fallback chain: Groq → Cerebras → Ollama

**Get free API keys:**
- Groq: https://console.groq.com
- Cerebras: https://cloud.cerebras.ai

## Usage

### Interactive Mode (REPL)
```bash
quasar
# or
quasar --interactive
```

### Single Command
```bash
quasar "create a hello.py file that prints Hello World"
quasar "explain main.py"
quasar "fix the bug in utils.py"
quasar "list files in current directory"
```

### Specify Workspace
```bash
quasar --workspace /path/to/project "add tests for api.py"
```

### Custom Model Selection

By default, QUASAR automatically selects the best model for each task. You can override this with `--model`:

```bash
# Use a specific Cerebras model
quasar --model cerebras/qwen-3-32b "explain this code"

# Use Groq with a specific model
quasar --model groq/llama-3.3-70b-versatile "create a REST API"

# Use local Ollama model
quasar --model ollama/qwen2.5-coder:7b "fix the bug"

# Interactive mode with custom model
quasar -i -m cerebras/qwen-3-32b
```

> **Note**: When you select a model, it will be used for ALL tasks. Choose a model that supports tool calling and has good reasoning capabilities.

## Supported Tasks

QUASAR automatically classifies your request and uses the best model:

| Task | Example |
|------|---------|
| Chat | "What is machine learning?" |
| Code Generation | "Create a REST API endpoint" |
| Bug Fixing | "Fix the TypeError in app.py" |
| Code Explanation | "Explain this function" |
| Refactoring | "Improve the structure of utils.py" |
| Documentation | "Add docstrings to main.py" |
| Test Generation | "Write tests for calculator.py" |

## Web Tools (Beta)

QUASAR can search the web and read URLs to help with your tasks:

```bash
quasar "search for the latest Python best practices"
quasar "read the documentation at https://docs.python.org/3/library/asyncio.html"
```

### Web Search Configuration

Add to your `.env` file:

```env
# Tavily API Key - Get from https://tavily.com
TAVILY_API_KEY=your_tavily_api_key_here

# SearXNG Host (if self-hosting)
# SEARX_HOST=http://localhost:8080
```

> ⚠️ **Beta**: Web tools are in beta phase. Results may vary.

## Updating

```bash
pip install --upgrade quasar-ai
```

