devduck 0.1.1766644714__py3-none-any.whl → 0.3.0__py3-none-any.whl

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.

Potentially problematic release.


This version of devduck might be problematic. Click here for more details.

@@ -1,717 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: devduck
3
- Version: 0.1.1766644714
4
- Summary: 🦆 Extreme minimalist self-adapting AI agent - one file, self-healing, runtime dependencies
5
- Author-email: Cagatay Cali <cagataycali@icloud.com>
6
- License: Apache-2.0
7
- Project-URL: Homepage, https://github.com/cagataycali/devduck
8
- Project-URL: Repository, https://github.com/cagataycali/devduck.git
9
- Project-URL: Documentation, https://github.com/cagataycali/devduck#readme
10
- Project-URL: Bug Tracker, https://github.com/cagataycali/devduck/issues
11
- Keywords: ai,agent,minimalist,self-healing,ollama,strands-agents
12
- Classifier: Development Status :: 4 - Beta
13
- Classifier: Environment :: Console
14
- Classifier: Intended Audience :: Developers
15
- Classifier: Intended Audience :: System Administrators
16
- Classifier: Operating System :: OS Independent
17
- Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.10
19
- Classifier: Programming Language :: Python :: 3.11
20
- Classifier: Programming Language :: Python :: 3.12
21
- Classifier: Programming Language :: Python :: 3.13
22
- Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
- Classifier: Topic :: System :: Systems Administration
25
- Classifier: Topic :: Utilities
26
- Requires-Python: <3.14,>=3.10
27
- Description-Content-Type: text/markdown
28
- License-File: LICENSE
29
- Requires-Dist: strands-agents
30
- Requires-Dist: prompt_toolkit
31
- Requires-Dist: strands-agents[ollama]
32
- Requires-Dist: strands-agents[anthropic]
33
- Requires-Dist: strands-agents[openai]
34
- Requires-Dist: strands-agents[bidi-all]; sys_platform == "darwin"
35
- Requires-Dist: strands-agents[otel]
36
- Requires-Dist: strands-agents-tools
37
- Requires-Dist: strands-fun-tools[all]; sys_platform == "darwin"
38
- Requires-Dist: strands-fun-tools[audio]; sys_platform == "darwin"
39
- Requires-Dist: beautifulsoup4
40
- Requires-Dist: colorama
41
- Requires-Dist: websockets
42
- Requires-Dist: strands-mcp-server
43
- Requires-Dist: strands-google
44
- Requires-Dist: bedrock-agentcore-starter-toolkit
45
- Requires-Dist: bedrock-agentcore
46
- Requires-Dist: rumps; sys_platform == "darwin"
47
- Requires-Dist: strands-mlx; sys_platform == "darwin"
48
- Dynamic: license-file
49
-
50
- # 🦆 DevDuck
51
-
52
- [![PyPI](https://badge.fury.io/py/devduck.svg)](https://pypi.org/project/devduck/)
53
-
54
- **Self-modifying AI agent that hot-reloads its own code—builds itself as it runs.**
55
-
56
- One Python file that adapts to your environment, fixes itself, and expands capabilities at runtime.
57
-
58
- Learn more: https://duck.nyc
59
-
60
- ## 🎬 See It In Action
61
-
62
- | Feature | What You'll See | Demo |
63
- |---------|----------------|-------|
64
- | 🔥 **Hot-Reload** | Agent detects code changes and restarts instantly | [Watch](https://redduck.dev/videos/hot-reload.mp4) |
65
- | 🌐 **Web UI** | Clean web interface with real-time streaming | [Watch](https://redduck.dev/videos/web-ui.mp4) |
66
- | 🛠️ **Dynamic Tools** | Save `.py` file in `./tools/` → use instantly | [Watch](https://redduck.dev/videos/dynamic-tool-creation.mp4) |
67
- | 🌊 **TCP Streaming** | Connect via netcat, apps, or other agents | [Watch](https://redduck.dev/videos/tcp.mp4) |
68
- | 🔌 **IPC & Tray** | macOS menu bar + Unix socket IPC | ![Demo](docs/mac-os-tray.jpg) |
69
- | 💬 **Ambient Overlay** | Floating AI input with glassmorphism UI | [Watch](https://redduck.dev/videos/floating-input.mp4) |
70
-
71
- ---
72
-
73
- ## Quick Start
74
-
75
- ```bash
76
- # Install & run
77
- pipx install devduck && devduck
78
-
79
- # One-shot query
80
- devduck "create a REST API with FastAPI"
81
-
82
- # Python API
83
- python -c "import devduck; devduck('analyze this code')"
84
- ```
85
-
86
- **Requirements:** Python 3.10-3.13, AWS credentials (or Ollama/Anthropic/GitHub/MLX)
87
-
88
- ---
89
-
90
- ## Core Capabilities
91
-
92
- | Feature | What It Does | How to Use |
93
- |---------|--------------|------------|
94
- | 🔥 **Hot-Reload** | Auto-restarts on code changes | Edit `__init__.py` → saves → auto-restart |
95
- | 🛠️ **Runtime Tools** | Add/remove tools without restart | `manage_tools(action="add", ...)` |
96
- | 📦 **Dynamic Loading** | Install packages and load tools on-the-fly | `install_tools(action="install_and_load", package="...")` |
97
- | 🧠 **Auto-RAG** | Remembers conversations via Knowledge Base | Set `DEVDUCK_KNOWLEDGE_BASE_ID` |
98
- | 🌊 **Multi-Protocol** | TCP, WebSocket, MCP, IPC servers | Auto-starts on ports 9999, 8080, 8000 |
99
- | 🔌 **MCP Client** | Connect to external MCP servers | Set `MCP_SERVERS` env var |
100
- | 💾 **State Time-Travel** | Save/restore agent state | `state_manager(action="export")` |
101
- | 📝 **Self-Improvement** | Updates own system prompt | `system_prompt(action="add_context", ...)` |
102
- | ☁️ **AWS Deploy** | One-command serverless | `agentcore_config(auto_launch=True)` |
103
-
104
- ---
105
-
106
- ## Developer Setup
107
-
108
- ```bash
109
- git clone git@github.com:cagataycali/devduck.git
110
- cd devduck
111
- python3.13 -m venv .venv
112
- source .venv/bin/activate
113
- .venv/bin/pip3.13 install -e .
114
- devduck
115
- ```
116
-
117
- ---
118
-
119
- ## Architecture
120
-
121
- ```mermaid
122
- graph TB
123
- A[User Input] -->|CLI/TCP/WS/MCP/IPC| B[DevDuck Core]
124
- B -->|Auto RAG| C[Knowledge Base]
125
- C -.->|Context Retrieval| B
126
- B -->|Tool Calls| D[38+ Built-in Tools]
127
- D --> E[shell/editor/calculator]
128
- D --> F[GitHub/AgentCore]
129
- D --> G[TCP/WebSocket/MCP/IPC]
130
- D --> H[tray/ambient/cursor/clipboard]
131
- B -->|Hot-reload| I[./tools/*.py + __init__.py]
132
- I -.->|Load Instantly| D
133
- B -->|Runtime| K[manage_tools/install_tools]
134
- K -.->|Expand| D
135
- B -->|Response| J[User Output]
136
- J -.->|Store Memory| C
137
-
138
- style B fill:#e1f5ff
139
- style C fill:#d4edda
140
- style I fill:#fff3cd
141
- style K fill:#ffe6cc
142
- ```
143
-
144
- **Self-adapting loop:** Query → RAG → Tools → Response → Memory → Hot-reload/Runtime-load → Repeat
145
-
146
- ---
147
-
148
- ## Model Setup
149
-
150
- DevDuck **auto-detects** providers based on credentials:
151
-
152
- **Priority:** Bedrock → Anthropic → OpenAI → GitHub → Gemini → Cohere → Writer → Mistral → LiteLLM → LlamaAPI → MLX → Ollama
153
-
154
- | Provider | API Key | Auto-Detected |
155
- |----------|---------|---------------|
156
- | **Bedrock** | AWS credentials | ✅ If `boto3` auth succeeds |
157
- | **Anthropic** | `ANTHROPIC_API_KEY` | ✅ If key present |
158
- | **OpenAI** | `OPENAI_API_KEY` | ✅ If key present |
159
- | **GitHub** | `GITHUB_TOKEN` or `PAT_TOKEN` | ✅ If key present |
160
- | **Gemini** | `GOOGLE_API_KEY` or `GEMINI_API_KEY` | ✅ If key present |
161
- | **Cohere** | `COHERE_API_KEY` | ✅ If key present |
162
- | **Writer** | `WRITER_API_KEY` | ✅ If key present |
163
- | **Mistral** | `MISTRAL_API_KEY` | ✅ If key present |
164
- | **LiteLLM** | `LITELLM_API_KEY` | ✅ If key present |
165
- | **LlamaAPI** | `LLAMAAPI_API_KEY` | ✅ If key present |
166
- | **MLX** | No key needed | ✅ On Apple Silicon (M1/M2/M3) |
167
- | **Ollama** | No key needed | ✅ Fallback if nothing else found |
168
-
169
- **Just set your API key - DevDuck handles the rest:**
170
- ```bash
171
- export ANTHROPIC_API_KEY=sk-ant-...
172
- devduck # Auto-uses Anthropic
173
-
174
- export OPENAI_API_KEY=sk-...
175
- devduck # Auto-uses OpenAI
176
-
177
- export GOOGLE_API_KEY=...
178
- devduck # Auto-uses Gemini
179
- ```
180
-
181
- **Manual override:**
182
- ```bash
183
- export MODEL_PROVIDER=bedrock
184
- export STRANDS_MODEL_ID=us.anthropic.claude-sonnet-4-20250514-v1:0
185
- devduck
186
- ```
187
-
188
- ---
189
-
190
- ## Tool Management
191
-
192
- ### Runtime Tool Management
193
-
194
- Add, remove, or reload tools while agent is running:
195
-
196
- ```python
197
- # List all loaded tools
198
- manage_tools(action="list")
199
-
200
- # Add tools from a package at runtime
201
- manage_tools(action="add", package="strands_fun_tools", tool_names="cursor,clipboard,bluetooth")
202
-
203
- # Remove tools you don't need
204
- manage_tools(action="remove", tool_names="cursor,clipboard")
205
-
206
- # Reload specific tools after editing
207
- manage_tools(action="reload", tool_names="shell,editor")
208
-
209
- # Reload all tools (restarts agent)
210
- manage_tools(action="reload")
211
-
212
- # Load custom tool from file
213
- manage_tools(action="add", tool_path="./my_custom_tool.py")
214
- ```
215
-
216
- ### Dynamic Package Installation
217
-
218
- Install Python packages and load their tools at runtime:
219
-
220
- ```python
221
- # Discover available tools before loading
222
- install_tools(action="list_available", package="strands-fun-tools", module="strands_fun_tools")
223
-
224
- # Install package and load all tools
225
- install_tools(action="install_and_load", package="strands-agents-tools", module="strands_tools")
226
-
227
- # Install and load specific tools only
228
- install_tools(
229
- action="install_and_load",
230
- package="strands-fun-tools",
231
- module="strands_fun_tools",
232
- tool_names=["clipboard", "cursor", "bluetooth"]
233
- )
234
-
235
- # Load tools from already installed package
236
- install_tools(action="load", module="strands_tools", tool_names=["shell", "calculator"])
237
-
238
- # List currently loaded tools
239
- install_tools(action="list_loaded")
240
- ```
241
-
242
- ### Static Tool Configuration
243
-
244
- **Format:** `package1:tool1,tool2;package2:tool3,tool4`
245
-
246
- ```bash
247
- # Minimal (shell + editor only)
248
- export DEVDUCK_TOOLS="strands_tools:shell,editor"
249
-
250
- # Dev essentials
251
- export DEVDUCK_TOOLS="strands_tools:shell,editor,file_read,file_write,calculator"
252
-
253
- # Full stack + GitHub
254
- export DEVDUCK_TOOLS="devduck.tools:tcp,websocket,mcp_server,use_github;strands_tools:shell,editor,file_read"
255
-
256
- devduck
257
- ```
258
-
259
- ### Hot-Reload Tools from Directory
260
-
261
- Create `./tools/weather.py`:
262
- ```python
263
- from strands import tool
264
- import requests
265
-
266
- @tool
267
- def weather(city: str) -> str:
268
- """Get weather for a city."""
269
- r = requests.get(f"https://wttr.in/{city}?format=%C+%t")
270
- return r.text
271
- ```
272
-
273
- **Enable directory auto-loading:**
274
- ```bash
275
- export DEVDUCK_LOAD_TOOLS_FROM_DIR=true
276
- devduck
277
- # Save weather.py → use instantly (no restart needed)
278
- ```
279
-
280
- **Default:** Directory loading is OFF. Use `manage_tools()` or `install_tools()` for explicit control.
281
-
282
- ---
283
-
284
- ## MCP Integration
285
-
286
- ### As MCP Server (Expose DevDuck)
287
-
288
- **Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
289
- ```json
290
- {
291
- "mcpServers": {
292
- "devduck": {
293
- "command": "uvx",
294
- "args": ["devduck", "--mcp"]
295
- }
296
- }
297
- }
298
- ```
299
-
300
- **Or start HTTP MCP server:**
301
- ```python
302
- mcp_server(action="start", port=8000, stateless=True)
303
- # Connect at: http://localhost:8000/mcp
304
- ```
305
-
306
- **Modes:** `--mcp` (stdio for Claude Desktop) | `http` (background server) | `stateless=True` (multi-node)
307
-
308
- ### As MCP Client (Load External Servers)
309
-
310
- **Expand capabilities** by loading tools from external MCP servers:
311
-
312
- ```bash
313
- export MCP_SERVERS='{
314
- "mcpServers": {
315
- "strands-docs": {"command": "uvx", "args": ["strands-agents-mcp-server"]},
316
- "remote": {"url": "https://api.example.com/mcp", "headers": {"Auth": "Bearer token"}},
317
- "custom": {"command": "python", "args": ["my_server.py"]}
318
- }
319
- }'
320
- devduck
321
- ```
322
-
323
- **Supported transports:** stdio (`command`/`args`/`env`) | HTTP (`url`/`headers`) | SSE (`url` with `/sse` path)
324
-
325
- **Tool prefixing:** Each server's tools get prefixed (e.g., `strands-docs_search_docs`)
326
-
327
- ---
328
-
329
- ## Advanced Features
330
-
331
- ### State Management (Time-Travel)
332
-
333
- Save and restore agent state for reproducibility:
334
-
335
- ```python
336
- # Export current state
337
- state_manager(action="export", metadata={"note": "before refactor"})
338
-
339
- # List saved states
340
- state_manager(action="list")
341
-
342
- # Load and display state
343
- state_manager(action="load", state_file="~/.devduck/states/devduck_20250118_150000.pkl")
344
-
345
- # Resume from state (ephemeral - doesn't mutate parent)
346
- state_manager(
347
- action="resume",
348
- state_file="~/.devduck/states/devduck_20250118_150000.pkl",
349
- query="continue the analysis from where we left off"
350
- )
351
-
352
- # Modify state metadata
353
- state_manager(
354
- action="modify",
355
- state_file="path/to/state.pkl",
356
- metadata={"tags": ["important", "refactor"]}
357
- )
358
-
359
- # Delete state
360
- state_manager(action="delete", state_file="path/to/state.pkl")
361
- ```
362
-
363
- States saved to: `~/.devduck/states/`
364
-
365
- ### System Prompt Management
366
-
367
- **Self-improvement** - agent updates its own system prompt:
368
-
369
- ```python
370
- # View current system prompt
371
- system_prompt(action="view")
372
-
373
- # Add new context (appends to prompt)
374
- system_prompt(action="add_context", context="New learning: Always use FastAPI for APIs")
375
-
376
- # Update entire prompt
377
- system_prompt(action="update", prompt="You are a specialized DevOps agent...")
378
-
379
- # Sync to GitHub (persist across deployments)
380
- system_prompt(
381
- action="update",
382
- prompt="Updated system prompt with new learnings...",
383
- repository="cagataycali/devduck"
384
- )
385
-
386
- # Reset to default
387
- system_prompt(action="reset")
388
- ```
389
-
390
- **Pattern:** Learn → Add context → Sync to GitHub → Persist forever
391
-
392
- ### Knowledge Base (Auto-RAG)
393
-
394
- **Automatic memory** across sessions:
395
-
396
- ```bash
397
- export DEVDUCK_KNOWLEDGE_BASE_ID=your_kb_id
398
- devduck
399
- ```
400
-
401
- **How it works:**
402
- 1. Before each query: Retrieves relevant context from KB
403
- 2. After each response: Stores conversation for future reference
404
- 3. No manual tool calls needed - fully automatic
405
-
406
- **Manual storage:**
407
- ```python
408
- store_in_kb(
409
- content="Important information to remember...",
410
- title="Project Context",
411
- knowledge_base_id="optional-kb-id"
412
- )
413
- ```
414
-
415
- ### Sub-Agent Creation
416
-
417
- **Delegate tasks** to specialized agents via GitHub Actions:
418
-
419
- ```python
420
- # Create sub-agent with specific model and tools
421
- create_subagent(
422
- repository="owner/repo",
423
- workflow_id="agent.yml",
424
- task="Analyze this dataset and provide insights",
425
- model="us.anthropic.claude-sonnet-4-20250514-v1:0",
426
- provider="bedrock",
427
- max_tokens=60000,
428
- tools="file_read,python_repl,calculator,http_request"
429
- )
430
-
431
- # Custom system prompt for specialized behavior
432
- create_subagent(
433
- repository="owner/repo",
434
- workflow_id="agent.yml",
435
- task="Review code and suggest improvements",
436
- tools="file_read,editor,shell",
437
- system_prompt="You are a senior code reviewer focused on best practices"
438
- )
439
-
440
- # Check sub-agent status
441
- create_subagent(action="status", repository="owner/repo", workflow_id="agent.yml", run_id="12345")
442
-
443
- # List recent runs
444
- create_subagent(action="list", repository="owner/repo", workflow_id="agent.yml")
445
- ```
446
-
447
- ---
448
-
449
- <details>
450
- <summary><strong>📋 All Built-in Tools (38 total)</strong></summary>
451
-
452
- ### DevDuck Core (17 tools)
453
- - `system_prompt` - Update agent's system prompt (GitHub sync support)
454
- - `store_in_kb` - Store content in Bedrock Knowledge Base
455
- - `state_manager` - Save/restore agent state (time-travel)
456
- - `tcp` - TCP server with real-time streaming
457
- - `websocket` - WebSocket server with concurrent messaging
458
- - `ipc` - Unix socket IPC server for local processes
459
- - `mcp_server` - Expose as MCP server (HTTP/stdio)
460
- - `install_tools` - Install packages and load tools at runtime
461
- - `create_subagent` - Spawn sub-agents via GitHub Actions
462
- - `use_github` - GitHub GraphQL API operations
463
- - `tray` - System tray app control (macOS)
464
- - `ambient` - Ambient AI input overlay (macOS)
465
- - `agentcore_config` - Configure & launch on Bedrock AgentCore
466
- - `agentcore_invoke` - Invoke deployed AgentCore agents
467
- - `agentcore_logs` - View CloudWatch logs from agents
468
- - `agentcore_agents` - List/manage agent runtimes
469
- - `manage_tools` - Runtime tool add/remove/reload
470
- - `view_logs` - View/search/clear DevDuck logs
471
-
472
- ### Strands Tools (13 tools)
473
- - `shell` - Interactive shell with PTY support
474
- - `editor` - File editing (view/create/replace/insert/undo)
475
- - `file_read` - Multi-file reading with search modes
476
- - `file_write` - Write content to files
477
- - `file_read` - Read files with document mode for PDFs/CSVs
478
- - `calculator` - SymPy-powered math (solve/derive/integrate)
479
- - `image_reader` - Read images for Converse API
480
- - `use_agent` - Nested agent with different model
481
- - `load_tool` - Load custom tools from Python files
482
- - `environment` - Environment variable management
483
- - `mcp_client` - Connect to external MCP servers autonomously
484
- - `retrieve` - Bedrock Knowledge Base retrieval
485
- - `speak` - Text-to-speech (macOS `say` or AWS Polly)
486
- - `slack` - Slack messaging and event handling
487
-
488
- ### Strands Fun Tools (6 tools - macOS)
489
- - `listen` - Background speech transcription (Whisper)
490
- - `cursor` - Mouse & keyboard control
491
- - `clipboard` - Clipboard monitoring & control
492
- - `screen_reader` - OCR & UI element detection
493
- - `bluetooth` - BLE scanning and GATT operations
494
- - `yolo_vision` - Object detection with YOLO
495
-
496
- ### Community Tools (./tools/)
497
- - `fetch_github_tool` - Fetch and load tools from GitHub repos
498
- - `gist` - Comprehensive GitHub Gist management (create/update/fork/star/comment)
499
- - `scraper` - HTML/XML parsing with BeautifulSoup4
500
- - `add_comment` - Add comments to GitHub issues/PRs
501
- - `list_issues` - List GitHub repository issues
502
- - `list_pull_requests` - List GitHub repository PRs
503
-
504
- **Plus:** Hot-reload tools from `./tools/` directory when `DEVDUCK_LOAD_TOOLS_FROM_DIR=true`
505
-
506
- </details>
507
-
508
- ---
509
-
510
- ## Hot-Reload Example
511
-
512
- ```python
513
- # ./tools/weather.py
514
- from strands import tool
515
- import requests
516
-
517
- @tool
518
- def weather(city: str) -> str:
519
- """Get weather for a city."""
520
- r = requests.get(f"https://wttr.in/{city}?format=%C+%t")
521
- return r.text
522
- ```
523
-
524
- **Save → use instantly:**
525
- ```bash
526
- 🦆 weather(city="Tokyo")
527
- # Clear sky +15°C
528
- ```
529
-
530
- No restart. No configuration. Just works.
531
-
532
- ---
533
-
534
- ## Access Methods
535
-
536
- | Protocol | Endpoint | Test Command | Use Case |
537
- |----------|----------|--------------|----------|
538
- | **CLI** | Terminal | `devduck "query"` | Interactive/one-shot |
539
- | **Python** | Import | `import devduck; devduck("query")` | Script integration |
540
- | **TCP** | `localhost:9999` | `nc localhost 9999` | Network clients |
541
- | **WebSocket** | `localhost:8080` | `wscat -c ws://localhost:8080` | Browser/async apps |
542
- | **MCP** | `localhost:8000/mcp` | Add to Claude Desktop | MCP clients |
543
- | **IPC** | `/tmp/devduck_main.sock` | `nc -U /tmp/devduck_main.sock` | Local processes |
544
-
545
- **Custom ports:**
546
- ```bash
547
- export DEVDUCK_TCP_PORT=9000 DEVDUCK_WS_PORT=8001 DEVDUCK_MCP_PORT=8002
548
- devduck
549
- ```
550
-
551
- **Disable servers:**
552
- ```bash
553
- export DEVDUCK_ENABLE_TCP=false DEVDUCK_ENABLE_MCP=false
554
- devduck
555
- ```
556
-
557
- ---
558
-
559
- ## Configuration
560
-
561
- | Variable | Default | Description |
562
- |----------|---------|-------------|
563
- | **Model** | | |
564
- | `MODEL_PROVIDER` | Auto | Manual override: `bedrock`, `anthropic`, `openai`, `github`, `gemini`, `cohere`, `writer`, `mistral`, `litellm`, `llamaapi`, `mlx`, `ollama` |
565
- | `STRANDS_MODEL_ID` | Auto | Model name (e.g., `claude-sonnet-4`, `gpt-4o`, `qwen3:1.7b`) |
566
- | **Provider API Keys** | | |
567
- | `ANTHROPIC_API_KEY` | - | Anthropic API key (auto-detected) |
568
- | `OPENAI_API_KEY` | - | OpenAI API key (auto-detected) |
569
- | `GOOGLE_API_KEY` / `GEMINI_API_KEY` | - | Google Gemini API key (auto-detected) |
570
- | `GITHUB_TOKEN` / `PAT_TOKEN` | - | GitHub token for GitHub Models (auto-detected) |
571
- | `COHERE_API_KEY` | - | Cohere API key (auto-detected) |
572
- | `WRITER_API_KEY` | - | Writer API key (auto-detected) |
573
- | `MISTRAL_API_KEY` | - | Mistral API key (auto-detected) |
574
- | `LITELLM_API_KEY` | - | LiteLLM API key (auto-detected) |
575
- | `LLAMAAPI_API_KEY` | - | LlamaAPI key (auto-detected) |
576
- | **Tools** | | |
577
- | `DEVDUCK_TOOLS` | 38 tools | Format: `package1:tool1,tool2;package2:tool3` |
578
- | `DEVDUCK_LOAD_TOOLS_FROM_DIR` | `false` | Auto-load from `./tools/` directory |
579
- | **Memory** | | |
580
- | `DEVDUCK_KNOWLEDGE_BASE_ID` | - | Bedrock KB ID for auto-RAG |
581
- | `SYSTEM_PROMPT` | - | Additional system prompt content |
582
- | **MCP** | | |
583
- | `MCP_SERVERS` | - | JSON config for external MCP servers |
584
- | **Servers** | | |
585
- | `DEVDUCK_TCP_PORT` | `9999` | TCP server port |
586
- | `DEVDUCK_WS_PORT` | `8080` | WebSocket server port |
587
- | `DEVDUCK_MCP_PORT` | `8000` | MCP server port |
588
- | `DEVDUCK_IPC_SOCKET` | `/tmp/devduck_main.sock` | IPC socket path |
589
- | `DEVDUCK_ENABLE_TCP` | `true` | Enable TCP server |
590
- | `DEVDUCK_ENABLE_WS` | `true` | Enable WebSocket server |
591
- | `DEVDUCK_ENABLE_MCP` | `true` | Enable MCP server |
592
- | `DEVDUCK_ENABLE_IPC` | `true` | Enable IPC server |
593
- | **Context** | | |
594
- | `DEVDUCK_LOG_LINE_COUNT` | `50` | Recent log lines in context |
595
- | `DEVDUCK_LAST_MESSAGE_COUNT` | `200` | Recent messages in context |
596
-
597
- ---
598
-
599
- ## Troubleshooting
600
-
601
- **Ollama model not found:**
602
- ```bash
603
- # DevDuck auto-pulls models, but if it fails:
604
- ollama pull qwen3:1.7b
605
- ```
606
-
607
- **Port already in use:**
608
- ```bash
609
- # Change ports
610
- export DEVDUCK_TCP_PORT=9000
611
- export DEVDUCK_WS_PORT=8001
612
- devduck
613
- ```
614
-
615
- **Hot-reload not working:**
616
- ```bash
617
- # Ensure tools directory exists
618
- mkdir -p ./tools
619
-
620
- # Check file watcher logs
621
- devduck
622
- 🦆 view_logs(action="search", pattern="watcher")
623
- ```
624
-
625
- **Memory/performance issues:**
626
- ```bash
627
- # Use lighter model
628
- export STRANDS_MODEL_ID="qwen3:0.5b"
629
-
630
- # Reduce context
631
- export DEVDUCK_LOG_LINE_COUNT=20
632
- export DEVDUCK_LAST_MESSAGE_COUNT=50
633
- ```
634
-
635
- **Ambient overlay not starting:**
636
- ```bash
637
- # Make sure tkinter is installed
638
- python3 -c "import tkinter"
639
-
640
- # Install tkinter if missing
641
- brew install python-tk@3.13 # macOS
642
- sudo apt-get install python3-tk # Ubuntu/Debian
643
- sudo dnf install python3-tkinter # Fedora
644
- ```
645
-
646
- **Tray app not starting (macOS):**
647
- ```bash
648
- # Install rumps
649
- pip install rumps
650
-
651
- # Or reinstall devduck
652
- pip install -e .
653
- ```
654
-
655
- **View logs:** `devduck` → `🦆 view_logs()`
656
-
657
- ---
658
-
659
- ## GitHub Actions
660
-
661
- **Run DevDuck in CI/CD pipelines:**
662
-
663
- ```yaml
664
- name: AI Code Assistant
665
- on:
666
- issues:
667
- types: [opened, edited]
668
- pull_request:
669
- types: [opened, edited, synchronize]
670
-
671
- jobs:
672
- devduck:
673
- runs-on: ubuntu-latest
674
- permissions:
675
- contents: read
676
- issues: write
677
- pull-requests: write
678
- steps:
679
- - uses: cagataycali/devduck@main
680
- with:
681
- task: "Analyze and help with this issue or PR"
682
- provider: "github"
683
- model: "gpt-4o"
684
- tools: "shell,file_read,file_write,use_github,calculator"
685
- env:
686
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
687
- ```
688
-
689
- **Sub-agent workflows:**
690
- ```python
691
- devduck("Create a sub-agent to analyze test coverage")
692
- ```
693
-
694
- ---
695
-
696
- ## Resources
697
-
698
- - **Strands SDK:** [github.com/strands-agents/sdk-python](https://github.com/strands-agents/sdk-python)
699
- - **Documentation:** [strandsagents.com](https://strandsagents.com)
700
- - **Web UI:** [cagataycali.github.io/devduck](http://cagataycali.github.io/devduck)
701
-
702
- ---
703
-
704
- ## Citation
705
-
706
- ```bibtex
707
- @software{devduck2025,
708
- author = {Cagatay Cali},
709
- title = {DevDuck: Self-Modifying AI Agent with Hot-Reload and Multi-Protocol Servers},
710
- year = {2025},
711
- url = {https://github.com/cagataycali/devduck}
712
- }
713
- ```
714
-
715
- ---
716
-
717
- **Apache 2.0** | Built with [Strands Agents](https://strandsagents.com) | [@cagataycali](https://github.com/cagataycali)