koder 0.3.2__tar.gz → 0.4.0__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.3.2/KODER.md → koder-0.4.0/AGENTS.md +1 -1
- koder-0.4.0/PKG-INFO +528 -0
- koder-0.4.0/README.md +493 -0
- {koder-0.3.2 → koder-0.4.0}/koder_agent/agentic/__init__.py +1 -2
- {koder-0.3.2 → koder-0.4.0}/koder_agent/agentic/agent.py +11 -1
- {koder-0.3.2 → koder-0.4.0}/koder_agent/agentic/approval_hooks.py +4 -24
- koder-0.4.0/koder_agent/cli.py +372 -0
- koder-0.4.0/koder_agent/config/__init__.py +27 -0
- koder-0.4.0/koder_agent/config/cli_handler.py +279 -0
- koder-0.4.0/koder_agent/config/manager.py +122 -0
- koder-0.4.0/koder_agent/config/models.py +79 -0
- {koder-0.3.2 → koder-0.4.0}/koder_agent/core/commands.py +92 -28
- koder-0.4.0/koder_agent/core/context.py +440 -0
- {koder-0.3.2 → koder-0.4.0}/koder_agent/core/interactive.py +52 -37
- {koder-0.3.2 → koder-0.4.0}/koder_agent/core/scheduler.py +81 -26
- koder-0.4.0/koder_agent/core/status_line.py +137 -0
- koder-0.4.0/koder_agent/core/streaming_display.py +999 -0
- koder-0.4.0/koder_agent/core/usage_tracker.py +98 -0
- koder-0.4.0/koder_agent/mcp/server_manager.py +231 -0
- {koder-0.3.2 → koder-0.4.0}/koder_agent/tools/__init__.py +34 -8
- {koder-0.3.2 → koder-0.4.0}/koder_agent/tools/engine.py +4 -14
- koder-0.4.0/koder_agent/tools/file.py +235 -0
- koder-0.3.2/koder_agent/tools/search_ops.py → koder-0.4.0/koder_agent/tools/search.py +20 -2
- koder-0.4.0/koder_agent/tools/shell.py +437 -0
- koder-0.3.2/koder_agent/tools/task_ops.py → koder-0.4.0/koder_agent/tools/task.py +11 -1
- koder-0.3.2/koder_agent/tools/todo_ops.py → koder-0.4.0/koder_agent/tools/todo.py +10 -15
- koder-0.3.2/koder_agent/tools/web_ops.py → koder-0.4.0/koder_agent/tools/web.py +32 -30
- {koder-0.3.2 → koder-0.4.0}/koder_agent/utils/__init__.py +8 -1
- koder-0.4.0/koder_agent/utils/client.py +250 -0
- koder-0.4.0/koder_agent/utils/model_info.py +110 -0
- {koder-0.3.2 → koder-0.4.0}/koder_agent/utils/prompts.py +9 -1
- {koder-0.3.2 → koder-0.4.0}/koder_agent/utils/sessions.py +60 -0
- koder-0.4.0/koder_agent/utils/terminal_theme.py +222 -0
- {koder-0.3.2 → koder-0.4.0}/pyproject.toml +28 -17
- koder-0.4.0/scripts/upgrade_dependency.py +105 -0
- koder-0.4.0/tests/test_file_tools.py +496 -0
- koder-0.4.0/tests/test_shell_background.py +378 -0
- koder-0.4.0/tests/test_web.py +402 -0
- koder-0.4.0/uv.lock +4753 -0
- koder-0.3.2/.claude/settings.local.json +0 -20
- koder-0.3.2/.vscode/koder.json +0 -10
- koder-0.3.2/CLAUDE.md +0 -1
- koder-0.3.2/PKG-INFO +0 -254
- koder-0.3.2/README.md +0 -221
- koder-0.3.2/koder_agent/cli.py +0 -236
- koder-0.3.2/koder_agent/core/context.py +0 -154
- koder-0.3.2/koder_agent/core/permissions.py +0 -300
- koder-0.3.2/koder_agent/core/streaming_display.py +0 -491
- koder-0.3.2/koder_agent/mcp/server_manager.py +0 -141
- koder-0.3.2/koder_agent/tools/file_ops.py +0 -109
- koder-0.3.2/koder_agent/tools/shell_ops.py +0 -92
- koder-0.3.2/koder_agent/utils/client.py +0 -55
- koder-0.3.2/uv.lock +0 -3477
- {koder-0.3.2 → koder-0.4.0}/.github/dependabot.yml +0 -0
- {koder-0.3.2 → koder-0.4.0}/.gitignore +0 -0
- {koder-0.3.2 → koder-0.4.0}/CONTRIBUTING.md +0 -0
- {koder-0.3.2 → koder-0.4.0}/LICENSE +0 -0
- {koder-0.3.2 → koder-0.4.0}/koder_agent/__init__.py +0 -0
- {koder-0.3.2 → koder-0.4.0}/koder_agent/agentic/hooks.py +0 -0
- {koder-0.3.2 → koder-0.4.0}/koder_agent/core/__init__.py +0 -0
- {koder-0.3.2 → koder-0.4.0}/koder_agent/core/security.py +0 -0
- {koder-0.3.2 → koder-0.4.0}/koder_agent/mcp/__init__.py +0 -0
- {koder-0.3.2 → koder-0.4.0}/koder_agent/mcp/cli_handler.py +0 -0
- {koder-0.3.2 → koder-0.4.0}/koder_agent/mcp/server_config.py +0 -0
- {koder-0.3.2 → koder-0.4.0}/koder_agent/mcp/server_factory.py +0 -0
- {koder-0.3.2 → koder-0.4.0}/koder_agent/utils/queue.py +0 -0
|
@@ -92,7 +92,7 @@ The project uses the `openai-agents` library with multi-provider support:
|
|
|
92
92
|
|
|
93
93
|
### Configuration
|
|
94
94
|
|
|
95
|
-
- **Context Loading**: The CLI looks for `
|
|
95
|
+
- **Context Loading**: The CLI looks for `AGENTS.md` in the working directory to load project-specific context
|
|
96
96
|
- **Database**: SQLite database at `~/.koder/koder.db` stores conversation history and MCP server configs
|
|
97
97
|
- **AI Provider Setup**: Set API credentials via environment variables (see README.md for provider-specific setup)
|
|
98
98
|
- **Model Selection**: Use `KODER_MODEL` environment variable to specify which model to use across providers
|
koder-0.4.0/PKG-INFO
ADDED
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: koder
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: An intuitive AI coding assistant and interactive CLI tool that boosts developer productivity with intelligent automation and context-aware support.
|
|
5
|
+
Project-URL: Homepage, https://github.com/feiskyer/koder
|
|
6
|
+
Project-URL: Repository, https://github.com/feiskyer/koder
|
|
7
|
+
Author: Pengfei Ni
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Keywords: agent,agentic,ai,copilot,litellm,openai,vibe coding
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Requires-Dist: aiosqlite>=0.21.0
|
|
12
|
+
Requires-Dist: apscheduler>=3.11.1
|
|
13
|
+
Requires-Dist: backoff>=2.2.1
|
|
14
|
+
Requires-Dist: beautifulsoup4>=4.14.2
|
|
15
|
+
Requires-Dist: cryptography>=46.0.3
|
|
16
|
+
Requires-Dist: ddgs>=8.0.1
|
|
17
|
+
Requires-Dist: fastapi-sso>=0.18.0
|
|
18
|
+
Requires-Dist: fastapi>=0.122.0
|
|
19
|
+
Requires-Dist: google-cloud-aiplatform>=1.128.0
|
|
20
|
+
Requires-Dist: httpx[socks]>=0.28.1
|
|
21
|
+
Requires-Dist: openai-agents[litellm]>=0.6.1
|
|
22
|
+
Requires-Dist: openai>=2.8.1
|
|
23
|
+
Requires-Dist: orjson>=3.11.4
|
|
24
|
+
Requires-Dist: prompt-toolkit>=3.0.52
|
|
25
|
+
Requires-Dist: pydantic>=2.12.4
|
|
26
|
+
Requires-Dist: pyjwt>=2.10.1
|
|
27
|
+
Requires-Dist: pynacl>=1.6.1
|
|
28
|
+
Requires-Dist: python-multipart>=0.0.20
|
|
29
|
+
Requires-Dist: pyyaml>=6.0
|
|
30
|
+
Requires-Dist: requests>=2.32.5
|
|
31
|
+
Requires-Dist: rich>=14.2.0
|
|
32
|
+
Requires-Dist: tiktoken>=0.12.0
|
|
33
|
+
Requires-Dist: websockets>=15.0.1
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
# Koder
|
|
37
|
+
|
|
38
|
+
[](https://www.python.org/downloads/) [](LICENSE) [](https://github.com/psf/black) [](https://github.com/astral-sh/ruff) [](https://pepy.tech/projects/koder)
|
|
39
|
+
|
|
40
|
+
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.
|
|
41
|
+
|
|
42
|
+
**🎯 Project Status**: Under active vibe coding! This is a learning-focused project where we explore building AI coding agents.
|
|
43
|
+
|
|
44
|
+
## ✨ Features
|
|
45
|
+
|
|
46
|
+
- **🤖 Universal AI Support**: Works with OpenAI, Anthropic, Google, GitHub Copilot, and 100+ providers via LiteLLM with intelligent auto-detection
|
|
47
|
+
- **💾 Smart Context Management**: Persistent sessions with SQLite storage and automatic token-aware compression (50k token limit)
|
|
48
|
+
- **🔄 Real-time Streaming**: Rich Live displays with intelligent terminal cleanup for responsive user experience
|
|
49
|
+
- **🛠️ Comprehensive Toolset**: file operations, search, shell, task delegation and todos.
|
|
50
|
+
- **🔌 MCP Integration**: Model Context Protocol support with stdio, SSE, and HTTP transports for extensible tool ecosystem
|
|
51
|
+
- **🛡️ Enterprise Security**: SecurityGuard validation, output filtering, permission system, and input sanitization
|
|
52
|
+
- **🎯 Zero Configuration**: Automatic provider detection with fallback defaults
|
|
53
|
+
|
|
54
|
+
## 🛠️ Installation
|
|
55
|
+
|
|
56
|
+
### Using uv (Recommended)
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
uv tool install koder
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Using pip
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install koder
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## ⚡ Quick Start
|
|
69
|
+
|
|
70
|
+
Simply run Koder with your question or request:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Configure one provider (example: OpenAI)
|
|
74
|
+
export OPENAI_API_KEY="your-openai-api-key"
|
|
75
|
+
export KODER_MODEL="gpt-4o"
|
|
76
|
+
|
|
77
|
+
# Run in interactive mode
|
|
78
|
+
koder
|
|
79
|
+
|
|
80
|
+
# Run with prompt
|
|
81
|
+
koder "create a Python function to calculate fibonacci numbers"
|
|
82
|
+
|
|
83
|
+
# Execute a single prompt in a named session
|
|
84
|
+
koder -s my-project "Help me implement a new feature"
|
|
85
|
+
|
|
86
|
+
# Use an explicit session flag
|
|
87
|
+
koder -s my-project "Your prompt here"
|
|
88
|
+
|
|
89
|
+
# Use high reasoning effort for complex problems (OpenAI reasoning models)
|
|
90
|
+
koder --reasoning high "Solve this complex algorithm problem"
|
|
91
|
+
|
|
92
|
+
# Use low reasoning for simple tasks
|
|
93
|
+
koder --reasoning low "Add a print statement"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## 🤖 Configuration
|
|
97
|
+
|
|
98
|
+
Koder supports flexible configuration through three mechanisms (in order of priority):
|
|
99
|
+
|
|
100
|
+
1. **CLI Arguments** - Highest priority, for runtime overrides
|
|
101
|
+
2. **Environment Variables** - For secrets and runtime configuration
|
|
102
|
+
3. **Config File** - For persistent defaults (`~/.koder/config.yaml`)
|
|
103
|
+
|
|
104
|
+
### Quick Setup
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Minimal setup - just set your API key and go
|
|
108
|
+
export OPENAI_API_KEY="your-api-key"
|
|
109
|
+
koder
|
|
110
|
+
|
|
111
|
+
# Or use a different provider
|
|
112
|
+
export ANTHROPIC_API_KEY="your-api-key"
|
|
113
|
+
export KODER_MODEL="claude-opus-4-20250514"
|
|
114
|
+
koder
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Config File
|
|
118
|
+
|
|
119
|
+
Koder uses a YAML config file at `~/.koder/config.yaml` for persistent settings.
|
|
120
|
+
|
|
121
|
+
#### Config CLI Commands
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Initialize config file with defaults
|
|
125
|
+
koder config init
|
|
126
|
+
|
|
127
|
+
# Show current configuration
|
|
128
|
+
koder config show
|
|
129
|
+
|
|
130
|
+
# Show config file path
|
|
131
|
+
koder config path
|
|
132
|
+
|
|
133
|
+
# Open config file in editor (respects $EDITOR)
|
|
134
|
+
koder config edit
|
|
135
|
+
|
|
136
|
+
# Set specific values (supports dot notation)
|
|
137
|
+
koder config set model.name gpt-4o
|
|
138
|
+
koder config set model.provider anthropic
|
|
139
|
+
koder config set cli.stream false
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
#### Config File Format
|
|
143
|
+
|
|
144
|
+
```yaml
|
|
145
|
+
# ~/.koder/config.yaml
|
|
146
|
+
|
|
147
|
+
# Model configuration
|
|
148
|
+
model:
|
|
149
|
+
name: "gpt-4.1" # Model name (default: gpt-4.1)
|
|
150
|
+
provider: "openai" # Provider name (default: openai)
|
|
151
|
+
api_key: null # API key (prefer env vars for security)
|
|
152
|
+
base_url: null # Custom API endpoint (optional)
|
|
153
|
+
|
|
154
|
+
# Azure-specific settings
|
|
155
|
+
azure_api_version: null # e.g., "2025-04-01-preview"
|
|
156
|
+
|
|
157
|
+
# Vertex AI-specific settings
|
|
158
|
+
vertex_ai_location: null # e.g., "us-central1"
|
|
159
|
+
vertex_ai_credentials_path: null # Path to service account JSON
|
|
160
|
+
|
|
161
|
+
# Reasoning effort for OpenAI reasoning models (o1, o3, gpt-5.1, etc.)
|
|
162
|
+
reasoning_effort: "medium" # none, minimal, low, medium, high, or null
|
|
163
|
+
|
|
164
|
+
# CLI defaults
|
|
165
|
+
cli:
|
|
166
|
+
session: null # Default session name (auto-generated if null)
|
|
167
|
+
stream: true # Enable streaming output (default: true)
|
|
168
|
+
|
|
169
|
+
# MCP servers for extended functionality
|
|
170
|
+
mcp_servers: []
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Environment Variables
|
|
174
|
+
|
|
175
|
+
#### Core Variables
|
|
176
|
+
|
|
177
|
+
| Variable | Purpose | Example |
|
|
178
|
+
|----------|---------|---------|
|
|
179
|
+
| `KODER_MODEL` | Model selection (highest priority) | `gpt-4o`, `claude-opus-4-20250514` |
|
|
180
|
+
| `KODER_REASONING_EFFORT` | Reasoning effort for reasoning models | `medium`, `high`, `low`, `null` |
|
|
181
|
+
| `EDITOR` | Editor for `koder config edit` | `vim`, `code` |
|
|
182
|
+
|
|
183
|
+
#### Provider API Keys
|
|
184
|
+
|
|
185
|
+
| Provider | API Key Variable | Additional Variables |
|
|
186
|
+
|----------|------------------|---------------------|
|
|
187
|
+
| OpenAI | `OPENAI_API_KEY` | `OPENAI_BASE_URL` |
|
|
188
|
+
| Anthropic | `ANTHROPIC_API_KEY` | - |
|
|
189
|
+
| Google/Gemini | `GOOGLE_API_KEY` or `GEMINI_API_KEY` | - |
|
|
190
|
+
| Azure | `AZURE_API_KEY` | `AZURE_API_BASE`, `AZURE_API_VERSION` |
|
|
191
|
+
| Vertex AI | `GOOGLE_APPLICATION_CREDENTIALS` | `VERTEXAI_LOCATION` |
|
|
192
|
+
| GitHub Copilot | `GITHUB_TOKEN` | - |
|
|
193
|
+
| Groq | `GROQ_API_KEY` | - |
|
|
194
|
+
| Together AI | `TOGETHERAI_API_KEY` | - |
|
|
195
|
+
| OpenRouter | `OPENROUTER_API_KEY` | - |
|
|
196
|
+
| Mistral | `MISTRAL_API_KEY` | - |
|
|
197
|
+
| Cohere | `COHERE_API_KEY` | - |
|
|
198
|
+
| Bedrock | `AWS_ACCESS_KEY_ID` | `AWS_SECRET_ACCESS_KEY` |
|
|
199
|
+
|
|
200
|
+
### Supported Providers
|
|
201
|
+
|
|
202
|
+
<details>
|
|
203
|
+
<summary><b>OpenAI</b></summary>
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
export OPENAI_API_KEY=your-api-key
|
|
207
|
+
export KODER_MODEL="gpt-4o" # Optional, default: gpt-4.1
|
|
208
|
+
|
|
209
|
+
# Optional: Custom endpoint
|
|
210
|
+
export OPENAI_BASE_URL=https://your-endpoint.com/v1
|
|
211
|
+
|
|
212
|
+
koder
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
</details>
|
|
216
|
+
|
|
217
|
+
<details>
|
|
218
|
+
<summary><b>Anthropic</b></summary>
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
export ANTHROPIC_API_KEY=your-api-key
|
|
222
|
+
export KODER_MODEL="claude-opus-4-20250514"
|
|
223
|
+
koder
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
</details>
|
|
227
|
+
|
|
228
|
+
<details>
|
|
229
|
+
<summary><b>Google Gemini</b></summary>
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
export GOOGLE_API_KEY=your-api-key
|
|
233
|
+
export KODER_MODEL="gemini/gemini-2.5-pro"
|
|
234
|
+
koder
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
</details>
|
|
238
|
+
|
|
239
|
+
<details>
|
|
240
|
+
<summary><b>GitHub Copilot</b></summary>
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
export KODER_MODEL="github_copilot/claude-sonnet-4"
|
|
244
|
+
koder
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
On first run you will see a device code in the terminal. Visit <https://github.com/login/device> and enter the code to authenticate.
|
|
248
|
+
|
|
249
|
+
</details>
|
|
250
|
+
|
|
251
|
+
<details>
|
|
252
|
+
<summary><b>Azure OpenAI</b></summary>
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
export AZURE_API_KEY="your-azure-api-key"
|
|
256
|
+
export AZURE_API_BASE="https://your-resource.openai.azure.com"
|
|
257
|
+
export AZURE_API_VERSION="2025-04-01-preview"
|
|
258
|
+
export KODER_MODEL="azure/gpt-4"
|
|
259
|
+
koder
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Or configure in `~/.koder/config.yaml`:
|
|
263
|
+
|
|
264
|
+
```yaml
|
|
265
|
+
model:
|
|
266
|
+
name: "gpt-4"
|
|
267
|
+
provider: "azure"
|
|
268
|
+
azure_api_version: "2025-04-01-preview"
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
</details>
|
|
272
|
+
|
|
273
|
+
<details>
|
|
274
|
+
<summary><b>Google Vertex AI</b></summary>
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
export GOOGLE_APPLICATION_CREDENTIALS="path/to/service-account.json"
|
|
278
|
+
export VERTEXAI_LOCATION="us-central1"
|
|
279
|
+
export KODER_MODEL="vertex_ai/claude-sonnet-4@20250514"
|
|
280
|
+
koder
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Or configure in `~/.koder/config.yaml`:
|
|
284
|
+
|
|
285
|
+
```yaml
|
|
286
|
+
model:
|
|
287
|
+
name: "claude-sonnet-4@20250514"
|
|
288
|
+
provider: "vertex_ai"
|
|
289
|
+
vertex_ai_location: "us-central1"
|
|
290
|
+
vertex_ai_credentials_path: "path/to/service-account.json"
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
</details>
|
|
294
|
+
|
|
295
|
+
<details>
|
|
296
|
+
<summary><b>Other Providers (100+ via LiteLLM)</b></summary>
|
|
297
|
+
|
|
298
|
+
[LiteLLM](https://docs.litellm.ai/docs/providers) supports 100+ providers. Use the format `provider/model`:
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
# Groq
|
|
302
|
+
export GROQ_API_KEY=your-key
|
|
303
|
+
export KODER_MODEL="groq/llama-3.3-70b-versatile"
|
|
304
|
+
|
|
305
|
+
# Together AI
|
|
306
|
+
export TOGETHERAI_API_KEY=your-key
|
|
307
|
+
export KODER_MODEL="together_ai/meta-llama/Llama-3-70b-chat-hf"
|
|
308
|
+
|
|
309
|
+
# OpenRouter
|
|
310
|
+
export OPENROUTER_API_KEY=your-key
|
|
311
|
+
export KODER_MODEL="openrouter/anthropic/claude-3-opus"
|
|
312
|
+
|
|
313
|
+
# Custom OpenAI-compatible endpoints
|
|
314
|
+
export OPENAI_API_KEY="your-key"
|
|
315
|
+
export OPENAI_BASE_URL="https://your-custom-endpoint.com/v1"
|
|
316
|
+
export KODER_MODEL="openai/your-model-name"
|
|
317
|
+
|
|
318
|
+
koder
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
</details>
|
|
322
|
+
|
|
323
|
+
### MCP Server Configuration
|
|
324
|
+
|
|
325
|
+
Model Context Protocol (MCP) servers extend Koder's capabilities with additional tools.
|
|
326
|
+
|
|
327
|
+
#### MCP CLI Commands
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
# Add an MCP server (stdio transport)
|
|
331
|
+
koder mcp add myserver "python -m my_mcp_server" --transport stdio
|
|
332
|
+
|
|
333
|
+
# Add with environment variables
|
|
334
|
+
koder mcp add myserver "python -m server" -e API_KEY=xxx -e DEBUG=true
|
|
335
|
+
|
|
336
|
+
# Add HTTP/SSE server
|
|
337
|
+
koder mcp add webserver --transport http --url http://localhost:8000
|
|
338
|
+
|
|
339
|
+
# List all MCP servers
|
|
340
|
+
koder mcp list
|
|
341
|
+
|
|
342
|
+
# Get server details
|
|
343
|
+
koder mcp get myserver
|
|
344
|
+
|
|
345
|
+
# Remove a server
|
|
346
|
+
koder mcp remove myserver
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
#### MCP Config Format
|
|
350
|
+
|
|
351
|
+
```yaml
|
|
352
|
+
# In ~/.koder/config.yaml
|
|
353
|
+
|
|
354
|
+
mcp_servers:
|
|
355
|
+
# stdio transport (runs a local command)
|
|
356
|
+
- name: "filesystem"
|
|
357
|
+
transport_type: "stdio"
|
|
358
|
+
command: "python"
|
|
359
|
+
args: ["-m", "mcp.server.filesystem"]
|
|
360
|
+
env_vars:
|
|
361
|
+
ROOT_PATH: "/home/user/projects"
|
|
362
|
+
cache_tools_list: true
|
|
363
|
+
allowed_tools: # Optional: whitelist specific tools
|
|
364
|
+
- "read_file"
|
|
365
|
+
- "write_file"
|
|
366
|
+
|
|
367
|
+
# HTTP transport (connects to remote server)
|
|
368
|
+
- name: "web-tools"
|
|
369
|
+
transport_type: "http"
|
|
370
|
+
url: "http://localhost:8000"
|
|
371
|
+
headers:
|
|
372
|
+
Authorization: "Bearer token123"
|
|
373
|
+
|
|
374
|
+
# SSE transport (server-sent events)
|
|
375
|
+
- name: "streaming-server"
|
|
376
|
+
transport_type: "sse"
|
|
377
|
+
url: "http://localhost:9000/sse"
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
### Example Configurations
|
|
381
|
+
|
|
382
|
+
<details>
|
|
383
|
+
<summary><b>Minimal (OpenAI)</b></summary>
|
|
384
|
+
|
|
385
|
+
```yaml
|
|
386
|
+
# ~/.koder/config.yaml
|
|
387
|
+
model:
|
|
388
|
+
name: "gpt-4o"
|
|
389
|
+
provider: "openai"
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
```bash
|
|
393
|
+
export OPENAI_API_KEY="sk-..."
|
|
394
|
+
koder
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
</details>
|
|
398
|
+
|
|
399
|
+
<details>
|
|
400
|
+
<summary><b>Enterprise Azure Setup</b></summary>
|
|
401
|
+
|
|
402
|
+
```yaml
|
|
403
|
+
# ~/.koder/config.yaml
|
|
404
|
+
model:
|
|
405
|
+
name: "gpt-4"
|
|
406
|
+
provider: "azure"
|
|
407
|
+
azure_api_version: "2025-04-01-preview"
|
|
408
|
+
|
|
409
|
+
cli:
|
|
410
|
+
session: "enterprise-project"
|
|
411
|
+
stream: true
|
|
412
|
+
|
|
413
|
+
mcp_servers:
|
|
414
|
+
- name: "company-tools"
|
|
415
|
+
transport_type: "http"
|
|
416
|
+
url: "https://internal-mcp.company.com"
|
|
417
|
+
headers:
|
|
418
|
+
X-API-Key: "${COMPANY_API_KEY}"
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
```bash
|
|
422
|
+
export AZURE_API_KEY="..."
|
|
423
|
+
export AZURE_API_BASE="https://your-resource.openai.azure.com"
|
|
424
|
+
koder
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
</details>
|
|
428
|
+
|
|
429
|
+
<details>
|
|
430
|
+
<summary><b>Multi-Provider Development</b></summary>
|
|
431
|
+
|
|
432
|
+
```yaml
|
|
433
|
+
# ~/.koder/config.yaml - set a default
|
|
434
|
+
model:
|
|
435
|
+
name: "gpt-4o"
|
|
436
|
+
provider: "openai"
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
```bash
|
|
440
|
+
# Override at runtime with KODER_MODEL
|
|
441
|
+
export OPENAI_API_KEY="..."
|
|
442
|
+
export ANTHROPIC_API_KEY="..."
|
|
443
|
+
|
|
444
|
+
# Use default (OpenAI)
|
|
445
|
+
koder
|
|
446
|
+
|
|
447
|
+
# Switch to Claude for specific tasks
|
|
448
|
+
KODER_MODEL="claude-opus-4-20250514" koder "complex reasoning task"
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
</details>
|
|
452
|
+
|
|
453
|
+
### Configuration Priority
|
|
454
|
+
|
|
455
|
+
When the same setting is defined in multiple places, the priority is:
|
|
456
|
+
|
|
457
|
+
```
|
|
458
|
+
CLI Arguments > Environment Variables > Config File > Defaults
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
**Example:**
|
|
462
|
+
|
|
463
|
+
```yaml
|
|
464
|
+
# ~/.koder/config.yaml
|
|
465
|
+
model:
|
|
466
|
+
name: "gpt-4o"
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
```bash
|
|
470
|
+
# Environment variable overrides config file
|
|
471
|
+
export KODER_MODEL="claude-opus-4-20250514"
|
|
472
|
+
koder # Uses claude-opus-4-20250514
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
## 🛠️ Development
|
|
476
|
+
|
|
477
|
+
### Setup Development Environment
|
|
478
|
+
|
|
479
|
+
```bash
|
|
480
|
+
# Clone the repository
|
|
481
|
+
git clone https://github.com/feiskyer/koder.git
|
|
482
|
+
cd koder
|
|
483
|
+
|
|
484
|
+
uv sync
|
|
485
|
+
uv run koder
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
### Code Quality
|
|
489
|
+
|
|
490
|
+
```bash
|
|
491
|
+
# Code formatting
|
|
492
|
+
black .
|
|
493
|
+
|
|
494
|
+
# Linting
|
|
495
|
+
ruff check --fix
|
|
496
|
+
|
|
497
|
+
# pylint
|
|
498
|
+
pylint koder_agent/ --disable=C,R,W --errors-only
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
## 🔒 Security
|
|
502
|
+
|
|
503
|
+
- **API Keys**: All API keys are stored in environment variables and never in code.
|
|
504
|
+
- **Local Storage**: Sessions are stored locally in your home directory.
|
|
505
|
+
- **No Telemetry**: Koder doesn't send any data besides API requests to your chosen provider.
|
|
506
|
+
- **Code Execution**: Shell commands require explicit user confirmation.
|
|
507
|
+
|
|
508
|
+
## 🤝 Contributing
|
|
509
|
+
|
|
510
|
+
Contributions are welcome! Here's how you can help:
|
|
511
|
+
|
|
512
|
+
1. **Fork** the repository
|
|
513
|
+
2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)
|
|
514
|
+
3. **Commit** your changes (`git commit -m 'Add amazing feature'`)
|
|
515
|
+
4. **Push** to the branch (`git push origin feature/amazing-feature`)
|
|
516
|
+
5. **Open** a Pull Request
|
|
517
|
+
|
|
518
|
+
Please read our [Contributing Guidelines](CONTRIBUTING.md) for more details.
|
|
519
|
+
|
|
520
|
+
## 🌐 Code of Conduct
|
|
521
|
+
|
|
522
|
+
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.
|
|
523
|
+
|
|
524
|
+
## 📄 License
|
|
525
|
+
|
|
526
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
527
|
+
|
|
528
|
+
Use of third-party AI services is governed by their respective provider terms.
|