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

opencode-devin-plugin

v0.3.6

Published

OpenCode plugin to drive cloud Devin sessions and use Cognition LLM models (SWE-1.7, Claude, GPT-5.6, etc.) from the OpenCode agent.

Readme

devin-opencode

An OpenCode plugin that brings Devin / Cognition LLM models into OpenCode's /models picker and lets the OpenCode agent drive cloud Devin sessions.

What it does

  1. LLM provider — Adds 180+ Cognition models (SWE-1.7, Claude Opus 4.8, GPT-5.6, GLM-5.2, Gemini, Grok, etc.) to OpenCode's /models picker, streamed directly from Cognition's gRPC server.
  2. Devin session tools — Adds 6 tools the OpenCode agent can call to manage cloud Devin sessions.

| Tool | Purpose | | --- | --- | | devin_status | Check if Devin is connected and report auth sources | | devin_create_session | Hand off a task to a cloud Devin session | | devin_list_sessions | List recent sessions with status | | devin_get_session | Fetch session details and message history | | devin_send_message | Send a follow-up message to a session | | devin_terminate_session | Stop a running session |

Quick start

1. Install the plugin

opencode plugin opencode-devin-plugin --global

That's it for installation. The plugin auto-registers the devin provider in your config — no manual provider block needed.

2. Get a Windsurf OAuth token (for LLM models)

The LLM models are accessed via Cognition's Windsurf/Codeium gRPC server, which requires a Windsurf OAuth token. Get one with:

npx opencode-windsurf-auth login

This opens a browser sign-in page. After you log in, the token is saved to ~/.config/opencode-windsurf-auth/credentials.json and the plugin picks it up automatically.

Alternative: If you already have a token (starts with devin-session-token$...), set it as an env var instead:

export DEVIN_LLM_API_KEY=devin-session-token$your_token_here

3. (Optional) Get a Devin API key (for session tools)

The session management tools use a separate Devin API key:

  1. Go to Settings > Service users in the Devin app and create a service user with UseDevinSessions and ViewOrgSessions permissions
  2. Generate an API key — it starts with cog_
  3. Set it as an env var:
    export DEVIN_API_KEY=cog_your_key_here

You can also run /connect in the OpenCode TUI and choose Devin to store the key as a credential instead of using an env var.

DEVIN_ORG_ID is optional — if not set, the plugin auto-discovers it from the Devin CLI config or the /v3/organizations API.

4. Use it

Chat with Cognition models:

Start OpenCode, open /models, and pick any devin/ model (e.g. devin/swe-1-7). Or set it as your default:

// opencode.json
{
  "model": "devin/swe-1-7"
}

Hand off tasks to cloud Devin:

Ask the OpenCode agent:

Use devin_create_session to create a Devin session that refactors my auth module

Environment variables

| Variable | Required | Description | | --- | --- | --- | | DEVIN_LLM_API_KEY | No* | Windsurf OAuth token for LLM models (devin-session-token$...). Auto-detected from opencode-windsurf-auth credentials if not set. | | DEVIN_API_KEY | No** | Devin API key for session tools (cog_..., apk_..., or apk_user_...). Also settable via /connect. | | DEVIN_ORG_ID | No | Devin organization ID (org-...). Auto-discovered if not set. |

* Required for LLM models. Either set this env var or run npx opencode-windsurf-auth login. * Required for session tools. Either set this env var or run /connect in the TUI.

How auth works

The plugin uses two separate credentials:

| Credential | Used for | How to get it | | --- | --- | --- | | Windsurf OAuth token (devin-session-token$...) | LLM model streaming (chat) | npx opencode-windsurf-auth login or DEVIN_LLM_API_KEY | | Devin API key (cog_...) | Session management tools | /connect in TUI or DEVIN_API_KEY |

You can use just the LLM models without the session tools, or vice versa. Run devin_status to check which are connected.

Install from source

git clone https://github.com/karthiknish/devin-opencode.git
cd devin-opencode
npm install

Then reference it in your config:

// opencode.json
{
  "plugin": ["./devin-opencode/src/index.ts"]
}

API versioning

The session tools use the Devin v3 API (/v3/organizations/{org_id}/sessions) for cog_ service user keys. For legacy apk_/apk_user_ keys, it automatically falls back to the deprecated v1 API.

| Key type | API version | Status | | --- | --- | --- | | cog_ (service user) | v3 | Current, recommended | | apk_user_ (personal) | v1 (fallback) | Deprecated | | apk_ (service) | v1 (fallback) | Deprecated |

Project layout

src/
  index.ts              # Plugin entrypoint (auth + LLM provider + tools)
  devin.ts              # Devin REST API client (v3 + v1 fallback)
packages/
  ai-sdk-devin/         # AI SDK provider for Cognition gRPC (LanguageModelV3)
    src/
      index.ts          # Provider factory + prompt/stream conversion
      chat.ts           # GetChatMessage streaming via Connect-RPC
      catalog.ts        # GetCascadeModelConfigs (model catalog)
      auth.ts           # GetUserJwt (short-lived JWT minting)
      metadata.ts       # gRPC metadata builder
      wire.ts           # Protobuf encoding helpers
examples/
  opencode.v1.json      # Example config

Releasing

Every push to main automatically bumps the patch version and publishes to npm via OIDC trusted publishing. No tokens, no manual steps.

git push

The workflow typechecks, bumps the version, commits it back, and publishes with --provenance.

Watch runs at https://github.com/karthiknish/devin-opencode/actions.

License

MIT