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-muse-code

v0.1.2

Published

Use a Muse Code (Meta) subscription in OpenCode

Readme

opencode-muse-code

npm version license

Use a Muse Code (Meta) subscription in OpenCode.

The plugin reads the login the muse CLI already stored on your machine, registers a muse-code provider that talks to https://api.meta.ai/v1, and discovers the available Muse models on startup and every 30 minutes. Model requests are metered by Meta against your Muse Code subscription — OpenCode needs no API key in its own configuration.

OpenCode  ──▶  https://api.meta.ai/v1  ──▶  Muse Code subscription
                    ▲
    minted API key from the muse CLI login

Features

  • Zero configuration once the muse CLI is signed in.
  • Live model discovery with real context/output limits, tool support, input types, and reasoning-effort variants.
  • Reads credentials from the macOS keychain (or ~/.config/muse/auth.json), with META_API_KEY / MUSE_API_KEY and an explicit key option as fallbacks.
  • Never writes credentials to OpenCode configuration or the repository.

Requirements

  • OpenCode V2 (tested on 2.0.8).
  • The muse CLI installed and signed in — run muse once if you have not.
  • An active Muse Code subscription. Check with the muse CLI or the Muse Code page.

Install

opencode plugin add opencode-muse-code

Or add it to the plugins list in opencode.jsonc yourself:

{
  "plugins": ["opencode-muse-code"]
}

Pin a version if you prefer:

{
  "plugins": ["[email protected]"]
}

Restart the service after changing configuration:

opencode service restart
git clone https://github.com/swalker326/opencode-muse-code.git
{
  "plugins": ["/absolute/path/to/opencode-muse-code"]
}

Or copy the folder to ~/.config/opencode/plugins/muse-code/, where plugin directories load automatically.

Use

Pick a model with /models in the TUI, or run one directly:

opencode run --model muse-code/muse-spark-1.3 "Summarize this repository"

Models

Models are discovered from Meta's catalog, so the list follows your account. Current models include:

| Model | Notes | | --- | --- | | muse-spark-1.3 | Newest general model | | muse-spark-1.3-contributor | Same model; content may be used for product improvement | | muse-spark-1.2 / muse-spark-1.2-contributor | Previous generation |

Reasoning effort

Append a variant to choose a reasoning effort:

opencode run --model muse-code/muse-spark-1.3#max "Plan this migration"

Variants: minimal, low, medium, high, xhigh, max. The default comes from the model metadata returned by Meta.

How it works

  1. Find the login. Credentials are resolved in order: the plugin key option, then META_API_KEY / MUSE_API_KEY, then the macOS keychain item ai.meta.dev.credentials (account meta), then ~/.config/muse/auth.json.
  2. Get an API key. It uses the stored API key, or mints one from the OAuth token by calling POST https://api.meta.ai/muse-code/key. Minting is idempotent: the same account always gets the same key back.
  3. Discover models. It reads GET https://api.meta.ai/muse-code/models, keeping tool-capable text models.
  4. Register the provider. OpenCode receives a provider definition with ID muse-code, the OpenAI-compatible runtime, endpoint https://api.meta.ai/v1, the minted key, and one model entry per Muse model. Variants map to the reasoning_effort request field.
  5. Stay fresh. Every 30 minutes it re-reads the login, re-fetches the catalog, and reloads the provider. On unload it stops the timer and removes its registration.

If the credential lookup or the first catalog fetch fails, the plugin still lists a fallback model and logs a warning; the next refresh repairs it.

Options

Pass a key explicitly instead of reading the CLI login:

{
  "plugins": [{ "package": "opencode-muse-code", "options": { "key": "..." } }]
}

| Option | Type | Description | | --- | --- | --- | | key | string | Muse API key. Wins over every other credential source. |

| Environment variable | Description | | --- | --- | | META_API_KEY | Muse API key (the variable the muse CLI itself understands) | | MUSE_API_KEY | Alias, checked second |

Troubleshooting

| Symptom | Fix | | --- | --- | | Unauthorized | Run muse and sign in again, then opencode service restart. Make sure no stale stored account is shadowing the plugin. | | Models missing | The first refresh failed; check network access to api.meta.ai and restart the service. A fallback model list is registered meanwhile. | | Models missing on Linux | Muse CLI credential storage differs by platform. Set META_API_KEY or use the key option. | | Keychain prompt on macOS | Approve the request once; OpenCode reads the same keychain item the muse CLI created. |

Security and privacy

  • Credentials are read from the operating system credential store at runtime; they are never written to OpenCode config files, repositories, or logs.
  • The plugin talks only to https://api.meta.ai — the same endpoint the muse CLI uses.
  • No telemetry is collected by the plugin.

Compatibility

| Platform | Credential source | | --- | --- | | macOS | Login keychain (ai.meta.dev.credentials) | | Linux | ~/.config/muse/auth.json, META_API_KEY, or the key option | | Windows | META_API_KEY or the key option |

Disclaimer

This is an unofficial community plugin. It is not affiliated with, endorsed by, or supported by Meta or the OpenCode team. Muse Code and Muse Spark are trademarks of Meta. Use at your own risk and follow the terms of your Muse Code subscription.

Contributing

Issues and pull requests are welcome at swalker326/opencode-muse-code.

License

MIT