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

@otto-assistant/opencode-commandcode

v0.4.0

Published

Command Code in OpenCode — Go-plan ($1) browser OAuth, gateway proxy, Laguna S 2.1, tools/MCP, attachments, compact, usage.

Downloads

514

Readme


Run Command Code models from OpenCode by proxying the same gateway that npm i -g command-code@latest uses (POST /alpha/generate). Default and exclusive live-test target: Laguna S 2.1 free (poolside/laguna-s-2.1-free, 256k context, $0).

Plugin shape mirrors @otto-assistant/opencode-claude and @otto-assistant/opencode-cursor.

Install

command-code is not a built-in OpenCode provider. Install the plugin first, or opencode auth login --provider command-code fails with Unknown provider "command-code".

# global (recommended)
opencode plugin @otto-assistant/opencode-commandcode -g

# or project-local (writes .opencode/opencode.json)
opencode plugin @otto-assistant/opencode-commandcode

Optional provider naming (also seeded when the plugin loads):

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@otto-assistant/opencode-commandcode"],
  "provider": {
    "command-code": { "name": "Command Code" }
  }
}

Or build from source:

git clone https://github.com/otto-assistant/opencode-commandcode.git
cd opencode-commandcode
bun install && bun run build
opencode plugin file://$PWD

Authenticate

Requires the plugin to be installed (see above). Preferred: Command Code Go plan ($1/mo) browser login — same as cmd login (open URL → Authorize → paste the key Studio shows).

# Option A — sync from Command Code CLI (recommended)
npm i -g command-code@latest
cmd login   # browser → Studio CLI auth (Go plan)
opencode auth login --provider command-code
# pick "Use existing cmd login session"

# Option B — browser login inside OpenCode (Go $1)
opencode auth login --provider command-code
# pick "Login with Command Code (Go $1)"
# open the URL, Authorize, then paste the API key (or ok if the browser already finished)

Then start OpenCode, pick provider command-code, and choose any model from the live catalog (cmd --list-models). Laguna S 2.1 free is the default when available:

opencode run "Summarise this repository in five bullets." --model command-code/laguna-s-2.1-free

Laguna S 2.1 free requires an active Go (or higher) account with credits on file; requests on that model still bill $0.

Why this plugin

| | | |---|---| | Gateway proxy | Talks to api.commandcode.ai/alpha/generate — same transport as the cmd CLI (mode=agent). | | Live model catalog | Discovered from cmd --list-models (enriched by the installed CLI’s models.md) — not hardcoded. | | Laguna S 2.1 free | Default when present — 256k context, $0 while the deal lasts. | | Auth options | Go-plan browser login (URL → paste key, same as cmd login) or sync an existing CLI session. | | Agent-grade tools | OpenCode tool calls park and resume; MCP-prefixed tools are tracked separately. | | Attachments | Images, PDFs, text/binary files from OpenCode. Text-only models get image placeholders (Command Code behavior). | | Auto-compact | Context-fraction tips + tiered client compact before the 256k window overflows. | | Usage | Per-turn and session totals via SSE usage + GET /v1/usage. |

Architecture

OpenCode
  └─ /v1/chat/completions
       └─ Bun.serve proxy (dynamic port, prefer 8797)
            └─ POST https://api.commandcode.ai/alpha/generate
                 └─ poolside/laguna-s-2.1-free (default)

Model catalog: live from cmd --list-models. Aliases like laguna / laguna-s-2.1-free resolve to poolside/laguna-s-2.1-free when that model is present. Auth credentials are mirrored between OpenCode auth.json and ~/.commandcode/auth.json.

Requirements

  • OpenCode
  • Command Code CLI (npm i -g command-code@latest) and a Go-plan account
  • Bun (plugin runtime) · Node.js ≥ 18 (CLI needs ≥ 22)

Development

bun install
bun run build
bun run test          # mocked gateway — attachments, tools, compact, usage
bun run test:live     # live Laguna S 2.1 (needs `cmd login` / Go plan session)

Debug logging: OPENCODE_COMMANDCODE_DEBUG=1.

Optional knobs:

  • OPENCODE_COMMANDCODE_PROXY_PORT — pin a fixed local proxy port (otherwise dynamic: prefer 8797, then scan upward / ephemeral)
  • OPENCODE_COMMANDCODE_CWD — working directory reported to the gateway
  • COMMANDCODE_API_URL / OPENCODE_COMMANDCODE_API_URL — override API base (default https://api.commandcode.ai)

Release

Publish via GitHub Actions → Actions → Release → Run workflow:

| Input | Purpose | |---|---| | version | Explicit semver (0.2.0). Empty → use bump | | bump | minor (default) / patch / major | | dry_run | Skip npm publish; create a draft GitHub release |

Requires repo secrets: NPM_TOKEN, optional DISCORD_WEBHOOK_URL.

Local pin refresh after a release:

./scripts/update-plugin.sh

FAQ

Do I need a Studio API key?
No. Use Go-plan browser login or sync from cmd login. After you Authorize in the browser, Studio may show a one-time key to paste into the OpenCode prompt — that key is part of the login flow, not a separate product API key.

Are only Laguna models available?
No. The plugin loads the full live catalog from cmd --list-models. Laguna is just the default free model used for testing.

Why isn’t Command Code listed without the plugin?
OpenCode doesn’t ship Command Code as a built-in provider; this plugin registers it.

Where are releases?
GitHub Releases · npm · Changelog

License

MIT