# Vibez
A multi-agent CLI coding assistant built in Rust that uses parallel workers for faster code generation.
## Features
- 🚀 **Parallel Tool Execution** - Independent operations run concurrently for maximum speed
- 🤖 **Multi-Agent Architecture** - Manager coordinates multiple worker agents
- 🔒 **Smart Conflict Detection** - Automatic file locking prevents race conditions
- 📝 **Contract-Based Coordination** - Workers share interfaces through contracts
- ⚡ **Streaming Responses** - Real-time output as the AI generates code
- 🎯 **Topological Task Scheduling** - Dependency-aware task execution
## Installation
### From crates.io (recommended)
```bash
cargo install vibez
```
### From source
```bash
git clone https://github.com/taradepan/vibez
cd vibez
cargo install --path .
```
## Setup
On first run, Vibez will prompt you for your OpenAI API key:
```bash
vibez
🔑 OpenAI API Key Required
Vibez needs your OpenAI API key to function.
Get your API key from: https://platform.openai.com/api-keys
Enter your OpenAI API key: sk-...
💾 Saving API key to ~/.vibez/config.toml...
✓ API key saved to /Users/you/.vibez/config.toml
```
Your API key is securely stored in `~/.vibez/config.toml` and will be used for all future runs.
## Usage
### Interactive mode (REPL)
```bash
vibez
```
### Single prompt mode
```bash
vibez "Add authentication to my app"
```
### Commands
- `/help` - Show available commands
- `/config` - Show current configuration
- `/plan` - Enable plan mode for complex tasks (uses multi-agent architecture)
- `/clear` - Clear screen
- `/quit` - Exit
### Options
```bash
vibez --help
```
## Configuration
### Configuration Priority
Settings are loaded in this order (highest priority last):
1. Default values
2. User config file (`~/.vibez/config.toml`)
3. Project config file (`./.vibez/config.toml`)
4. Environment variables (`VIBEZ_MODEL`, `VIBEZ_VERBOSE`, `VIBEZ_API_TIMEOUT`)
5. CLI arguments (`--model`, `--verbose`)
**Note:** OpenAI API key is NOT loaded from environment variables for security. It must be in a config file.
### Example Config File
`~/.vibez/config.toml`:
```toml
model = "gpt-5.1"
verbose = false
[api]
openai_api_key = "sk-..."
timeout = 60
```
## Architecture
### Multi-Agent System
Vibez features two modes of operation:
#### Single-Agent Mode (Default)
For straightforward tasks, Vibez uses a single agent that handles requests directly with intelligent tool execution.
#### Multi-Agent Mode (`/plan`)
For complex tasks, use `/plan` to activate the multi-agent architecture:
1. **Manager Agent** - Analyzes the task, breaks it down into subtasks, creates coordination contracts, and orchestrates worker agents
2. **Worker Agents** - Execute assigned subtasks in parallel, adhering to contracts and interfaces defined by the manager
3. **Contract System** - Workers share code interfaces through contracts, enabling parallel development without conflicts
4. **Dependency Resolution** - Topological sorting ensures tasks execute in the correct order based on dependencies
5. **File Locking** - Automatic detection and prevention of concurrent file access conflicts
6. **Smart Grouping** - Graph-based algorithm groups independent operations for parallel execution
The multi-agent system excels at:
- Large refactoring tasks spanning multiple files
- Feature implementations requiring coordination across components
- Complex workflows with multiple independent subtasks
- Parallel code generation across different modules
### Core Components
- **Tool Registry** - Provides file operations (read, write, edit), bash commands, and API interactions
- **Streaming Output** - Real-time display of AI responses and progress
- **Rate Limiting** - Semaphore-based control to manage API request concurrency
## Performance
Vibez is designed for speed:
- **Parallel Tool Execution**: Independent file reads/writes run concurrently
- **Conflict Detection**: Graph-based algorithm groups non-conflicting operations
- **Topological Scheduling**: Tasks execute as soon as dependencies are met
- **Rate Limiting**: Semaphore-based API request management
## License
MIT - see [LICENSE](LICENSE) file for details