Getting Started - djvolz/coda-code-assistant GitHub Wiki

Getting Started with Coda

Welcome to Coda! This guide will help you get up and running with your AI-powered code assistant.

Prerequisites

  • Python 3.11 or higher
  • uv (Python package manager)
  • Git

Installation

1. Clone the Repository

git clone https://github.com/djvolz/coda-code-assistant.git
cd coda-code-assistant

2. Install Dependencies

We recommend using uv for dependency management:

# Install dependencies
uv sync

# Run Coda
uv run coda

Alternative: Using pip

If you prefer using pip:

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -e .

First Run

When you run Coda for the first time, it will:

  1. Create a configuration directory at ~/.config/coda/
  2. Initialize with default settings
  3. Auto-detect available AI providers
# Start interactive chat
uv run coda

# Or with a specific provider
uv run coda --provider ollama

Provider Setup

Coda supports multiple AI providers. Here's how to set them up:

🏠 Ollama (Local Models)

Perfect for privacy-conscious users or offline development.

# Install Ollama from https://ollama.ai
# Pull a model
ollama pull llama3.1

# Start Ollama server (in a separate terminal)
ollama serve

# Use with Coda
uv run coda --provider ollama --model llama3.1

☁️ Oracle OCI GenAI

For enterprise users with Oracle Cloud access.

# Option 1: Environment variable
export OCI_COMPARTMENT_ID="ocid1.compartment.oc1..."
uv run coda --provider oci_genai

# Option 2: Configuration file (~/.config/coda/config.toml)
[providers.oci_genai]
compartment_id = "ocid1.compartment.oc1..."

🤖 OpenAI

export OPENAI_API_KEY="sk-..."
uv run coda --provider openai --model gpt-4

🧠 Anthropic

export ANTHROPIC_API_KEY="sk-ant-..."
uv run coda --provider anthropic --model claude-3-opus-20240229

🌐 Google

export GOOGLE_API_KEY="..."
uv run coda --provider google --model gemini-pro

Basic Usage

Interactive Mode

The default mode - start a conversation with your AI assistant:

uv run coda

Use these commands during chat:

  • /help - Show available commands
  • /mode <mode> - Switch AI personality
  • /session save - Save your conversation
  • /session load - Resume a previous conversation
  • /tools - Manage AI tools and capabilities
  • /theme <name> - Change color theme
  • /clear - Clear conversation
  • /exit - Exit Coda

One-Shot Mode

Get a quick answer without entering interactive mode:

uv run coda --one-shot "What is a Python decorator?"

Using Different Models

# List available models
uv run coda --list-models

# Use a specific model
uv run coda --model gpt-4-turbo-preview

Configuration

Coda stores configuration in ~/.config/coda/config.toml:

# Default provider
default_provider = "ollama"

# UI Settings
[ui]
theme = "monokai"  # Available: default, monokai, solarized, nord, minimal
show_thinking_indicator = true
show_model_info = true

# Provider-specific settings
[providers.openai]
api_key = "sk-..."
model = "gpt-4"

[providers.ollama]
base_url = "http://localhost:11434"
model = "llama3.1"

# Tool settings
[tools]
enabled = true
filesystem_enabled = true
git_enabled = true
web_enabled = true

Edit configuration:

# In Coda
/config edit

# Or directly
$EDITOR ~/.config/coda/config.toml

AI Tools & Capabilities

Coda can now execute tasks using built-in tools:

Available Tools

  • File Operations: Read, write, and manage files
  • Git Integration: Status, diff, commit operations
  • Web Tools: Search the internet and fetch web content
  • System Tools: Execute shell commands safely

Using Tools

Simply ask Coda to perform tasks that require tools:

You: "What files are in this directory?"
Coda: [Uses list_files tool to show directory contents]

You: "Search for information about Python decorators"
Coda: [Uses web_search tool to find current information]

Manage tools with the /tools command. Learn more in Agent-Tools.

Next Steps

Troubleshooting

Having issues? Check our Troubleshooting guide or:

# Enable debug mode
uv run coda --debug

# Check version
uv run coda --version

Need help? Open an issue on GitHub.

⚠️ **GitHub.com Fallback** ⚠️