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-kimi-code-auth

v0.1.7

Published

OpenCode OAuth bridge for Kimi Code CLI

Readme

OpenCode Kimi OAuth Plugin

Use your existing Kimi CLI OAuth session directly inside OpenCode.

This plugin reads the token created by kimi login from ~/.kimi/credentials/kimi-code.json and wires it into OpenCode auth.

For Humans

What it does

  • Attaches to the built-in OpenCode provider moonshotai (no custom provider IDs).
  • Adds kimicode-* model aliases under moonshotai/ (e.g. moonshotai/kimicode-kimi-k2.5) that route to the Kimi Code API.
  • Uses the token created by kimi login at ~/.kimi/credentials/kimi-code.json, including automatic refresh.

Install

  1. Add this plugin in your OpenCode config (~/.config/opencode/opencode.json):
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    "opencode-kimi-code-auth@latest"
  ]
}
  1. Authenticate:
kimi login
opencode auth login
  1. In the picker:
  • Provider: Moonshot AI
  • Method: Kimi CLI OAuth
  1. Verify:
opencode auth list
opencode models moonshotai
opencode run --model moonshotai/kimicode-kimi-k2.5 "Say hello"

Troubleshooting

  • Only seeing Enter your API key:

    • Ensure config has "plugin": ["opencode-kimi-code-auth@latest"].
    • Re-run opencode auth login and choose Moonshot AI.
  • Kimi CLI is not authenticated:

    • Run kimi login, then retry opencode auth login.
  • Previously working setup starts failing with auth errors:

    • Your Kimi refresh token likely expired or was revoked.
    • Run kimi login once to renew the underlying Kimi CLI session.

For LLMs

Copy/paste this prompt into your coding agent:

Configure OpenCode on this machine to use Kimi OAuth via the published plugin.

Goal:
- Use Kimi CLI OAuth tokens in OpenCode for `moonshotai/kimicode-*` models (without adding a custom provider)

Rules:
- Never print credential values.
- Only modify config fields required for this setup.

Steps:
1. Validate tools:
   - Run: opencode --version
   - Run: kimi --version
2. Update OpenCode config:
   - File: ~/.config/opencode/opencode.json (or %USERPROFILE%\\.config\\opencode\\opencode.json on Windows)
   - Ensure plugin array includes this published package entry:
     "opencode-kimi-code-auth@latest"
   - Preserve other existing plugin entries (remove only local file paths/source-checkout plugin references).
3. Verify OpenCode starts cleanly with plugin enabled:
   - Run: opencode auth list
   - If this fails with plugin install/import errors, fix the plugin entry before continuing.
4. Do not attempt interactive auth in this session.
    - Ask the human to run: opencode auth login
    - Ask the human to choose provider `Moonshot AI` and method `Kimi CLI OAuth`, then confirm they saw `Login successful`.
5. Verify setup after user confirmation:
    - Run: opencode auth list
    - Run: opencode models moonshotai
    - Confirm output includes moonshotai/kimicode-kimi-k2.5
6. Return a concise report of changes and verification results.

Development

npm run typecheck
npm run build
npm pack --dry-run

Maintainer Release Flow (OIDC)

This repo uses GitHub Actions OIDC trusted publishing (no npm token in secrets).

One-time npm setup:

  1. Open npm package settings for opencode-kimi-code-auth.
  2. Add a Trusted Publisher for GitHub Actions:
    • Owner: Simplereally
    • Repository: opencode-kimi-code-auth
    • Workflow file: .github/workflows/release.yml
    • Environment: leave empty unless you explicitly configure one

Release steps:

  1. Update package.json version on main.
  2. Push main.
  3. Run workflow: Release (Actions tab, workflow_dispatch).

The workflow publishes to npm with provenance, creates a matching git tag, and creates a GitHub release from that exact main commit.

License

MIT. See LICENSE.