koder 0.2.0__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {koder-0.2.0 → koder-0.3.1}/.claude/settings.local.json +2 -1
- koder-0.3.1/.vscode/koder.json +12 -0
- koder-0.3.1/CLAUDE.md +1 -0
- koder-0.3.1/CONTRIBUTING.md +165 -0
- koder-0.3.1/KODER.md +108 -0
- koder-0.3.1/PKG-INFO +243 -0
- koder-0.3.1/README.md +222 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/__init__.py +1 -1
- {koder-0.2.0 → koder-0.3.1}/koder_agent/agentic/__init__.py +3 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/agentic/agent.py +0 -14
- koder-0.3.1/koder_agent/agentic/approval_hooks.py +66 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/cli.py +49 -56
- {koder-0.2.0 → koder-0.3.1}/koder_agent/core/commands.py +31 -17
- {koder-0.2.0 → koder-0.3.1}/koder_agent/core/interactive.py +24 -19
- koder-0.3.1/koder_agent/core/permissions.py +300 -0
- koder-0.3.1/koder_agent/core/scheduler.py +405 -0
- koder-0.3.1/koder_agent/core/streaming_display.py +491 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/mcp/cli_handler.py +2 -2
- {koder-0.2.0 → koder-0.3.1}/koder_agent/tools/engine.py +14 -3
- {koder-0.2.0 → koder-0.3.1}/koder_agent/tools/task_ops.py +1 -0
- koder-0.3.1/koder_agent/utils/__init__.py +17 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/utils/client.py +3 -3
- koder-0.3.1/koder_agent/utils/sessions.py +81 -0
- {koder-0.2.0 → koder-0.3.1}/pyproject.toml +6 -6
- {koder-0.2.0 → koder-0.3.1}/uv.lock +76 -70
- koder-0.2.0/CLAUDE.md +0 -79
- koder-0.2.0/KODER.md +0 -1
- koder-0.2.0/PKG-INFO +0 -229
- koder-0.2.0/README.md +0 -208
- koder-0.2.0/koder_agent/core/scheduler.py +0 -349
- koder-0.2.0/koder_agent/utils/__init__.py +0 -7
- {koder-0.2.0 → koder-0.3.1}/.github/dependabot.yml +0 -0
- {koder-0.2.0 → koder-0.3.1}/.gitignore +0 -0
- {koder-0.2.0 → koder-0.3.1}/LICENSE +0 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/agentic/hooks.py +0 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/core/__init__.py +0 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/core/context.py +0 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/core/security.py +0 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/mcp/__init__.py +0 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/mcp/server_config.py +0 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/mcp/server_factory.py +0 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/mcp/server_manager.py +0 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/tools/__init__.py +0 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/tools/file_ops.py +0 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/tools/search_ops.py +0 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/tools/shell_ops.py +0 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/tools/todo_ops.py +0 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/tools/web_ops.py +0 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/utils/prompts.py +0 -0
- {koder-0.2.0 → koder-0.3.1}/koder_agent/utils/queue.py +0 -0
koder-0.3.1/CLAUDE.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
KODER.md
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Contributing to Koder
|
|
2
|
+
|
|
3
|
+
Welcome to Koder! We're excited that you want to contribute to this experimental AI coding assistant. This project is a learning-focused exploration of building advanced terminal-based AI agents, and we welcome contributions of all kinds.
|
|
4
|
+
|
|
5
|
+
## Project Philosophy
|
|
6
|
+
|
|
7
|
+
Koder is designed as both a functional tool and a learning playground for AI agent development. We value:
|
|
8
|
+
|
|
9
|
+
- **Experimentation**: Trying new approaches and learning from them
|
|
10
|
+
- **Clean Architecture**: Well-structured, maintainable Python code
|
|
11
|
+
- **Security First**: Robust validation and permission systems
|
|
12
|
+
- **Universal Compatibility**: Supporting multiple AI providers and use cases
|
|
13
|
+
- **Community Learning**: Sharing knowledge and growing together
|
|
14
|
+
|
|
15
|
+
## Getting Started
|
|
16
|
+
|
|
17
|
+
### Prerequisites
|
|
18
|
+
|
|
19
|
+
- Python 3.9 or higher
|
|
20
|
+
- [uv](https://docs.astral.sh/uv/) package manager (recommended)
|
|
21
|
+
- Git for version control
|
|
22
|
+
- API key for at least one AI provider (OpenAI, Anthropic, Google, etc.)
|
|
23
|
+
|
|
24
|
+
### Development Setup
|
|
25
|
+
|
|
26
|
+
1. **Fork and Clone**
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git clone https://github.com/feiskyer/koder.git
|
|
30
|
+
cd koder
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
2. **Set Up Environment**
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Install dependencies
|
|
37
|
+
uv sync
|
|
38
|
+
|
|
39
|
+
# Configure AI provider (example: OpenAI)
|
|
40
|
+
export OPENAI_API_KEY="your-api-key"
|
|
41
|
+
export KODER_MODEL="gpt-4o"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
3. **Verify Installation**
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Test the CLI
|
|
48
|
+
uv run koder "Hello, Koder!"
|
|
49
|
+
|
|
50
|
+
# Run in interactive mode
|
|
51
|
+
uv run koder
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
4. **Run Development Commands**
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Code formatting
|
|
58
|
+
black .
|
|
59
|
+
|
|
60
|
+
# Linting and fixes
|
|
61
|
+
ruff check --fix
|
|
62
|
+
|
|
63
|
+
# Error-only pylint check
|
|
64
|
+
pylint koder_agent/ --disable=C,R,W --errors-only
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Development Guidelines
|
|
68
|
+
|
|
69
|
+
### Code Style
|
|
70
|
+
|
|
71
|
+
We use automated tooling to maintain consistent code quality:
|
|
72
|
+
|
|
73
|
+
- **Black**: Code formatting (`black .`)
|
|
74
|
+
- **Ruff**: Linting and import sorting (`ruff check --fix`)
|
|
75
|
+
- **Pylint**: Additional error checking (`pylint koder_agent/ --disable=C,R,W --errors-only`)
|
|
76
|
+
|
|
77
|
+
### Code Quality Standards
|
|
78
|
+
|
|
79
|
+
1. **Type Hints**: Use type annotations for function parameters and return values
|
|
80
|
+
2. **Docstrings**: Document all public functions and classes
|
|
81
|
+
3. **Error Handling**: Implement proper exception handling with informative messages
|
|
82
|
+
4. **Security**: Follow SecurityGuard patterns for input validation
|
|
83
|
+
5. **Testing**: Add tests for new features (when applicable)
|
|
84
|
+
|
|
85
|
+
### Architecture Principles
|
|
86
|
+
|
|
87
|
+
1. **Separation of Concerns**: Keep tools, core logic, and UI separate
|
|
88
|
+
2. **Plugin Architecture**: New tools should extend the tool engine
|
|
89
|
+
3. **Security by Default**: All user inputs must be validated
|
|
90
|
+
4. **Provider Agnostic**: Support multiple AI providers through abstraction
|
|
91
|
+
5. **Rich UI**: Use Rich library for terminal interfaces
|
|
92
|
+
|
|
93
|
+
## Making Contributions
|
|
94
|
+
|
|
95
|
+
1. **Create an Issue** (for significant changes)
|
|
96
|
+
|
|
97
|
+
- Describe the problem or feature request
|
|
98
|
+
- Discuss the approach with maintainers
|
|
99
|
+
- Get feedback before implementation
|
|
100
|
+
|
|
101
|
+
2. **Fork and Branch**
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
git checkout -b feature/your-feature-name
|
|
105
|
+
# or
|
|
106
|
+
git checkout -b fix/issue-description
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
3. **Develop and Test**
|
|
110
|
+
|
|
111
|
+
- Write clean, documented code
|
|
112
|
+
- Run code quality checks
|
|
113
|
+
- Test your changes thoroughly
|
|
114
|
+
- Update documentation if needed
|
|
115
|
+
|
|
116
|
+
4. **Commit and Push**
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# Make atomic, descriptive commits
|
|
120
|
+
git add .
|
|
121
|
+
git commit -m "feat: add new tool for X functionality"
|
|
122
|
+
|
|
123
|
+
# Push to your fork
|
|
124
|
+
git push origin feature/your-feature-name
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
5. **Create Pull Request**
|
|
128
|
+
- Use a clear, descriptive title
|
|
129
|
+
- Reference related issues
|
|
130
|
+
- Describe what you changed and why
|
|
131
|
+
- Include testing information
|
|
132
|
+
|
|
133
|
+
## Security Considerations
|
|
134
|
+
|
|
135
|
+
### Security Requirements
|
|
136
|
+
|
|
137
|
+
1. **Input Validation**: All user inputs must be validated
|
|
138
|
+
2. **Command Safety**: Shell commands require SecurityGuard approval
|
|
139
|
+
3. **API Key Protection**: Never log or expose API keys
|
|
140
|
+
4. **Output Filtering**: Filter sensitive information from outputs
|
|
141
|
+
5. **Permission Checks**: Tool execution must check permissions
|
|
142
|
+
|
|
143
|
+
### Reporting Security Issues
|
|
144
|
+
|
|
145
|
+
For security vulnerabilities:
|
|
146
|
+
|
|
147
|
+
1. **DO NOT** create public issues
|
|
148
|
+
2. Email maintainers privately
|
|
149
|
+
3. Provide detailed reproduction steps
|
|
150
|
+
4. Allow time for responsible disclosure
|
|
151
|
+
|
|
152
|
+
## Community Guidelines
|
|
153
|
+
|
|
154
|
+
### Code of Conduct
|
|
155
|
+
|
|
156
|
+
- **Be Respectful**: Treat all community members with respect
|
|
157
|
+
- **Be Inclusive**: Welcome contributors of all backgrounds and skill levels
|
|
158
|
+
- **Be Collaborative**: Work together and help each other learn
|
|
159
|
+
- **Be Patient**: Remember that everyone is learning
|
|
160
|
+
|
|
161
|
+
### Getting Help
|
|
162
|
+
|
|
163
|
+
- **GitHub Issues**: For bugs and feature requests
|
|
164
|
+
- **GitHub Discussions**: For questions and general discussion
|
|
165
|
+
- **Code Reviews**: Ask for feedback on your contributions
|
koder-0.3.1/KODER.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to KODER and Agentic AI when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
### Development Setup
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Install dependencies
|
|
11
|
+
uv sync
|
|
12
|
+
|
|
13
|
+
# Run the CLI in interactive mode
|
|
14
|
+
uv run koder
|
|
15
|
+
|
|
16
|
+
# Run with a single prompt
|
|
17
|
+
uv run koder "Help me implement a new feature"
|
|
18
|
+
|
|
19
|
+
# Run with specific session
|
|
20
|
+
uv run koder --session my-session "Your prompt"
|
|
21
|
+
|
|
22
|
+
# Enable streaming mode (default)
|
|
23
|
+
uv run koder --stream "Your prompt"
|
|
24
|
+
|
|
25
|
+
# Disable streaming mode
|
|
26
|
+
uv run koder --no-stream "Your prompt"
|
|
27
|
+
|
|
28
|
+
# Resume a previous session
|
|
29
|
+
uv run koder --resume
|
|
30
|
+
|
|
31
|
+
# MCP server management
|
|
32
|
+
uv run koder mcp list
|
|
33
|
+
uv run koder mcp add myserver command arg1 arg2
|
|
34
|
+
uv run koder mcp remove myserver
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Development Commands
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Code formatting
|
|
41
|
+
black .
|
|
42
|
+
|
|
43
|
+
# Linting
|
|
44
|
+
ruff check --fix
|
|
45
|
+
|
|
46
|
+
# pylint
|
|
47
|
+
pylint koder_agent/ --disable=C,R,W --errors-only
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Architecture
|
|
51
|
+
|
|
52
|
+
### Core Components
|
|
53
|
+
|
|
54
|
+
**Agent Scheduler (`koder_agent/core/scheduler.py`)**: Central orchestrator that manages agent execution, handles streaming with Rich Live displays, and coordinates context management. Uses semaphores for concurrency control and includes intelligent cleanup of streaming content.
|
|
55
|
+
|
|
56
|
+
**Context Manager (`koder_agent/core/context.py`)**: Manages conversation history with SQLite storage at `~/.koder/koder.db`, implements token-aware compression (50k token limit using tiktoken), and handles session management across multiple projects.
|
|
57
|
+
|
|
58
|
+
**Tool Engine (`koder_agent/tools/engine.py`)**: Registers and executes tools with Pydantic validation, filters sensitive information from outputs, enforces security checks via SecurityGuard, and maintains an allowed tools list.
|
|
59
|
+
|
|
60
|
+
**Permission Manager (`koder_agent/core/permissions.py`)**: Handles tool execution permissions and approval workflows, supporting both automatic and interactive approval modes.
|
|
61
|
+
|
|
62
|
+
**MCP Server Manager (`koder_agent/mcp/server_manager.py`)**: Manages Model Context Protocol (MCP) server configurations stored in SQLite, supporting stdio, SSE, and HTTP transports.
|
|
63
|
+
|
|
64
|
+
### Agent System
|
|
65
|
+
|
|
66
|
+
The project uses the `openai-agents` library with multi-provider support:
|
|
67
|
+
|
|
68
|
+
- **Main Agent**: `create_dev_agent()` - Primary development agent with full tool access and MCP integration
|
|
69
|
+
- **Model Selection**: Automatically chooses appropriate model via `get_model_name()` supporting OpenAI, Anthropic Claude, Google Gemini, Azure OpenAI, GitHub Copilot, and 100+ providers via LiteLLM
|
|
70
|
+
- **Provider Detection**: Auto-detects provider based on environment variables with fallback defaults
|
|
71
|
+
|
|
72
|
+
### Tool Categories
|
|
73
|
+
|
|
74
|
+
1. **File Operations**: `read_file`, `write_file`, `append_file`, `list_directory`
|
|
75
|
+
2. **Search Operations**: `glob_search`, `grep_search`
|
|
76
|
+
3. **Shell Operations**: `run_shell`, `git_command`
|
|
77
|
+
4. **Web Operations**: `web_search`, `web_fetch`
|
|
78
|
+
5. **Task Management**: `todo_read`, `todo_write`, `task_delegate`
|
|
79
|
+
|
|
80
|
+
### Key Features
|
|
81
|
+
|
|
82
|
+
- **Streaming Support**: Real-time output with Rich Live displays and intelligent terminal cleanup
|
|
83
|
+
- **Context Persistence**: Conversation history across sessions with automatic compression
|
|
84
|
+
- **Tool Validation**: Pydantic schemas with security checks and output filtering
|
|
85
|
+
- **Interactive CLI**: Rich-formatted panels, prompts, and session management
|
|
86
|
+
- **MCP Integration**: Support for Model Context Protocol servers with multiple transport types
|
|
87
|
+
- **Multi-Provider AI**: Universal provider support with intelligent auto-detection
|
|
88
|
+
- **Session Management**: Per-project session isolation with resume capability
|
|
89
|
+
|
|
90
|
+
### Configuration
|
|
91
|
+
|
|
92
|
+
- **Context Loading**: The CLI looks for `KODER.md` in the working directory to load project-specific context
|
|
93
|
+
- **Database**: SQLite database at `~/.koder/koder.db` stores conversation history and MCP server configs
|
|
94
|
+
- **AI Provider Setup**: Set API credentials via environment variables (see README.md for provider-specific setup)
|
|
95
|
+
- **Model Selection**: Use `KODER_MODEL` environment variable to specify which model to use across providers
|
|
96
|
+
|
|
97
|
+
### Security Features
|
|
98
|
+
|
|
99
|
+
- **Command Validation**: SecurityGuard validates shell commands before execution
|
|
100
|
+
- **Output Filtering**: Automatic filtering of API keys, tokens, and sensitive information
|
|
101
|
+
- **Permission System**: Tool execution requires permission checks, with approval hooks for interactive mode
|
|
102
|
+
- **Input Sanitization**: Validation of all tool inputs using Pydantic schemas
|
|
103
|
+
|
|
104
|
+
### Entry Points
|
|
105
|
+
|
|
106
|
+
- **CLI Entry**: `koder_agent.cli:run` - Main CLI interface with argument parsing and session management
|
|
107
|
+
- **Interactive Mode**: `koder_agent/core/interactive.py` - Rich-based interactive prompt with command completion
|
|
108
|
+
- **Slash Commands**: `koder_agent/core/commands.py` - Built-in commands for session management and utilities
|
koder-0.3.1/PKG-INFO
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: koder
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: An intuitive AI coding assistant and interactive CLI tool that boosts developer productivity with intelligent automation and context-aware support.
|
|
5
|
+
Author: Pengfei Ni
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: agent,agentic,ai,copilot,litellm,openai,vibe coding
|
|
8
|
+
Requires-Python: >=3.9
|
|
9
|
+
Requires-Dist: aiosqlite>=0.19.0
|
|
10
|
+
Requires-Dist: beautifulsoup4>=4.12.0
|
|
11
|
+
Requires-Dist: google-cloud-aiplatform>=1.106.0
|
|
12
|
+
Requires-Dist: httpx[socks]>=0.25.0
|
|
13
|
+
Requires-Dist: openai-agents[litellm]>=0.2.4
|
|
14
|
+
Requires-Dist: openai==1.98.0
|
|
15
|
+
Requires-Dist: prompt-toolkit>=3.0.51
|
|
16
|
+
Requires-Dist: pydantic>=2.0.0
|
|
17
|
+
Requires-Dist: requests>=2.31.0
|
|
18
|
+
Requires-Dist: rich>=13.0.0
|
|
19
|
+
Requires-Dist: tiktoken>=0.5.0
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# Koder
|
|
23
|
+
|
|
24
|
+
[](https://www.python.org/downloads/) [](LICENSE) [](https://github.com/psf/black) [](https://github.com/astral-sh/ruff) [](https://pepy.tech/projects/koder)
|
|
25
|
+
|
|
26
|
+
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.
|
|
27
|
+
|
|
28
|
+
**🎯 Project Status**: Under active vibe coding! This is a learning-focused project where we explore building AI coding agents.
|
|
29
|
+
|
|
30
|
+
## ✨ Features
|
|
31
|
+
|
|
32
|
+
- **🤖 Universal AI Support**: Works with OpenAI, Anthropic, Google, GitHub Copilot, and 100+ providers via LiteLLM with intelligent auto-detection
|
|
33
|
+
- **💾 Smart Context Management**: Persistent sessions with SQLite storage and automatic token-aware compression (50k token limit)
|
|
34
|
+
- **🔄 Real-time Streaming**: Rich Live displays with intelligent terminal cleanup for responsive user experience
|
|
35
|
+
- **🛠️ Comprehensive Toolset**: file operations, search, shell, task delegation and todos.
|
|
36
|
+
- **🔌 MCP Integration**: Model Context Protocol support with stdio, SSE, and HTTP transports for extensible tool ecosystem
|
|
37
|
+
- **🛡️ Enterprise Security**: SecurityGuard validation, output filtering, permission system, and input sanitization
|
|
38
|
+
- **🎯 Zero Configuration**: Automatic provider detection with fallback defaults
|
|
39
|
+
|
|
40
|
+
## 🛠️ Installation
|
|
41
|
+
|
|
42
|
+
### Using uv (Recommended)
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
uv tool install koder
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Using pip
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install koder
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## ⚡ Quick Start
|
|
55
|
+
|
|
56
|
+
Simply run Koder with your question or request:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Configure one provider (example: OpenAI)
|
|
60
|
+
export OPENAI_API_KEY="your-openai-api-key"
|
|
61
|
+
export KODER_MODEL="gpt-4o"
|
|
62
|
+
|
|
63
|
+
# Run in interactive mode
|
|
64
|
+
koder
|
|
65
|
+
|
|
66
|
+
# Run with prompt
|
|
67
|
+
koder "create a Python function to calculate fibonacci numbers"
|
|
68
|
+
|
|
69
|
+
# Execute a single prompt in a named session
|
|
70
|
+
koder -s my-project "Help me implement a new feature"
|
|
71
|
+
|
|
72
|
+
# Use an explicit session flag
|
|
73
|
+
koder --session my-project "Your prompt here"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## 🤖 Configuration
|
|
77
|
+
|
|
78
|
+
### Environment Variables
|
|
79
|
+
|
|
80
|
+
Koder automatically detects your AI provider based on available environment variables. The `KODER_MODEL` environment variable controls which model to use:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# OpenAI models
|
|
84
|
+
export KODER_MODEL="gpt-4.1"
|
|
85
|
+
|
|
86
|
+
# Claude models (via LiteLLM)
|
|
87
|
+
export KODER_MODEL="claude-opus-4-20250514"
|
|
88
|
+
|
|
89
|
+
# Google models (via LiteLLM)
|
|
90
|
+
export KODER_MODEL="gemini/gemini-2.5-pro"
|
|
91
|
+
|
|
92
|
+
# Github Copilot (via LiteLLM)
|
|
93
|
+
export KODER_MODEL="github_copilot/claude-sonnet-4"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Supported Providers
|
|
97
|
+
|
|
98
|
+
<details>
|
|
99
|
+
<summary><b>OpenAI</b></summary>
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
export OPENAI_API_KEY=your-api-key
|
|
103
|
+
|
|
104
|
+
# Optional: Use custom endpoint
|
|
105
|
+
export OPENAI_API_BASE=https://your-endpoint.com
|
|
106
|
+
|
|
107
|
+
# Optional: Specify model (default: gpt-4.1)
|
|
108
|
+
export KODER_MODEL="gpt-4o"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
</details>
|
|
112
|
+
|
|
113
|
+
<details>
|
|
114
|
+
<summary><b>Anthropic</b></summary>
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
export ANTHROPIC_API_KEY=your-api-key
|
|
118
|
+
export KODER_MODEL="claude-opus-4-20250514"
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
</details>
|
|
123
|
+
|
|
124
|
+
<details>
|
|
125
|
+
<summary><b>Google (Gemini)</b></summary>
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
export GOOGLE_API_KEY=your-api-key
|
|
129
|
+
# Optional: Specify model (default: gemini/gemini-2.5-pro)
|
|
130
|
+
export KODER_MODEL="gemini/gemini-2.5-pro"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
</details>
|
|
134
|
+
|
|
135
|
+
<details>
|
|
136
|
+
<summary><b>GitHub Copilot</b></summary>
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
export KODER_MODEL="github_copilot/claude-sonnet-4"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
On first run you will see a device code in the terminal. Visit <https://github.com/login/device> and enter the code to authenticate.
|
|
143
|
+
|
|
144
|
+
</details>
|
|
145
|
+
|
|
146
|
+
<details>
|
|
147
|
+
<summary><b>Azure OpenAI</b></summary>
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Required
|
|
151
|
+
export AZURE_OPENAI_API_KEY="your-azure-api-key"
|
|
152
|
+
export AZURE_OPENAI_ENDPOINT="https://your-resource.openai.azure.com"
|
|
153
|
+
|
|
154
|
+
# Your Azure deployment name (often different from the base model name)
|
|
155
|
+
export AZURE_OPENAI_DEPLOYMENT="my-gpt4o-deployment"
|
|
156
|
+
|
|
157
|
+
# Choose a model that maps to your deployment
|
|
158
|
+
export KODER_MODEL="gpt-4o"
|
|
159
|
+
|
|
160
|
+
# Optional: API version
|
|
161
|
+
export AZURE_OPENAI_API_VERSION="2025-04-01-preview"
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Tips:
|
|
165
|
+
|
|
166
|
+
- Ensure the endpoint hostname matches your Azure resource.
|
|
167
|
+
- AZURE_OPENAI_DEPLOYMENT must match the deployed model name in Azure.
|
|
168
|
+
|
|
169
|
+
</details>
|
|
170
|
+
|
|
171
|
+
<details>
|
|
172
|
+
<summary><b>Other AI providers (via LiteLLM)</b></summary>
|
|
173
|
+
|
|
174
|
+
[LiteLLM](https://docs.litellm.ai/docs/providers) supports 100+ providers including Anthropic, Google, Cohere, Hugging Face, and more:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Google Vertex AI
|
|
178
|
+
export GOOGLE_APPLICATION_CREDENTIALS="your-sa-path.json"
|
|
179
|
+
export VERTEXAI_LOCATION="<your-region>"
|
|
180
|
+
export KODER_MODEL="vertex_ai/claude-sonnet-4@20250514"
|
|
181
|
+
|
|
182
|
+
# Custom OpenAI-compatible endpoints
|
|
183
|
+
export OPENAI_API_KEY="your-key"
|
|
184
|
+
export OPENAI_BASE_URL="https://your-custom-endpoint.com/v1"
|
|
185
|
+
export KODER_MODEL="openai/<your-model-name>"
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
</details>
|
|
189
|
+
|
|
190
|
+
## 🛠️ Development
|
|
191
|
+
|
|
192
|
+
### Setup Development Environment
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# Clone the repository
|
|
196
|
+
git clone https://github.com/feiskyer/koder.git
|
|
197
|
+
cd koder
|
|
198
|
+
|
|
199
|
+
uv sync
|
|
200
|
+
uv run koder
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Code Quality
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
# Code formatting
|
|
207
|
+
black .
|
|
208
|
+
|
|
209
|
+
# Linting
|
|
210
|
+
ruff check --fix
|
|
211
|
+
|
|
212
|
+
# pylint
|
|
213
|
+
pylint koder_agent/ --disable=C,R,W --errors-only
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## 🔒 Security
|
|
217
|
+
|
|
218
|
+
- **API Keys**: All API keys are stored in environment variables and never in code.
|
|
219
|
+
- **Local Storage**: Sessions are stored locally in your home directory.
|
|
220
|
+
- **No Telemetry**: Koder doesn't send any data besides API requests to your chosen provider.
|
|
221
|
+
- **Code Execution**: Shell commands require explicit user confirmation.
|
|
222
|
+
|
|
223
|
+
## 🤝 Contributing
|
|
224
|
+
|
|
225
|
+
Contributions are welcome! Here's how you can help:
|
|
226
|
+
|
|
227
|
+
1. **Fork** the repository
|
|
228
|
+
2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)
|
|
229
|
+
3. **Commit** your changes (`git commit -m 'Add amazing feature'`)
|
|
230
|
+
4. **Push** to the branch (`git push origin feature/amazing-feature`)
|
|
231
|
+
5. **Open** a Pull Request
|
|
232
|
+
|
|
233
|
+
Please read our [Contributing Guidelines](CONTRIBUTING.md) for more details.
|
|
234
|
+
|
|
235
|
+
## 🌐 Code of Conduct
|
|
236
|
+
|
|
237
|
+
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.
|
|
238
|
+
|
|
239
|
+
## 📄 License
|
|
240
|
+
|
|
241
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
242
|
+
|
|
243
|
+
Use of third-party AI services is governed by their respective provider terms.
|