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

@dcode-dev/dcode

v1.1.12

Published

AI-Powered Coding Assistant built with Go - Terminal-based AI assistant for writing, editing, and understanding code

Readme

dcode

CI Go Version License: MIT Release

dcode is an AI-powered terminal coding agent built in Go with a full Bubbletea TUI. It supports 20+ AI providers, autonomous tool use, multi-step undo/redo, live thinking display, and a rich @ file-picker — all without leaving your terminal.


Features

  • 20+ AI providers — Anthropic, OpenAI, Google Gemini, GitHub Copilot, Azure OpenAI, AWS Bedrock, Groq, OpenRouter, xAI, DeepSeek, Mistral, DeepInfra, Cerebras, Together AI, Cohere, Perplexity, GitLab, Cloudflare, Replicate, and any OpenAI-compatible endpoint
  • Autonomous tool use — reads, writes, edits files; searches with glob/grep; executes shell commands; browses the web; calls MCP servers
  • Rich TUI — Bubbletea interface with Glamour-rendered markdown, Chroma syntax highlighting, scrollable history, and a light-green blinking cursor
  • Thinking display — live streaming of extended-thinking / reasoning with opencode-style spinner and topic extraction
  • Multi-step undo/redoCtrl+Z / Ctrl+Shift+Z backed by git snapshots; also /undo and /redo slash commands
  • Copy code blocksCtrl+Y + digit copies the Nth code block from the last response; /copy N also works
  • @ file picker — type @ to attach any file (text, images, or directories); text files are injected as fenced code blocks, images as inline data
  • Session persistence — all conversations saved as JSON with import/export and share
  • MCP support — connects to local and remote Model Context Protocol servers
  • Git worktreesdcode worktree create <name> for isolated parallel sessions on separate branches
  • Non-interactive modedcode run "prompt" for scripting and CI/CD pipelines
  • Shell completions — bash, zsh, fish, and PowerShell via dcode completion

Installation

From a release (recommended)

Download the binary for your platform from the Releases page and put it on your PATH:

# Linux (x86_64)
curl -L https://github.com/Dhanuzh/dcode/releases/latest/download/dcode_linux_x86_64.tar.gz | tar xz
sudo mv dcode /usr/local/bin/

# macOS (Apple Silicon)
curl -L https://github.com/Dhanuzh/dcode/releases/latest/download/dcode_darwin_arm64.tar.gz | tar xz
sudo mv dcode /usr/local/bin/

Via go install

go install github.com/Dhanuzh/dcode/cmd/dcode@latest

Build from source

git clone https://github.com/Dhanuzh/dcode.git
cd dcode
make build        # builds ./dcode with version/commit ldflags
make install      # copies to /usr/local/bin (requires sudo)

Quick Start

# First run — dcode guides you through authentication
dcode

# Or authenticate explicitly
dcode auth login

# Non-interactive one-shot prompt
dcode run "explain the main function in cmd/dcode/main.go"

# Use a specific provider and model
dcode --provider openai --model gpt-4o

Authentication

dcode supports three credential sources, in priority order:

  1. Stored credentials (recommended) — dcode auth login saves keys to ~/.config/dcode/credentials.json with 0600 permissions
  2. Environment variables — e.g. ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_API_KEY
  3. Config file~/.config/dcode/dcode.json or project-local .dcode/dcode.json

Provider-specific OAuth flows:

dcode auth anthropic   # Anthropic OAuth PKCE flow (no API key needed)
dcode auth copilot     # GitHub Copilot device-code OAuth
dcode auth openai      # API key prompt

List configured providers:

dcode auth list

Configuration

Global config lives at ~/.config/dcode/dcode.json. Override per-project with .dcode/dcode.json in your repo root.

# View current resolved config
dcode config show

# Change settings
dcode config set provider anthropic
dcode config set model claude-sonnet-4-5
dcode config set theme dracula

| Key | Default | Description | |---|---|---| | provider | anthropic | Default AI provider | | model | (provider default) | Model ID | | default_agent | coder | Agent to use (coder, planner, explorer) | | max_tokens | 8192 | Max output tokens | | streaming | true | Stream responses | | theme | dark | TUI colour theme | | snapshot | true | Enable git snapshots for undo |


TUI Key Bindings

| Key | Action | |---|---| | Enter | Send message | | Ctrl+C | Cancel running request | | Ctrl+Z | Undo last AI action | | Ctrl+Shift+Z | Redo | | Ctrl+Y + digit | Copy Nth code block | | @ | Open file picker (attach file or image) | | Ctrl+L | Clear screen | | Ctrl+M | Toggle mouse mode | | Tab | Cycle through sessions / autocomplete | | / | Scroll history | | /help | List slash commands | | /undo, /redo | Undo / redo | | /copy N | Copy Nth code block | | /clear | Clear conversation | | /model | Switch model interactively | | /agent | Switch agent |


Available Commands

dcode                    # Start the TUI (default)
dcode run <prompt>       # Non-interactive single prompt
dcode auth               # Manage credentials
dcode config             # View/edit configuration
dcode models             # List all models by provider
dcode agent list         # List available agents
dcode session list       # List saved sessions
dcode session delete <id>
dcode export <session-id>
dcode import <file>
dcode share create <session-id>
dcode mcp list           # List MCP servers
dcode mcp add            # Add an MCP server
dcode worktree create <name>
dcode stats              # Usage statistics
dcode debug config       # Dump resolved config JSON
dcode version            # Show version and commit
dcode upgrade            # Self-update via go install
dcode completion bash    # Shell completion script

Project Structure

dcode/
├── cmd/dcode/              # CLI entry point (Cobra commands)
├── internal/
│   ├── agent/              # Agent definitions and system prompts
│   ├── config/             # Config loading, credentials, provider registry
│   ├── earlyinit/          # Lipgloss dark-background init (WSL2 fix)
│   ├── provider/           # AI provider implementations (20+)
│   ├── server/             # HTTP API server (headless mode)
│   ├── session/            # Session store, prompt engine, compaction
│   ├── share/              # Session sharing client
│   ├── tool/               # Tool registry and implementations
│   ├── tui/                # Bubbletea TUI model and components
│   └── worktree/           # Git worktree management
├── .github/workflows/      # CI + release (GoReleaser)
├── .goreleaser.yml         # Cross-platform release config
├── Makefile                # Build targets with ldflags
├── go.mod
└── LICENSE

Development

Prerequisites

Common tasks

make build      # build with version/commit injected
make test       # go test -race ./...
make cover      # test + HTML coverage report
make fmt        # gofmt -w .
make lint       # golangci-lint run
make cross      # cross-compile Linux/macOS/Windows
make snapshot   # local goreleaser snapshot

Adding a new AI provider

Implement the Provider interface in internal/provider/:

type Provider interface {
    Name() string
    Models() []ModelInfo
    CreateMessage(ctx context.Context, req *MessageRequest) (*MessageResponse, error)
    StreamMessage(ctx context.Context, req *MessageRequest, cb func(*StreamChunk) error) error
}

Register it in internal/provider/provider.goCreateProvider.

Adding a new tool

Implement tool.Tool in internal/tool/ and register it in tool.GetRegistry().


License

MIT — see LICENSE.


Acknowledgments