Skip to main content

An intuitive AI coding assistant and interactive CLI tool that boosts developer productivity with intelligent automation and context-aware support.

Project description

Koder

Python License Code style: black Ruff PyPI Downloads

Koder is an experimental, universal AI coding assistant designed to explore how to build an advanced terminal-based AI coding assistant. Written entirely in Python, it serves as both a functional tool and a learning playground for AI agent development.

🎯 Project Status: Under active vibe coding! This is a learning-focused project where we explore building AI coding agents.

✨ Features

  • 🤖 Universal AI Support: Works with OpenAI, Anthropic, Google, GitHub Copilot, and 100+ providers via LiteLLM with intelligent auto-detection
  • 💾 Smart Context Management: Persistent sessions with SQLite storage and automatic token-aware compression (50k token limit)
  • 🔄 Real-time Streaming: Rich Live displays with intelligent terminal cleanup for responsive user experience
  • 🛠️ Comprehensive Toolset: file operations, search, shell, task delegation and todos.
  • 🔌 MCP Integration: Model Context Protocol support with stdio, SSE, and HTTP transports for extensible tool ecosystem
  • 🛡️ Enterprise Security: SecurityGuard validation, output filtering, permission system, and input sanitization
  • 🎯 Zero Configuration: Automatic provider detection with fallback defaults

🛠️ Installation

Using uv (Recommended)

uv tool install koder

Using pip

pip install koder

⚡ Quick Start

Simply run Koder with your question or request:

# Configure one provider (example: OpenAI)
export OPENAI_API_KEY="your-openai-api-key"
export KODER_MODEL="gpt-4o"

# Run in interactive mode
koder

# Run with prompt
koder "create a Python function to calculate fibonacci numbers"

# Execute a single prompt in a named session
koder -s my-project "Help me implement a new feature"

# Use an explicit session flag
koder --session my-project "Your prompt here"

🤖 Configuration

Environment Variables

Koder automatically detects your AI provider based on available environment variables. The KODER_MODEL environment variable controls which model to use:

# OpenAI models
export KODER_MODEL="gpt-4.1"

# Claude models (via LiteLLM)
export KODER_MODEL="claude-opus-4-20250514"

# Google models (via LiteLLM)
export KODER_MODEL="gemini/gemini-2.5-pro"

# Github Copilot (via LiteLLM)
export KODER_MODEL="github_copilot/claude-sonnet-4"

Supported Providers

OpenAI
export OPENAI_API_KEY=your-api-key

# Optional: Use custom endpoint
export OPENAI_API_BASE=https://your-endpoint.com

# Optional: Specify model (default: gpt-4.1)
export KODER_MODEL="gpt-4o"
Anthropic
export ANTHROPIC_API_KEY=your-api-key
export KODER_MODEL="claude-opus-4-20250514"
Google (Gemini)
export GOOGLE_API_KEY=your-api-key
# Optional: Specify model (default: gemini/gemini-2.5-pro)
export KODER_MODEL="gemini/gemini-2.5-pro"
GitHub Copilot
export KODER_MODEL="github_copilot/claude-sonnet-4"

On first run you will see a device code in the terminal. Visit https://github.com/login/device and enter the code to authenticate.

Azure OpenAI
# Required
export AZURE_OPENAI_API_KEY="your-azure-api-key"
export AZURE_OPENAI_ENDPOINT="https://your-resource.openai.azure.com"

# Your Azure deployment name (often different from the base model name)
export AZURE_OPENAI_DEPLOYMENT="my-gpt4o-deployment"

# Choose a model that maps to your deployment
export KODER_MODEL="gpt-4o"

# Optional: API version
export AZURE_OPENAI_API_VERSION="2025-04-01-preview"

Tips:

  • Ensure the endpoint hostname matches your Azure resource.
  • AZURE_OPENAI_DEPLOYMENT must match the deployed model name in Azure.
Other AI providers (via LiteLLM)

LiteLLM supports 100+ providers including Anthropic, Google, Cohere, Hugging Face, and more:

# Google Vertex AI
export GOOGLE_APPLICATION_CREDENTIALS="your-sa-path.json"
export VERTEXAI_LOCATION="<your-region>"
export KODER_MODEL="vertex_ai/claude-sonnet-4@20250514"

# Custom OpenAI-compatible endpoints
export OPENAI_API_KEY="your-key"
export OPENAI_BASE_URL="https://your-custom-endpoint.com/v1"
export KODER_MODEL="openai/<your-model-name>"

🛠️ Development

Setup Development Environment

# Clone the repository
git clone https://github.com/feiskyer/koder.git
cd koder

uv sync
uv run koder

Code Quality

# Code formatting
black .

# Linting
ruff check --fix

# pylint
pylint koder_agent/ --disable=C,R,W --errors-only

🔒 Security

  • API Keys: All API keys are stored in environment variables and never in code.
  • Local Storage: Sessions are stored locally in your home directory.
  • No Telemetry: Koder doesn't send any data besides API requests to your chosen provider.
  • Code Execution: Shell commands require explicit user confirmation.

🤝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please read our Contributing Guidelines for more details.

🌐 Code of Conduct

This project follows a Code of Conduct based on the Contributor Covenant. Be kind and respectful. If you observe unacceptable behavior, please open an issue.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Use of third-party AI services is governed by their respective provider terms.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

koder-0.3.1.tar.gz (225.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

koder-0.3.1-py3-none-any.whl (57.1 kB view details)

Uploaded Python 3

File details

Details for the file koder-0.3.1.tar.gz.

File metadata

  • Download URL: koder-0.3.1.tar.gz
  • Upload date:
  • Size: 225.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.29

File hashes

Hashes for koder-0.3.1.tar.gz
Algorithm Hash digest
SHA256 796d47bb8e27621fe52cf0e2f5248084a80e798f932388f39ba9957e8397accc
MD5 ae5c60b4bf472c264d6e3e4ee690a3b7
BLAKE2b-256 473f478a83ddae53405146280f664414f2c2fbba37721a85d85c6d8f162940bf

See more details on using hashes here.

File details

Details for the file koder-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: koder-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 57.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.29

File hashes

Hashes for koder-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c1fe92d7c718969bd872f683ffaab10a8b23597a9f7aac5148f828fbaeaa679c
MD5 dd4e129ddf1623cc28b50c00f4ddf0cb
BLAKE2b-256 654c38208d2142b4e1ddbe3376859a758041372da35bc5d9e7e5d446250f2340

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page