devduck 0.3.0__tar.gz → 0.4.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.
Potentially problematic release.
This version of devduck might be problematic. Click here for more details.
- devduck-0.4.1/PKG-INFO +283 -0
- devduck-0.4.1/README.md +238 -0
- {devduck-0.3.0 → devduck-0.4.1}/devduck/__init__.py +100 -197
- {devduck-0.3.0 → devduck-0.4.1}/devduck/_version.py +3 -3
- {devduck-0.3.0 → devduck-0.4.1}/devduck/tools/mcp_server.py +34 -6
- devduck-0.4.1/devduck.egg-info/PKG-INFO +283 -0
- {devduck-0.3.0 → devduck-0.4.1}/devduck.egg-info/SOURCES.txt +2 -3
- {devduck-0.3.0 → devduck-0.4.1}/pyproject.toml +1 -1
- devduck-0.3.0/PKG-INFO +0 -152
- devduck-0.3.0/README.md +0 -107
- devduck-0.3.0/devduck.egg-info/PKG-INFO +0 -152
- devduck-0.3.0/tools/store_in_kb.py +0 -187
- {devduck-0.3.0 → devduck-0.4.1}/.github/workflows/agent.yml +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/.gitignore +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/LICENSE +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/MANIFEST.in +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/action.yml +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/agent_runner.py +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/devduck/__main__.py +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/devduck/test_redduck.py +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/devduck/tools/__init__.py +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/devduck/tools/create_subagent.py +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/devduck/tools/install_tools.py +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/devduck/tools/store_in_kb.py +0 -0
- {devduck-0.3.0 → devduck-0.4.1/devduck}/tools/system_prompt.py +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/devduck/tools/tcp.py +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/devduck/tools/use_github.py +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/devduck/tools/websocket.py +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/devduck.egg-info/dependency_links.txt +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/devduck.egg-info/entry_points.txt +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/devduck.egg-info/requires.txt +1 -1
- {devduck-0.3.0 → devduck-0.4.1}/devduck.egg-info/top_level.txt +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/docs/index.html +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/install.sh +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/mcp.json +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/requirements.txt +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/setup-aws-oidc.sh +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/setup.cfg +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/test.py +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/tools/__init__.py +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/tools/fetch_github_tool.py +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/tools/gist.py +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/tools/github_tools.py +0 -0
- {devduck-0.3.0 → devduck-0.4.1}/tools/scraper.py +0 -0
devduck-0.4.1/PKG-INFO
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: devduck
|
|
3
|
+
Version: 0.4.1
|
|
4
|
+
Summary: 🦆 Extreme minimalist self-adapting AI agent - one file, self-healing, runtime dependencies
|
|
5
|
+
Author-email: duck <hey@devduck.dev>
|
|
6
|
+
License-Expression: MIT
|
|
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.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-tools
|
|
33
|
+
Requires-Dist: strands-agentcore-tools
|
|
34
|
+
Requires-Dist: beautifulsoup4
|
|
35
|
+
Requires-Dist: colorama
|
|
36
|
+
Requires-Dist: websockets
|
|
37
|
+
Requires-Dist: strands-mcp-server
|
|
38
|
+
Provides-Extra: all
|
|
39
|
+
Requires-Dist: strands-agents[openai]; extra == "all"
|
|
40
|
+
Requires-Dist: strands-agents[anthropic]; extra == "all"
|
|
41
|
+
Requires-Dist: strands-fun-tools[audio]; extra == "all"
|
|
42
|
+
Requires-Dist: strands-fun-tools[vision]; extra == "all"
|
|
43
|
+
Requires-Dist: strands-fun-tools[all]; extra == "all"
|
|
44
|
+
Dynamic: license-file
|
|
45
|
+
|
|
46
|
+
# 🦆 DevDuck
|
|
47
|
+
|
|
48
|
+
**Self-healing agent. One file. Zero config.**
|
|
49
|
+
|
|
50
|
+
Minimalist AI that adapts to your environment and fixes itself when things break.
|
|
51
|
+
|
|
52
|
+
## Install
|
|
53
|
+
|
|
54
|
+
**Homebrew (macOS/Linux):**
|
|
55
|
+
```bash
|
|
56
|
+
brew tap cagataycali/devduck
|
|
57
|
+
brew install devduck
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**pipx (all platforms):**
|
|
61
|
+
```bash
|
|
62
|
+
pipx install "devduck[all]" # Full install (recommended)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**uvx (instant run, no install):**
|
|
66
|
+
```bash
|
|
67
|
+
uvx devduck "hello world"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Requires: Python 3.10+, Ollama (or set `MODEL_PROVIDER`)
|
|
71
|
+
|
|
72
|
+
## Quick Start
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
devduck # Interactive mode (auto-starts servers)
|
|
76
|
+
devduck "analyze this code" # CLI mode
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
import devduck
|
|
81
|
+
devduck("calculate 2+2") # Python API
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Core Features
|
|
85
|
+
|
|
86
|
+
- **🔧 Self-healing** - Auto-fixes dependencies, models, errors
|
|
87
|
+
- **🔥 Hot-reload** - Save `.py` files in `./tools/`, use instantly (no restart)
|
|
88
|
+
- **🧠 RAG memory** - Set `STRANDS_KNOWLEDGE_BASE_ID` for automatic context retrieval/storage
|
|
89
|
+
- **🌍 Multi-protocol** - TCP (9999), WebSocket (8080), MCP (8000), CLI, Python
|
|
90
|
+
- **📚 19+ tools** - shell, editor, calculator, python, GitHub, subagents, and more
|
|
91
|
+
- **🎯 Adaptive** - Auto-selects model by OS (macOS: 1.7b, Linux: 30b)
|
|
92
|
+
|
|
93
|
+
## Auto-Started Servers
|
|
94
|
+
|
|
95
|
+
When you run `devduck`, 3 servers start automatically:
|
|
96
|
+
|
|
97
|
+
| Server | Endpoint | Usage |
|
|
98
|
+
|--------|----------|-------|
|
|
99
|
+
| 🌐 **Web UI** | [cagataycali.github.io/devduck](http://cagataycali.github.io/devduck) | Browser interface |
|
|
100
|
+
| 🔌 **TCP** | `localhost:9999` | `nc localhost 9999` |
|
|
101
|
+
| 🌊 **WebSocket** | `ws://localhost:8080` | Structured JSON messages |
|
|
102
|
+
| 🔗 **MCP** | `http://localhost:8000/mcp` | Model Context Protocol |
|
|
103
|
+
|
|
104
|
+
**Customize ports:**
|
|
105
|
+
```bash
|
|
106
|
+
devduck --tcp-port 9000 --ws-port 8001 --mcp-port 3000
|
|
107
|
+
devduck --no-tcp --no-ws # Disable specific servers
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Connect Options
|
|
111
|
+
|
|
112
|
+
### MCP Client (Claude Desktop)
|
|
113
|
+
|
|
114
|
+
**Simple stdio mode (recommended):**
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"mcpServers": {
|
|
118
|
+
"devduck": {
|
|
119
|
+
"command": "uvx",
|
|
120
|
+
"args": ["devduck", "--mcp"]
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Proxy mode (if devduck already running):**
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"mcpServers": {
|
|
130
|
+
"devduck": {
|
|
131
|
+
"command": "uvx",
|
|
132
|
+
"args": ["strands-mcp-server", "--upstream-url", "http://localhost:8000/mcp/"]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Terminal (TCP)
|
|
139
|
+
```bash
|
|
140
|
+
nc localhost 9999
|
|
141
|
+
> analyze logs
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Shell Prefix
|
|
145
|
+
```bash
|
|
146
|
+
devduck
|
|
147
|
+
🦆 ! git status # Run shell commands with !
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Hot-Reload Tool Creation
|
|
151
|
+
|
|
152
|
+
Create tools instantly—no restart needed:
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
# ./tools/tip_calc.py
|
|
156
|
+
from strands import tool
|
|
157
|
+
|
|
158
|
+
@tool
|
|
159
|
+
def calculate_tip(amount: float, percent: float = 15.0) -> str:
|
|
160
|
+
"""Calculate restaurant tip."""
|
|
161
|
+
tip = amount * (percent / 100)
|
|
162
|
+
return f"Tip: ${tip:.2f} | Total: ${amount + tip:.2f}"
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Save → Available instantly → Use: `devduck "calculate tip for $42"`
|
|
166
|
+
|
|
167
|
+
## Built-in Tools (19+)
|
|
168
|
+
|
|
169
|
+
| Category | Tools |
|
|
170
|
+
|----------|-------|
|
|
171
|
+
| **Development** | shell, editor, python_repl, load_tool, environment |
|
|
172
|
+
| **GitHub** | use_github, create_subagent, gist, add_comment, list_issues |
|
|
173
|
+
| **Network** | tcp, websocket, mcp_server, mcp_client, http_request |
|
|
174
|
+
| **AI** | use_agent, install_tools, retrieve, store_in_kb |
|
|
175
|
+
| **Utilities** | calculator, image_reader, scraper, system_prompt, view_logs |
|
|
176
|
+
|
|
177
|
+
## Multi-Model Support
|
|
178
|
+
|
|
179
|
+
Switch models via environment variables:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# Bedrock (Claude)
|
|
183
|
+
export MODEL_PROVIDER="bedrock"
|
|
184
|
+
export STRANDS_MODEL_ID="us.anthropic.claude-sonnet-4-5-20250929-v1:0"
|
|
185
|
+
export STRANDS_MAX_TOKENS="64000"
|
|
186
|
+
|
|
187
|
+
# Anthropic API
|
|
188
|
+
export MODEL_PROVIDER="anthropic"
|
|
189
|
+
export STRANDS_MODEL_ID="claude-sonnet-4-20250514"
|
|
190
|
+
|
|
191
|
+
# Ollama (default)
|
|
192
|
+
export MODEL_PROVIDER="ollama"
|
|
193
|
+
export OLLAMA_HOST="http://localhost:11434"
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Knowledge Base (RAG)
|
|
197
|
+
|
|
198
|
+
Enable automatic memory across sessions:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
export STRANDS_KNOWLEDGE_BASE_ID="your-kb-id"
|
|
202
|
+
devduck # Auto-retrieves context before queries, stores after responses
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Works with AWS Bedrock Knowledge Bases.
|
|
206
|
+
|
|
207
|
+
## Environment Variables
|
|
208
|
+
|
|
209
|
+
| Variable | Default | Description |
|
|
210
|
+
|----------|---------|-------------|
|
|
211
|
+
| `MODEL_PROVIDER` | `ollama` | Model provider (bedrock, anthropic, ollama) |
|
|
212
|
+
| `STRANDS_KNOWLEDGE_BASE_ID` | - | Enable auto-RAG with KB ID |
|
|
213
|
+
| `DEVDUCK_TCP_PORT` | `9999` | TCP server port |
|
|
214
|
+
| `DEVDUCK_WS_PORT` | `8080` | WebSocket port |
|
|
215
|
+
| `DEVDUCK_MCP_PORT` | `8000` | MCP server port |
|
|
216
|
+
| `DEVDUCK_ENABLE_TCP` | `true` | Enable TCP server |
|
|
217
|
+
| `DEVDUCK_ENABLE_WS` | `true` | Enable WebSocket |
|
|
218
|
+
| `DEVDUCK_ENABLE_MCP` | `true` | Enable MCP server |
|
|
219
|
+
| `DEVDUCK_LOG_LINE_COUNT` | `50` | Log lines in context |
|
|
220
|
+
| `SYSTEM_PROMPT` | - | Custom system prompt |
|
|
221
|
+
|
|
222
|
+
## Dynamic Tool Loading
|
|
223
|
+
|
|
224
|
+
Load tools from any Python package at runtime:
|
|
225
|
+
|
|
226
|
+
```python
|
|
227
|
+
devduck
|
|
228
|
+
🦆 install_tools(action="install_and_load",
|
|
229
|
+
package="strands-fun-tools",
|
|
230
|
+
module="strands_fun_tools")
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
No restart required—tools available immediately.
|
|
234
|
+
|
|
235
|
+
## System Prompt Management
|
|
236
|
+
|
|
237
|
+
Modify agent behavior dynamically:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
devduck
|
|
241
|
+
🦆 system_prompt(action="update", prompt="You are a senior Python expert.")
|
|
242
|
+
🦆 system_prompt(action="view") # See current prompt
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Logs
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
devduck
|
|
249
|
+
🦆 view_logs(action="view", lines=100)
|
|
250
|
+
🦆 view_logs(action="search", pattern="error")
|
|
251
|
+
🦆 view_logs(action="stats")
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Log location: `/tmp/devduck/logs/devduck.log`
|
|
255
|
+
|
|
256
|
+
## GitHub Actions
|
|
257
|
+
|
|
258
|
+
Run DevDuck in CI/CD:
|
|
259
|
+
|
|
260
|
+
```yaml
|
|
261
|
+
name: AI Assistant
|
|
262
|
+
on: [issues, pull_request]
|
|
263
|
+
|
|
264
|
+
jobs:
|
|
265
|
+
assistant:
|
|
266
|
+
runs-on: ubuntu-latest
|
|
267
|
+
permissions:
|
|
268
|
+
contents: read
|
|
269
|
+
issues: write
|
|
270
|
+
pull-requests: write
|
|
271
|
+
steps:
|
|
272
|
+
- uses: cagataycali/devduck@main
|
|
273
|
+
with:
|
|
274
|
+
task: "Help with this issue or PR"
|
|
275
|
+
provider: "github"
|
|
276
|
+
model: "openai/o4-mini"
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
**One file. 19+ tools. Self-healing. Hot-reload. RAG memory.**
|
|
282
|
+
|
|
283
|
+
*Built with [Strands Agents SDK](https://github.com/strands-agents/sdk-python)*
|
devduck-0.4.1/README.md
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# 🦆 DevDuck
|
|
2
|
+
|
|
3
|
+
**Self-healing agent. One file. Zero config.**
|
|
4
|
+
|
|
5
|
+
Minimalist AI that adapts to your environment and fixes itself when things break.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
**Homebrew (macOS/Linux):**
|
|
10
|
+
```bash
|
|
11
|
+
brew tap cagataycali/devduck
|
|
12
|
+
brew install devduck
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**pipx (all platforms):**
|
|
16
|
+
```bash
|
|
17
|
+
pipx install "devduck[all]" # Full install (recommended)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**uvx (instant run, no install):**
|
|
21
|
+
```bash
|
|
22
|
+
uvx devduck "hello world"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Requires: Python 3.10+, Ollama (or set `MODEL_PROVIDER`)
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
devduck # Interactive mode (auto-starts servers)
|
|
31
|
+
devduck "analyze this code" # CLI mode
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
import devduck
|
|
36
|
+
devduck("calculate 2+2") # Python API
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Core Features
|
|
40
|
+
|
|
41
|
+
- **🔧 Self-healing** - Auto-fixes dependencies, models, errors
|
|
42
|
+
- **🔥 Hot-reload** - Save `.py` files in `./tools/`, use instantly (no restart)
|
|
43
|
+
- **🧠 RAG memory** - Set `STRANDS_KNOWLEDGE_BASE_ID` for automatic context retrieval/storage
|
|
44
|
+
- **🌍 Multi-protocol** - TCP (9999), WebSocket (8080), MCP (8000), CLI, Python
|
|
45
|
+
- **📚 19+ tools** - shell, editor, calculator, python, GitHub, subagents, and more
|
|
46
|
+
- **🎯 Adaptive** - Auto-selects model by OS (macOS: 1.7b, Linux: 30b)
|
|
47
|
+
|
|
48
|
+
## Auto-Started Servers
|
|
49
|
+
|
|
50
|
+
When you run `devduck`, 3 servers start automatically:
|
|
51
|
+
|
|
52
|
+
| Server | Endpoint | Usage |
|
|
53
|
+
|--------|----------|-------|
|
|
54
|
+
| 🌐 **Web UI** | [cagataycali.github.io/devduck](http://cagataycali.github.io/devduck) | Browser interface |
|
|
55
|
+
| 🔌 **TCP** | `localhost:9999` | `nc localhost 9999` |
|
|
56
|
+
| 🌊 **WebSocket** | `ws://localhost:8080` | Structured JSON messages |
|
|
57
|
+
| 🔗 **MCP** | `http://localhost:8000/mcp` | Model Context Protocol |
|
|
58
|
+
|
|
59
|
+
**Customize ports:**
|
|
60
|
+
```bash
|
|
61
|
+
devduck --tcp-port 9000 --ws-port 8001 --mcp-port 3000
|
|
62
|
+
devduck --no-tcp --no-ws # Disable specific servers
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Connect Options
|
|
66
|
+
|
|
67
|
+
### MCP Client (Claude Desktop)
|
|
68
|
+
|
|
69
|
+
**Simple stdio mode (recommended):**
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"mcpServers": {
|
|
73
|
+
"devduck": {
|
|
74
|
+
"command": "uvx",
|
|
75
|
+
"args": ["devduck", "--mcp"]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Proxy mode (if devduck already running):**
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"mcpServers": {
|
|
85
|
+
"devduck": {
|
|
86
|
+
"command": "uvx",
|
|
87
|
+
"args": ["strands-mcp-server", "--upstream-url", "http://localhost:8000/mcp/"]
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Terminal (TCP)
|
|
94
|
+
```bash
|
|
95
|
+
nc localhost 9999
|
|
96
|
+
> analyze logs
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Shell Prefix
|
|
100
|
+
```bash
|
|
101
|
+
devduck
|
|
102
|
+
🦆 ! git status # Run shell commands with !
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Hot-Reload Tool Creation
|
|
106
|
+
|
|
107
|
+
Create tools instantly—no restart needed:
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
# ./tools/tip_calc.py
|
|
111
|
+
from strands import tool
|
|
112
|
+
|
|
113
|
+
@tool
|
|
114
|
+
def calculate_tip(amount: float, percent: float = 15.0) -> str:
|
|
115
|
+
"""Calculate restaurant tip."""
|
|
116
|
+
tip = amount * (percent / 100)
|
|
117
|
+
return f"Tip: ${tip:.2f} | Total: ${amount + tip:.2f}"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Save → Available instantly → Use: `devduck "calculate tip for $42"`
|
|
121
|
+
|
|
122
|
+
## Built-in Tools (19+)
|
|
123
|
+
|
|
124
|
+
| Category | Tools |
|
|
125
|
+
|----------|-------|
|
|
126
|
+
| **Development** | shell, editor, python_repl, load_tool, environment |
|
|
127
|
+
| **GitHub** | use_github, create_subagent, gist, add_comment, list_issues |
|
|
128
|
+
| **Network** | tcp, websocket, mcp_server, mcp_client, http_request |
|
|
129
|
+
| **AI** | use_agent, install_tools, retrieve, store_in_kb |
|
|
130
|
+
| **Utilities** | calculator, image_reader, scraper, system_prompt, view_logs |
|
|
131
|
+
|
|
132
|
+
## Multi-Model Support
|
|
133
|
+
|
|
134
|
+
Switch models via environment variables:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Bedrock (Claude)
|
|
138
|
+
export MODEL_PROVIDER="bedrock"
|
|
139
|
+
export STRANDS_MODEL_ID="us.anthropic.claude-sonnet-4-5-20250929-v1:0"
|
|
140
|
+
export STRANDS_MAX_TOKENS="64000"
|
|
141
|
+
|
|
142
|
+
# Anthropic API
|
|
143
|
+
export MODEL_PROVIDER="anthropic"
|
|
144
|
+
export STRANDS_MODEL_ID="claude-sonnet-4-20250514"
|
|
145
|
+
|
|
146
|
+
# Ollama (default)
|
|
147
|
+
export MODEL_PROVIDER="ollama"
|
|
148
|
+
export OLLAMA_HOST="http://localhost:11434"
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Knowledge Base (RAG)
|
|
152
|
+
|
|
153
|
+
Enable automatic memory across sessions:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
export STRANDS_KNOWLEDGE_BASE_ID="your-kb-id"
|
|
157
|
+
devduck # Auto-retrieves context before queries, stores after responses
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Works with AWS Bedrock Knowledge Bases.
|
|
161
|
+
|
|
162
|
+
## Environment Variables
|
|
163
|
+
|
|
164
|
+
| Variable | Default | Description |
|
|
165
|
+
|----------|---------|-------------|
|
|
166
|
+
| `MODEL_PROVIDER` | `ollama` | Model provider (bedrock, anthropic, ollama) |
|
|
167
|
+
| `STRANDS_KNOWLEDGE_BASE_ID` | - | Enable auto-RAG with KB ID |
|
|
168
|
+
| `DEVDUCK_TCP_PORT` | `9999` | TCP server port |
|
|
169
|
+
| `DEVDUCK_WS_PORT` | `8080` | WebSocket port |
|
|
170
|
+
| `DEVDUCK_MCP_PORT` | `8000` | MCP server port |
|
|
171
|
+
| `DEVDUCK_ENABLE_TCP` | `true` | Enable TCP server |
|
|
172
|
+
| `DEVDUCK_ENABLE_WS` | `true` | Enable WebSocket |
|
|
173
|
+
| `DEVDUCK_ENABLE_MCP` | `true` | Enable MCP server |
|
|
174
|
+
| `DEVDUCK_LOG_LINE_COUNT` | `50` | Log lines in context |
|
|
175
|
+
| `SYSTEM_PROMPT` | - | Custom system prompt |
|
|
176
|
+
|
|
177
|
+
## Dynamic Tool Loading
|
|
178
|
+
|
|
179
|
+
Load tools from any Python package at runtime:
|
|
180
|
+
|
|
181
|
+
```python
|
|
182
|
+
devduck
|
|
183
|
+
🦆 install_tools(action="install_and_load",
|
|
184
|
+
package="strands-fun-tools",
|
|
185
|
+
module="strands_fun_tools")
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
No restart required—tools available immediately.
|
|
189
|
+
|
|
190
|
+
## System Prompt Management
|
|
191
|
+
|
|
192
|
+
Modify agent behavior dynamically:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
devduck
|
|
196
|
+
🦆 system_prompt(action="update", prompt="You are a senior Python expert.")
|
|
197
|
+
🦆 system_prompt(action="view") # See current prompt
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Logs
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
devduck
|
|
204
|
+
🦆 view_logs(action="view", lines=100)
|
|
205
|
+
🦆 view_logs(action="search", pattern="error")
|
|
206
|
+
🦆 view_logs(action="stats")
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Log location: `/tmp/devduck/logs/devduck.log`
|
|
210
|
+
|
|
211
|
+
## GitHub Actions
|
|
212
|
+
|
|
213
|
+
Run DevDuck in CI/CD:
|
|
214
|
+
|
|
215
|
+
```yaml
|
|
216
|
+
name: AI Assistant
|
|
217
|
+
on: [issues, pull_request]
|
|
218
|
+
|
|
219
|
+
jobs:
|
|
220
|
+
assistant:
|
|
221
|
+
runs-on: ubuntu-latest
|
|
222
|
+
permissions:
|
|
223
|
+
contents: read
|
|
224
|
+
issues: write
|
|
225
|
+
pull-requests: write
|
|
226
|
+
steps:
|
|
227
|
+
- uses: cagataycali/devduck@main
|
|
228
|
+
with:
|
|
229
|
+
task: "Help with this issue or PR"
|
|
230
|
+
provider: "github"
|
|
231
|
+
model: "openai/o4-mini"
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
**One file. 19+ tools. Self-healing. Hot-reload. RAG memory.**
|
|
237
|
+
|
|
238
|
+
*Built with [Strands Agents SDK](https://github.com/strands-agents/sdk-python)*
|