yetone 49e9d89d59 commandcode 0.1.12: each plan lists only the models it may use; a Go account no longer lists GOAT's (01huadalang on Discord)
01huadalang, signed in on the Go plan, was shown models only GOAT and above
may use. Command Code's /provider/v1/models is the same 87 models for every
plan (read with a GOAT key and without one on 2026-10-13: the same but for
"created"); which of them a plan may use is the CLI's own table (command-code
1.79.2, evaluateModelAccess: each model's category, premium or open, and
each plan's allowedCategories and blockedModels), and the Provider API turns
the rest away only when asked (403 "MODEL_NOT_IN_PLAN: Claude Opus 5.5
available in Provider and above plans or extra on demand usage").

Cause: the plugin filtered Go's list by a copy of CLI 1.73.0's table, which
didn't have Claude Haiku 5.5 (1.79.2: "haiku 5.5 in goat plan", blocked for
Go), and didn't filter any other plan at all, so GOAT, Pro and Provider were
shown models their plan refuses (a real GOAT account listed all 87, Claude
Opus 5.5 and GPT-6 Sol among them).

Now:
- PLAN_MODELS is CLI 1.79.2's table by plan name: Go and GOAT the open
  models only, Go also blocked from GOAT's (Sonnet 5.5, Haiku 5.5, GPT-5.6
  Sol, Grok 4.6/4.7, Muse Spark 1.2/1.3, Gemini 3.7/3.8 Flash, MiMo V2.6 Pro
  UltraSpeed), Pro blocked from Opus, Fable, GPT-6 Astra, GPT-6.1 Sol and
  Fugu Ultra, Provider from GPT-6.1 Sol, Max/Ultra/Teams Pro everything.
  GO_REFUSED is derived from it. Blocks are by id: the CLI's own block of
  "vercel-ai-gateway:xiaomi/mimo-v2.6-pro-ultraspeed" misses its "cai"
  model, and Go stays kept off it as before.
- provider.models filters every plan's list (and the default list standing
  in when the list can't be read) by it.
- A plan not read (billing/subscriptions failing, nothing saved), "No plan",
  or a plan name the table doesn't know keeps the whole list.
- Bought or free credits (billing/credits) let every model, as the CLI does;
  credits not read are taken as last read, else none, so the plan's list
  stands and a model it leaves out is still refused by Command Code.
- The refusal itself is unchanged: the Provider API's 403 reaches the agent
  as it came, and on Go's endpoint failure() says "Model not in plan: …".

Tests: plan-models.test.mjs is new, built from real bytes in testdata
(models-2026-10-13.json, a GOAT account's subscriptions and credits replies
with its ids zeroed, the two MODEL_NOT_IN_PLAN refusals). The Go case uses
the GOAT reply with Go's planId: there is no Go account here. All 7 fail on
0.1.11. Broken by hand, each goes red: Haiku 5.5 unblocked for Go (Go test),
no plan filter (5 tests), credits ignored, an unread plan refusing premium,
the stand-in list unfiltered, credits unread taken as extra.
models.test.mjs's pictures test moves from Pro to Max, since Pro's list no
longer has Claude Opus 5.5.

Ran: TMPDIR=<scratch> HOME=<scratch>/home bun test (all packages, 1144 pass,
0 fail) and bun scripts/check.mjs commandcode. The new provider.models hook
against the owner's real GOAT account (saved plan and none) lists 66 models:
Sonnet 5.5, Haiku 5.5 and GPT-5.6 Sol in, Opus 5.5, Sonnet 5 and GPT-6 Sol
out; a 1-token request confirmed GOAT gets Haiku 5.5 (200) and is refused
Sonnet 5 (403 MODEL_NOT_IN_PLAN).
Not tried: a real Go account (none here), an account with bought credits,
and the new version inside a running OpenCode/magpie; magpie needs the
mover's min raised to 0.1.12 for moved users to get it.
2026-10-13 00:44:50 +08:00

magpie-community plugins

OpenCode provider plugins for coding-plan subscriptions, and gateway middleware and agents for magpie, maintained by the community. Each package signs in to one subscription and makes its requests. The packages work in OpenCode and in magpie, which runs OpenCode's provider plugins.

