{"id":46453621,"url":"https://github.com/t-rhex/duckling","last_synced_at":"2026-03-06T01:05:36.641Z","repository":{"id":338117357,"uuid":"1156592461","full_name":"t-rhex/duckling","owner":"t-rhex","description":"Open-source autonomous coding agent platform. Describe a task, get a PR. Inspired by Stripe Minions.","archived":false,"fork":false,"pushed_at":"2026-02-13T02:18:30.000Z","size":669,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-13T07:36:10.788Z","etag":null,"topics":["ai-developer-tools","autonomous-agent","code-review","coding-agent","docker","fastapi","open-source","slack-bot","stripe-minions"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/t-rhex.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-12T20:32:34.000Z","updated_at":"2026-02-13T04:14:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/t-rhex/duckling","commit_stats":null,"previous_names":["t-rhex/duckling"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/t-rhex/duckling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-rhex%2Fduckling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-rhex%2Fduckling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-rhex%2Fduckling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-rhex%2Fduckling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t-rhex","download_url":"https://codeload.github.com/t-rhex/duckling/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-rhex%2Fduckling/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30156905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"ssl_error","status_checked_at":"2026-03-05T22:39:24.771Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-developer-tools","autonomous-agent","code-review","coding-agent","docker","fastapi","open-source","slack-bot","stripe-minions"],"created_at":"2026-03-06T01:05:35.742Z","updated_at":"2026-03-06T01:05:36.615Z","avatar_url":"https://github.com/t-rhex.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Duckling\n\nOpen-source autonomous coding agent platform. Describe a task, get a PR.\n\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n[![Python 3.10+](https://img.shields.io/badge/Python-3.10+-3776AB.svg)](https://www.python.org/downloads/)\n[![CI](https://img.shields.io/github/actions/workflow/status/t-rhex/duckling/ci.yml?branch=main\u0026label=CI)](https://github.com/t-rhex/duckling/actions)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)\n\n## What is Duckling?\n\nDuckling is an autonomous coding agent platform. An engineer describes a coding task in plain English -- via Slack, a terminal UI, or the REST API -- and Duckling does the rest. It claims a pre-warmed container in milliseconds, runs an AI coding agent (Goose) inside it, and delivers either a fully-tested pull request or a deep code review report. Zero human code written.\n\nThe system is inspired by Stripe's internal \"Minions\" platform, rebuilt from scratch as an open-source project. Where Minions is proprietary and tightly coupled to Stripe's infrastructure, Duckling is self-hosted, provider-agnostic, and designed to work with any OpenAI-compatible LLM backend -- OpenRouter, Anthropic, OpenAI, or local models.\n\nDuckling supports dual modes, automatically classified by its intent engine: **Code Mode** for autonomous PR generation (clone, analyze, plan, code, lint, test, repair, commit, PR) and **Review Mode** for CodeRabbit-style deep code review (AST security scanning, dependency analysis, per-file AI review, cross-file synthesis, and structured report generation).\n\n## Why Duckling?\n\n| Feature | Duckling | OpenHands | Aider | Goose (standalone) |\n|---|---|---|---|---|\n| Pre-warmed container pool | Yes | No | No | No |\n| Slack-native interface | Yes | No | No | No |\n| Dual mode (code + review) | Yes | No | No | No |\n| 9-step review pipeline | Yes | No | No | No |\n| Real-time TUI dashboard | Yes | Web UI | CLI only | CLI only |\n| Intent classification | Yes | No | No | No |\n| AST security scanning | Yes | No | No | No |\n| Self-hosted | Yes | Yes | Yes | Yes |\n\n## Architecture\n\n```\n    Slack / TUI / Web UI / CLI / API\n            |\n            v\n    +---------------+\n    |  ORCHESTRATOR  |  FastAPI -- task queue, intent classification, routing\n    +-------+-------+\n            |\n            v\n    +---------------+\n    |  WARM POOL     |  Pre-warmed containers (Firecracker prod / Docker demo)\n    +-------+-------+\n            |\n            v\n    +---------------+\n    |  AGENT RUNNER  |  AI agent loop inside the container (OpenCode / Goose / Copilot)\n    |  (OpenCode)    |  9-step pipeline: setup \u003e analyze \u003e plan \u003e code \u003e lint \u003e test \u003e repair \u003e commit \u003e PR\n    +-------+-------+\n            |\n            v\n    +---------------+\n    |  GIT MANAGER   |  GitHub + Bitbucket PR creation\n    +---------------+\n```\n\n## Quick Start\n\n```bash\n# Clone\ngit clone https://github.com/t-rhex/duckling.git\ncd duckling\n\n# Configure\ncp .env.example .env\n# Edit .env -- set your LLM API key (OpenRouter, Anthropic, or OpenAI)\n\n# Start services\ndocker compose up -d\n\n# Submit a task via the TUI\ncd tui \u0026\u0026 bun install \u0026\u0026 bun src/index.ts\n\n# Or via CLI\npython scripts/duckling-cli.py submit \\\n  \"Fix the flaky test in auth service\" \\\n  --repo https://github.com/your-org/your-repo\n\n# Or via API\ncurl -X POST http://localhost:8000/api/tasks \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"description\": \"Fix the flaky test\", \"repo_url\": \"https://github.com/your-org/your-repo\"}'\n```\n\n## Web Dashboard\n\nDuckling includes a web dashboard built with Next.js 16, React 19, shadcn/ui, and Tailwind CSS v4. It provides a full-featured UI for managing tasks, monitoring agent execution, and reviewing results.\n\n### Features\n\n- **Dashboard home** -- stat cards, recent tasks, pool health at a glance\n- **Task list** -- paginated table with status, mode, priority, duration\n- **New task form** -- submit tasks with repo URL, branch, mode, priority, iterations, timeout\n- **Task detail** -- live agent log viewer (terminal style), review output markdown renderer, status timeline, metadata sidebar\n- **Pool health** -- VM grid visualization with container states\n- **Light/dark theme** -- toggle with system preference detection\n- **Real-time updates** -- WebSocket integration for live task monitoring\n\n### Building the Dashboard\n\n```bash\ncd dashboard\nnpm install\nnpm run build        # Outputs static files to dashboard/out/\n```\n\nThe static export is served by the FastAPI orchestrator -- no Node.js server needed in production. When running via Docker Compose, the `dashboard/out/` directory is volume-mounted and served at the root URL (http://localhost:8000/).\n\n### Development\n\n```bash\ncd dashboard\nnpm run dev          # Starts dev server on http://localhost:3000\n```\n\nThe dev server proxies API calls to the orchestrator at `http://localhost:8000`.\n\n## The Agent Pipeline\n\nTwo modes, automatically classified by the intent engine:\n\n### Code Mode (autonomous PR generation)\n\n```\n1. SETUP      Clone repo, install deps              (deterministic)\n2. ANALYZE    Agent reads and understands codebase   (AI)\n3. PLAN       Agent creates execution plan           (AI)\n4. CODE       Agent writes code changes              (AI)\n5. LINT       Run ruff/eslint                        (deterministic)\n6. TEST       Run pytest/jest                        (deterministic)\n7. REPAIR     If tests fail, agent fixes (up to 5x)  (AI -\u003e goto 5)\n8. COMMIT     Stage, commit, push                    (deterministic)\n9. PR         Create pull request                    (deterministic)\n```\n\n### Review Mode (deep code review)\n\n```\nPhase 1 -- Deterministic Analysis:\n  1. SETUP                Clone and prepare workspace\n  2. FILE_INVENTORY       Catalog all changed files\n  3. DEPENDENCY_ANALYSIS  Map import graph\n  4. CODE_METRICS         Lines, complexity, coverage (scc)\n  5. AST_SECURITY_SCAN    Pattern-based vulnerability detection (ast-grep + bandit)\n\nPhase 2 -- AI-Powered Review:\n  6. FILE_LEVEL_REVIEW      Per-file deep analysis\n  7. CROSS_FILE_SYNTHESIS   Cross-cutting concern detection\n  8. REPORT_GENERATION      Structured markdown report\n  9. GIT_STATS              Diff statistics\n```\n\n## Project Structure\n\n| Directory | Description |\n|-----------|-------------|\n| `orchestrator/` | FastAPI service -- REST API, WebSocket, task queue, intent classifier |\n| `warm_pool/` | Container lifecycle manager (Firecracker + Docker backends) |\n| `agent_runner/` | AI agent loop (OpenCode, Goose, Copilot) with 9-step code and review pipelines |\n| `git_integration/` | GitHub + Bitbucket abstraction layer |\n| `slack_bot/` | Slack bot with slash commands and mentions |\n| `tui/` | Terminal UI built with Bun + OpenTUI |\n| `gui/` | Desktop app built with Tauri + SolidJS (experimental) |\n| `mcp_toolshed/` | MCP tool server for agent extensions |\n| `ast_grep_rules/` | AST-based security scanning rules |\n| `dashboard/` | Next.js 16 + shadcn/ui web dashboard (static export) |\n| `demo_repo/` | Example repo with intentional bugs for testing |\n| `scripts/` | CLI tool |\n| `tests/` | Test suite (70+ tests) |\n\n## API Reference\n\n```\nPOST   /api/tasks           Submit a new coding task\nGET    /api/tasks            List all tasks (paginated)\nGET    /api/tasks/{id}       Get task details + status\nDELETE /api/tasks/{id}       Cancel a running task\nGET    /api/tasks/{id}/log   Stream agent execution log\nGET    /api/pool/stats       Container pool statistics\nGET    /api/health           Health check\nWS     /ws/tasks/{id}        Real-time task updates via WebSocket\n```\n\n## Configuration\n\nDuckling uses [OpenCode](https://opencode.ai) as its default agent engine, which supports 75+ LLM providers. Set these in your `.env`:\n\n```bash\n# Agent engine (default: opencode)\nAGENT_BACKEND=opencode\n\n# Option 1: OpenCode Zen (curated models, some free — no API key needed)\nOPENCODE_ZEN_API_KEY=your-zen-key\nOPENCODE_MODEL=opencode/big-pickle           # Free (limited time)\nOPENCODE_MODEL=opencode/kimi-k2.5-free       # Free (limited time)\nOPENCODE_MODEL=opencode/claude-sonnet-4-5    # Paid via Zen\n\n# Option 2: OpenRouter (access to many models)\nOPENAI_API_KEY=sk-or-v1-your-key\nOPENAI_HOST=https://openrouter.ai/api/\nOPENCODE_MODEL=deepseek/deepseek-chat-v3-0324\n\n# Option 3: Direct Anthropic\nANTHROPIC_API_KEY=sk-ant-your-key\nOPENCODE_MODEL=anthropic/claude-sonnet-4-5\n\n# Option 4: Direct OpenAI\nOPENAI_API_KEY=sk-your-key\nOPENCODE_MODEL=openai/gpt-4o\n```\n\nLegacy engines (Goose, GitHub Copilot SDK) are still supported by setting `AGENT_BACKEND=goose` or `AGENT_BACKEND=copilot`. See `.env.example` for all configuration options.\n\n## Development\n\n```bash\nmake install      # Install Python deps\nmake test         # Run tests\nmake lint         # Run linter\nmake typecheck    # Python type checking\nmake tui          # Launch the TUI\nmake dev          # Start with Docker Compose\nmake help         # See all targets\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for the full development guide.\n\n## Production vs Demo\n\n| Feature | Demo | Production |\n|---------|------|------------|\n| Container Backend | Docker | Firecracker microVMs |\n| Claim Time | ~500ms | ~5ms |\n| Snapshot/Restore | N/A | Full memory + disk |\n| Concurrency | 5 tasks | 50+ tasks |\n| Queue | In-memory | Redis |\n| Database | SQLite | PostgreSQL |\n\n## License\n\nApache License 2.0. See [LICENSE](LICENSE) for details.\n\n## Contributing\n\nContributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft-rhex%2Fduckling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft-rhex%2Fduckling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft-rhex%2Fduckling/lists"}