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-search

v0.1.0

Published

OpenCode plugin for Kimi Search + Fetch tools (ported from OpenClaw)

Downloads

152

Readme

opencode-kimi-search

An OpenCode plugin that provides kimi_search and kimi_fetch tools, ported from the original OpenClaw kimi-search plugin.

Features

  • kimi_search – Search the internet for latest information (news, docs, releases, blogs, papers).
  • kimi_fetch – Fetch a URL and extract main text content from the page.
  • Zero-config – Automatically inherits apiKey and baseURL from your existing Kimi For Coding provider configuration in OpenCode.

Installation

Option 1: Local plugin (fastest, no npm needed)

Copy the pre-built single-file bundle to your OpenCode plugins directory:

# For current project only
install -D -m644 dist/opencode-kimi-search.js /path/to/your/project/.opencode/plugins/opencode-kimi-search.js

# Or globally for all projects
install -D -m644 dist/opencode-kimi-search.js ~/.config/opencode/plugins/opencode-kimi-search.js

# Or download directly from GitHub (no clone needed)
curl -fsSL https://raw.githubusercontent.com/wszqkzqk/opencode-kimi-search/refs/heads/master/dist/opencode-kimi-search.js | \
  install -D -m644 /dev/stdin ~/.config/opencode/plugins/opencode-kimi-search.js

That's it. Restart OpenCode and the plugin is ready.

Option 2: npm plugin (recommended for sharing)

Add to your opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-kimi-search"]
}

OpenCode will automatically install it via Bun on next startup.

Option 3: Local file reference (for development)

Build the bundle, then reference it directly in opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["file:///absolute/path/to/opencode-kimi-search/dist/opencode-kimi-search.js"]
}

Configuration

Automatic inheritance from OpenCode Kimi For Coding

The plugin automatically reads your existing Kimi For Coding provider configuration, so in most cases no manual setup is required.

It looks for configuration in the following locations (in order):

  1. OpenCode auth file: ~/.local/share/opencode/auth.json
  2. OpenCode config files:
    • ~/.config/opencode/opencode.json (or .jsonc)
    • ~/.opencode/opencode.json (or .jsonc)
    • ./opencode.json (or .jsonc) in the current project

It recognizes provider IDs: kimi-for-coding, kimicoding, or kimi.

If your OpenCode config looks like this:

{
  "provider": {
    "kimi-for-coding": {
      "name": "Kimi For Coding",
      "npm": "@ai-sdk/anthropic",
      "options": {
        "baseURL": "https://api.kimi.com/coding/v1"
      }
    }
  }
}

The plugin will automatically:

  • Use options.apiKey as the API key (or fallback to auth.json)
  • Derive search URL as https://api.kimi.com/coding/v1/search
  • Derive fetch URL as https://api.kimi.com/coding/v1/fetch

Override with environment variables

You can override any auto-detected value via environment variables:

| Variable | Description | Priority | |----------|-------------|----------| | KIMI_PLUGIN_API_KEY | API key for Kimi search/fetch services. | Highest – overrides everything | | KIMI_SEARCH_BASE_URL | Full base URL for the search endpoint. | Highest – overrides provider config | | KIMI_FETCH_BASE_URL | Full base URL for the fetch endpoint. | Highest – overrides provider config | | KIMI_AGENT_USER_AGENT | User-Agent string for outgoing requests. | KimiCLI/OpenCodeKimiSearchPlugin | | KIMI_SEARCH_TIMEOUT_SECONDS | Timeout for search requests in seconds. | 30 | | KIMI_FETCH_ENABLED | Set to false to disable fetch service and always use HTTP fallback. | true |

Legacy fallback

If no OpenCode config is found, the plugin falls back to reading:

  • ~/.kimi/kimi-claw/kimi-claw-config.json (legacy bridge config)
  • Hardcoded defaults: https://api.kimi.com/coding/v1/search and https://api.kimi.com/coding/v1/fetch

Development

# Install dependencies
npm install

# Type-check and build
npm run build

# Bundle into single file for local plugin usage
npm run bundle

# Run tests
npm test

File structure

opencode-kimi-search/
├── src/
│   ├── index.ts              # Plugin entry (OpenCode Plugin format)
│   ├── logic.ts              # Search/fetch core logic
│   ├── config.ts             # Config resolver (reads OpenCode settings)
│   └── *.test.ts             # Unit tests
├── dist/
│   ├── index.js              # Compiled entry (npm package)
│   ├── logic.js              # Compiled logic
│   ├── config.js             # Compiled config
│   └── opencode-kimi-search.js  # ⭐ Single-file bundle (for local plugin)
├── package.json
├── tsconfig.json
└── README.md

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

See LICENSE for the full license text.