Package Signs in to Provider id
cline Cline (cline.bot): usage-billed models, ClinePass's and Cline's free ones, with Cline's device sign-in or an API key cline
commandcode Command Code plans (Pro, GOAT, Max, Ultra, Go, Teams Pro) commandcode-plan
cursor Cursor subscriptions (Pro, Pro+, Ultra, Teams), on the API cursor-agent talks to cursor
devin Devin subscription (the devin CLI's account) devin
factory Factory (Droid) subscription factory
grok Grok (SuperGrok / X Premium+), through the Grok Build CLI's sign-in grok
kiro Kiro (Free, Pro, Pro+, Power), with Kiro's sign-in, kiro-cli's or the IDE's, or an API key kiro
minimax MiniMax Code (China): account credits and M Plan, with MiniMax Code's device sign-in minimax-code
minimax MiniMax Code (international): account credits and M Plan, with MiniMax Code's device sign-in minimax-code-global
mimo Xiaomi MiMo, with a Xiaomi account mimo-app
qoder Qoder subscription (qoder.com), with Qoder's device sign-in qoder
qoder Qoder CN subscription (qoder.cn), with Qoder CN's device sign-in qoder-cn
trae Trae CN (trae.cn) and Trae international (trae.ai), free tier included, with Trae's browser sign-in (experimental) trae-cn, trae-global
workbuddy WorkBuddy (China build, CodeBuddy plan) workbuddy
workbuddy WorkBuddy (international build) workbuddy-ai
zcode ZCode: Z.ai / BigModel (智谱) GLM Coding Plan, team seats, Start Plan zcode
zed Zed (Pro, Pro Trial, Student, Business): Anthropic, OpenAI, Google and xAI models hosted by Zed zed
zen-free OpenCode Zen free models with the public credential opencode-zen-free

Gateway middleware

These packages aren't OpenCode plugins. magpie runs them in its gateway, on the requests every agent sends and the replies it gets back, whichever provider serves them. Each one is a port of something New API does for its channels, or something agents commonly need.

Package What it does
param-override New API's 参数覆盖 (param_override): set, delete, move, copy or rewrite request fields, for some models or under conditions, or turn a request away
model-map New API's 模型重定向 (model_mapping): send a model under another name, by name or /pattern/; replies name the model asked for
system-prompt Your own system prompt on every request, or on some agents' or models', in each API's own place
word-guard New API's 敏感词过滤: turn away or mask words and patterns in what users send, and in replies
think-tags Take <think>…</think> out of a reply's text, or put a Chat reply's reasoning_content into it (thinking_to_content)
magpie plugin add @magpie-community/middleware-<name>
magpie plugin options <name> '<json>'

In the app, they're under Plugins › Discover › Gateway middleware, and each one's Options button edits its options in its row.

A middleware package is a folder under packages/<name>/ with:

  • package.json: name @magpie-community/middleware-<name>, "magpie": {"middleware": "./<name>.middleware.js", "options": {…}}, no main. options is the example magpie offers when none are set.
  • <name>.middleware.js: exports onRequest, onEvent and/or onResponse (the hooks). It runs in magpie's gateway on moejs, so it is one file and imports nothing.
  • cases.json and a test that runs them with check() from scripts/middleware.mjs, which calls the hooks the way the gateway does.

Agents

These add an agent magpie has no setup of its own for. Once added, the agent is on magpie's Agents page like the ones magpie ships with: pick one of magpie's models in its row and magpie writes it into the agent's config, and switching it off puts the config back.

Package Agent
aider Aider: ~/.aider.conf.yml, through litellm's openai/ prefix
magpie plugin add @magpie-community/agent-<name>

An agent package is a folder under packages/<name>/ with:

  • package.json: name @magpie-community/agent-<name>, "magpie": {"agent": "./<name>.agent.js"}, no main.
  • <name>.agent.js: exports agent (where the agent keeps its model) and, if it needs more than the model, connect (the other keys to write) (the reference). It runs in magpie on moejs, so it is one file and imports nothing.
  • a test of what connect returns.

Skills

Agent skills for magpie users, in skills/<name>/SKILL.md.

Skill What it does
magpie-quota Lets an agent check what is left of every subscription, coding plan and key balance magpie has (magpie quota --json), and wait for allowance to come back

In magpie, it is first under Library › Market › Skills. Elsewhere:

npx skills add magpie-community/plugins --skill magpie-quota

Use

magpie:

magpie plugin add @magpie-community/opencode-<name>-auth
magpie plugin login <provider id>

In the app, the Plugins tab lists these packages: install one there, then sign in.

OpenCode, in opencode.json:

{ "plugin": ["@magpie-community/opencode-<name>-auth"] }

then opencode auth login.

Writing a package

Each package is a folder under packages/<name>/:

  • package.json
    • name: @magpie-community/opencode-<name>-auth
    • "type": "module", "main": "./index.mjs"
    • version, "license": "MIT"
    • no runtime dependencies unless one is really needed. Bun's and Node's fetch, crypto and fs usually cover it.
  • index.mjs
    • Exports one async plugin function, as OpenCode's Plugin type describes.
    • Returns an auth hook: { provider, loader, methods }.
      • A browser sign-in is { type: "oauth", label, prompts?, authorize }. authorize returns { url, instructions, method: "auto" | "code", callback }.
      • A key is { type: "api", label }.
      • loader(getAuth, provider) returns what the AI SDK is given: baseURL, apiKey, headers and a fetch that signs each request and refreshes the token (saving it with client.auth.set).
    • A provider that models.dev doesn't list is declared in a config hook that sets config.provider[<id>] = { name, npm, api, models }. The npm field names the AI SDK package the models speak: @ai-sdk/openai-compatible (chat completions), @ai-sdk/openai (Responses) or @ai-sdk/anthropic (Messages).
    • A list the account decides goes in the provider: { id, models(provider, { auth }) } hook.
    • A daily check-in (签到) the vendor rewards goes in the auth hook as checkin(getAuth, provider). magpie calls it once a day for each signed-in account while the user has it on (Settings → Usage → Plugins), and shows what came of it on the account's Usage card. It returns { outcome, credit?, streak?, message? }, outcome being claimed (checked in now), done (already today), ineligible, inactive (no check-in event now), captcha or failed; a throw is failed with its message, and only failed is tried again that day. Never solve a captcha: return captcha and the user checks in in the vendor's app. Needs magpie with the hook (after v0.1.1083); the contract.
  • README.md: what the package signs in to, how, where the sign-in is kept, and the models.

The provider id is the one magpie's built-in subscription has (grok, zcode, workbuddy, commandcode-plan, …). While magpie still has the built-in, the plugin's provider shows as <id>-plugin. Once the built-in is gone, it takes over the same id, so an agent set to <id>/<model> keeps working.

Checking a package

bun scripts/check.mjs [<name>]        # loads each plugin and checks its hooks; signs in to nothing
MAGPIE=/path/to/magpie scripts/try.sh <name> [login <id> | provider test <id>-plugin]

try.sh runs magpie in a sandbox HOME (.sandbox/<name>), so your own magpie, agents and sign-ins are left alone.

License

MIT

The market

registry.json is the list magpie's Plugins tab shows: the packages here. A middleware's entry has "kind": "middleware" and no providers. magpie fetches it every few hours and keeps a copy built into the app for when it can't. To list a plugin, add an entry with its npm package, a name, providers (the provider ids it signs in to), an icon and a summary in English and Chinese ({"en": …, "zh": …}), and open a pull request.

A new package's first version is published by hand before its pull request is merged: npm's trusted publishing, which publishes every later version from main, can't create a package. A magpie-community npm owner runs scripts/publish.sh <otp> on the pull request's branch and sets .github/workflows/publish.yml as the package's Trusted Publisher on npmjs.com. The pull request's on-npm check fails until then.

S
Description
Magpie community plugins, including Kimi Work
Readme MIT
26 MiB
Languages
JavaScript 86.8%
TypeScript 10.5%
CSS 1.4%
HTML 1.2%