Skip to main content

🦆 Extreme minimalist self-adapting AI agent - one file, self-healing, runtime dependencies

Project description

🦆 DevDuck

Self-healing agent. One file. Zero config.

Minimalist AI that adapts to your environment and fixes itself when things break.

Install

pipx install "devduck[all]"  # Full install (recommended)

Requires: Python 3.10+, Ollama (or set MODEL_PROVIDER)

Quick Start

devduck                      # Interactive mode (auto-starts servers)
devduck "analyze this code"  # CLI mode
import devduck
devduck("calculate 2+2")  # Python API

Core Features

  • 🔧 Self-healing - Auto-fixes dependencies, models, errors
  • 🔥 Hot-reload - Save .py files in ./tools/, use instantly (no restart)
  • 🧠 RAG memory - Set STRANDS_KNOWLEDGE_BASE_ID for automatic context retrieval/storage
  • 🌍 Multi-protocol - TCP (9999), WebSocket (8080), MCP (8000), CLI, Python
  • 📚 19+ tools - shell, editor, calculator, python, GitHub, subagents, and more
  • 🎯 Adaptive - Auto-selects model by OS (macOS: 1.7b, Linux: 30b)

Auto-Started Servers

When you run devduck, 3 servers start automatically:

Server Endpoint Usage
🌐 Web UI cagataycali.github.io/devduck Browser interface
🔌 TCP localhost:9999 nc localhost 9999
🌊 WebSocket ws://localhost:8080 Structured JSON messages
🔗 MCP http://localhost:8000/mcp Model Context Protocol

Customize ports:

devduck --tcp-port 9000 --ws-port 8001 --mcp-port 3000
devduck --no-tcp --no-ws  # Disable specific servers

Connect Options

MCP Client (Claude Desktop)

Simple stdio mode (recommended):

{
  "mcpServers": {
    "devduck": {
      "command": "uvx",
      "args": ["devduck", "--mcp"]
    }
  }
}

Proxy mode (if devduck already running):

{
  "mcpServers": {
    "devduck": {
      "command": "uvx",
      "args": ["strands-mcp-server", "--upstream-url", "http://localhost:8000/mcp/"]
    }
  }
}

Terminal (TCP)

nc localhost 9999
> analyze logs

Shell Prefix

devduck
🦆 ! git status  # Run shell commands with !

Hot-Reload Tool Creation

Create tools instantly—no restart needed:

# ./tools/tip_calc.py
from strands import tool

@tool
def calculate_tip(amount: float, percent: float = 15.0) -> str:
    """Calculate restaurant tip."""
    tip = amount * (percent / 100)
    return f"Tip: ${tip:.2f} | Total: ${amount + tip:.2f}"

Save → Available instantly → Use: devduck "calculate tip for $42"

Built-in Tools (19+)

Category Tools
Development shell, editor, python_repl, load_tool, environment
GitHub use_github, create_subagent, gist, add_comment, list_issues
Network tcp, websocket, mcp_server, mcp_client, http_request
AI use_agent, install_tools, retrieve, store_in_kb
Utilities calculator, image_reader, scraper, system_prompt, view_logs

Multi-Model Support

Switch models via environment variables:

# Bedrock (Claude)
export MODEL_PROVIDER="bedrock"
export STRANDS_MODEL_ID="us.anthropic.claude-sonnet-4-5-20250929-v1:0"
export STRANDS_MAX_TOKENS="64000"

# Anthropic API
export MODEL_PROVIDER="anthropic"
export STRANDS_MODEL_ID="claude-sonnet-4-20250514"

# Ollama (default)
export MODEL_PROVIDER="ollama"
export OLLAMA_HOST="http://localhost:11434"

Knowledge Base (RAG)

Enable automatic memory across sessions:

export STRANDS_KNOWLEDGE_BASE_ID="your-kb-id"
devduck  # Auto-retrieves context before queries, stores after responses

Works with AWS Bedrock Knowledge Bases.

Environment Variables

Variable Default Description
MODEL_PROVIDER ollama Model provider (bedrock, anthropic, ollama)
STRANDS_KNOWLEDGE_BASE_ID - Enable auto-RAG with KB ID
DEVDUCK_TCP_PORT 9999 TCP server port
DEVDUCK_WS_PORT 8080 WebSocket port
DEVDUCK_MCP_PORT 8000 MCP server port
DEVDUCK_ENABLE_TCP true Enable TCP server
DEVDUCK_ENABLE_WS true Enable WebSocket
DEVDUCK_ENABLE_MCP true Enable MCP server
DEVDUCK_LOG_LINE_COUNT 50 Log lines in context
SYSTEM_PROMPT - Custom system prompt

Dynamic Tool Loading

Load tools from any Python package at runtime:

devduck
🦆 install_tools(action="install_and_load", 
              package="strands-fun-tools", 
              module="strands_fun_tools")

No restart required—tools available immediately.

System Prompt Management

Modify agent behavior dynamically:

devduck
🦆 system_prompt(action="update", prompt="You are a senior Python expert.")
🦆 system_prompt(action="view")  # See current prompt

Logs

devduck
🦆 view_logs(action="view", lines=100)
🦆 view_logs(action="search", pattern="error")
🦆 view_logs(action="stats")

Log location: /tmp/devduck/logs/devduck.log

GitHub Actions

Run DevDuck in CI/CD:

- name: DevDuck Analysis
  uses: cagataycali/devduck@main
  with:
    query: "analyze test coverage"
    model: "us.anthropic.claude-sonnet-4-20250514-v1:0"

One file. 19+ tools. Self-healing. Hot-reload. RAG memory.

Built with Strands Agents SDK

Project details


Download files

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

Source Distribution

devduck-0.4.0.tar.gz (77.7 kB view details)

Uploaded Source

Built Distribution

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

devduck-0.4.0-py3-none-any.whl (52.1 kB view details)

Uploaded Python 3

File details

Details for the file devduck-0.4.0.tar.gz.

File metadata

  • Download URL: devduck-0.4.0.tar.gz
  • Upload date:
  • Size: 77.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for devduck-0.4.0.tar.gz
Algorithm Hash digest
SHA256 615cb151704760ca026b8c3aa0bbd9a8a87cdd9c0921f19efb4ab0b3f8325dc6
MD5 13224bc3121054211525a5338928a2c7
BLAKE2b-256 3f4dc81a5328f38f158db9d2b46fc7ad957b5201f1b5604fae24795c909dd788

See more details on using hashes here.

File details

Details for the file devduck-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: devduck-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 52.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for devduck-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a871326fff7a0c7bd15424cd2a8a5dc457a726194aacce697a46020d9aec5197
MD5 dbace2c3bc4a3a656fe3575e76652960
BLAKE2b-256 cedacb33fedfbbb60c5aca5dbde6ab7eef475f6a4573e9c419ce8ffa22ecbefc

See more details on using hashes here.

Supported by

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