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-catpaw-auth

v1.3.2

Published

CatPaw AI provider plugin for OpenCode - Auto-auth from mcopilot-cli config

Downloads

33

Readme

@zu1k/opencode-catpaw-auth

npm version License: MIT

CatPaw AI provider plugin for OpenCode - Auto-auth from mcopilot-cli config

Features

  • Zero-config auth: Automatically loads API key from ~/.config/mcopilot-cli/.config.yaml
  • Multi-model support: LongCat-Flash-Chat, kimi-k2.5, glm-5, MiniMax-M2.5, claude-sonnet-4.5
  • Auto header injection: Automatically injects x-api-key and x-working-dir headers
  • OpenAI compatible: Uses @ai-sdk/openai-compatible adapter

Installation

Method 1: npm (Recommended)

Add the plugin to your OpenCode configuration:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@zu1k/opencode-catpaw-auth"]
}

Method 2: Local Development

git clone https://github.com/zu1k/opencode-catpaw-auth.git
cd opencode-catpaw-auth
bun install

Then use file:// protocol:

{
  "plugin": ["file:///absolute/path/to/opencode-catpaw-auth"]
}

Configuration

1. Ensure mcopilot-cli config exists

The plugin automatically reads the AUTHORIZATION field from ~/.config/mcopilot-cli/.config.yaml:

# ~/.config/mcopilot-cli/.config.yaml
AUTHORIZATION: "your-api-key-here"
# other configurations...

2. Connect Provider

Start OpenCode:

opencode

Run the connect command:

/connect

Select CatPaw AI provider, then choose "Auto-config from mcopilot-cli" auth method.

3. Select Model

/models

Choose from CatPaw AI models:

  • LongCat Flash Chat - Fast response
  • Kimi K2.5 - Long context support (256K)
  • GLM-5 - Zhipu AI model
  • MiniMax M2.5 - MiniMax model
  • Claude Sonnet 4.5 - Anthropic Claude (200K context)

Supported Models

| Model ID | Name | Context Length | Output Length | |---------|------|---------------|---------------| | LongCat-Flash-Chat | LongCat Flash Chat | 128K | 8K | | kimi-k2.5 | Kimi K2.5 | 256K | 8K | | glm-5 | GLM-5 | 128K | 8K | | MiniMax-M2.5 | MiniMax M2.5 | 128K | 8K | | claude-sonnet-4.5 | Claude Sonnet 4.5 | 200K | 8K |

Troubleshooting

1. Check config file

Ensure the config file exists and contains AUTHORIZATION:

cat ~/.config/mcopilot-cli/.config.yaml

2. Check plugin loading

View logs when starting OpenCode:

opencode --verbose

3. Test API manually

curl https://mcli.sankuai.com/v1/models \
  -H "x-api-key: $(grep AUTHORIZATION ~/.config/mcopilot-cli/.config.yaml | awk '{print $2}')" \
  -H "x-working-dir: $HOME"

Common Issues

Q: Plugin shows "Failed to load API key"

  • Check if ~/.config/mcopilot-cli/.config.yaml exists
  • Check if file contains AUTHORIZATION field
  • Check file permissions

Q: Empty model list

  • Ensure /connect was run and CatPaw AI was selected
  • Check network connection

Q: 401/403 errors

  • API key may be expired, try updating config file
  • Check if x-working-dir header is correct

Development

Project Structure

opencode-catpaw-auth/
├── index.ts          # Plugin entry
├── package.json      # Dependencies
├── tsconfig.json     # TypeScript config
├── src/
│   ├── plugin.ts     # Core plugin logic
│   ├── config.ts     # Config file reading
│   ├── request.ts    # Request handling
│   └── types.ts      # Type definitions
└── README.md

Local Testing

  1. Install dependencies:
bun install
  1. Type check:
bun run check
  1. Use file:// protocol in OpenCode config to reference local path

Scripts

bun run dev      # Development mode with watch
bun run check    # TypeScript type check
bun run clean    # Clean dependencies

How It Works

This plugin follows the OpenCode plugin architecture:

  1. Config Hook: Registers CatPaw as a provider with model definitions
  2. Auth Loader: Reads API key from mcopilot-cli config file
  3. Custom Fetch: Intercepts requests to mcli.sankuai.com and injects required headers

Inspired by opencode-gemini-auth.

License

MIT © zu1k

Links