npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

duckcode

v0.1.8

Published

AI coding agent for your terminal — self-hosted, works with any OpenAI-compatible backend

Readme

🦆 DuckCode

AI coding agent for your terminal. Self-hosted, works with any OpenAI-compatible backend.

npx duckcode

Inspired by Claude Code. Built from scratch in TypeScript. Zero vendor lock-in.

What it does

DuckCode is an agentic coding assistant that runs in your terminal. You talk to it in natural language, and it reads, writes, edits, and runs code on your behalf — asking permission before anything destructive.

  🦆 Duck
  AI coding assistant · /clear to reset · Ctrl+C to exit

  ❯ fix the failing tests in src/utils

  ● Duck

  ✓ glob {pattern: "src/utils/**/*.test.ts"}
  ✓ file_read {path: "src/utils/parse.test.ts"}
  ✓ file_edit {path: "src/utils/parse.ts", old_str: "..."}
  ✓ bash {command: "npm test"}

  Fixed the off-by-one error in parseLine(). All 12 tests passing now.

Quick Start

# Try it (no install needed)
npx duckcode

# Or install globally
npm install -g duckcode
duckcode

First run shows a config guide. Create ~/.duck/config.json:

{
  "baseUrl": "https://your-api-endpoint.com",
  "apiKey": "your-key",
  "model": "your-model"
}

Or use env vars: DUCK_GATEWAY_URL, DUCK_API_KEY, DUCK_MODEL

Works with

Any backend that exposes /v1/chat/completions with streaming + tool_calls:

  • LiteLLM — proxy 100+ models through one endpoint
  • vLLM — self-hosted open models (Qwen, Llama, etc.)
  • Ollama — local models on your machine
  • OpenAI — GPT-4o, etc.
  • MiniMax — via TokenPlan or direct API
  • Any OpenAI-compatible gateway

Tools

| Tool | Permission | What it does | |------|-----------|--------------| | bash | ✋ confirm | Run shell commands | | file_read | ✅ auto | Read files with line numbers | | file_write | ✋ confirm | Create or overwrite files | | file_edit | ✋ confirm | Exact string-replace in files | | glob | ✅ auto | Find files by pattern | | grep | ✅ auto | Regex search across files | | web_fetch | ✅ auto | Fetch URLs, strip HTML |

auto = runs immediately. confirm = asks y/n before executing.

MCP Support

DuckCode supports Model Context Protocol servers. Add to config:

{
  "mcpServers": [
    {
      "name": "filesystem",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
    }
  ]
}

Tools from MCP servers are auto-discovered and registered.

Commands

| Command | What it does | |---------|--------------| | /clear | Reset conversation history | | /init | Generate DUCK.md from project structure |

Project Context

Create a DUCK.md (or CLAUDE.md) in your project root. DuckCode injects it into every conversation so the AI understands your project.

See DUCK.md.example for a template.

Features

  • Agentic loop — LLM calls tools, sees results, decides next step (up to 30 turns)
  • Streaming — responses stream token-by-token as they arrive
  • Context compression — auto-summarizes old messages when history gets long
  • MCP client — connect any MCP server via stdio
  • Multi-model — switch models with --model flag
  • Markdown rendering — code blocks, headings, lists in terminal
  • Spinner — animated indicator while thinking

Architecture

src/
├── main.ts           # CLI entry, event loop
├── config.ts         # Config loader + system prompt
├── types.ts          # Shared types
├── query/
│   ├── engine.ts     # Agentic loop: LLM → tools → LLM
│   └── compress.ts   # Context compression (LLM summarization)
├── tools/
│   ├── registry.ts   # Tool registry + helpers
│   ├── bash.ts       # Shell execution
│   ├── file-read.ts  # Read with line numbers
│   ├── file-write.ts # Write + string-replace edit
│   ├── glob-grep.ts  # File search + regex grep
│   ├── web-fetch.ts  # HTTP fetch
│   └── mcp.ts        # MCP client (stdio JSON-RPC)
├── ui/
│   ├── input.ts      # Raw stdin handler (no TUI framework)
│   └── console.ts    # Chalk output + markdown rendering
└── memory/
    └── context.ts    # DUCK.md / CLAUDE.md loader

Development

git clone https://github.com/simonlemon333/duckcode.git
cd duckcode
npm install
npm run dev          # run from source
npm run build        # build to dist/
npm run typecheck    # tsc --noEmit

License

MIT