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

v0.1.2

Published

OpenCode plugin and OpenTUI review CLI for collecting fine-tuning datasets.

Readme

opencode-dataset

Capture OpenCode agent sessions into a local JSONL dataset, review examples in an OpenTUI terminal UI, and export to the formats LLM researchers actually use.

Fast path

Install once:

opencode plugin opencode-dataset

Add the plugin to opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    [
      "opencode-dataset",
      {
        "datasetPath": ".opencode/datasets/opencode-dataset.jsonl"
      }
    ]
  ]
}

The older opencode-dataset-plugin package name also works, but opencode-dataset is the shorter recommended name.

OpenCode installs npm plugins with Bun at startup. Captured records are written as newline-delimited JSON so they are easy to diff, stream, and load with Hugging Face Datasets:

from datasets import load_dataset

dataset = load_dataset("json", data_files=".opencode/datasets/opencode-dataset.jsonl")

What It Captures

  • Tool calls with redacted args/output
  • Session diffs and edited file paths
  • Message and message-part events
  • Permission ask/reply records
  • Explicit high-quality examples through the save_training_example tool

Secrets are redacted before storage for common API keys, bearer tokens, GitHub tokens, AWS access keys, JWTs, private keys, and sensitive object keys like password, token, secret, and authorization.

Review

Run the OpenTUI review surface:

bunx opencode-dataset review --path .opencode/datasets/opencode-dataset.jsonl

When there are pending records, the TUI starts in pending review mode. When everything is already accepted or rejected, it opens in all-records mode so you can still inspect the dataset.

Keys:

  • j / k: move
  • a: accept
  • r: reject
  • t: toggle pending/all records
  • q: quit

For CI or quick checks:

bunx opencode-dataset review --once --path .opencode/datasets/opencode-dataset.jsonl

Export

Accepted records export by default. Add --include-pending when you want a quick raw dump before review.

bunx opencode-dataset export --format openai --path .opencode/datasets/opencode-dataset.jsonl > train.openai.jsonl
bunx opencode-dataset export --format alpaca --path .opencode/datasets/opencode-dataset.jsonl > train.alpaca.jsonl
bunx opencode-dataset export --format sharegpt --path .opencode/datasets/opencode-dataset.jsonl > train.sharegpt.jsonl
bunx opencode-dataset export --format dpo --path .opencode/datasets/opencode-dataset.jsonl > train.dpo.jsonl

Formats:

  • canonical: raw plugin records
  • openai: { "messages": [{ "role": "user" }, { "role": "assistant" }] }
  • alpaca: { "instruction", "input", "output" }
  • sharegpt: { "conversations": [{ "from": "human" }, { "from": "gpt" }] }
  • dpo: { "prompt", "chosen", "rejected" }

Agent Tool

The plugin registers save_training_example. Ask OpenCode to call it after a good completed task:

Save this as a training example with tags ["typescript", "bugfix"].

The saved record is marked accepted immediately, so it exports without needing review.

Local Development

bun install
bun run build
bun run typecheck
bun test
bun run demo
bun run review -- --once
bun run export:openai

bun run demo appends a sample accepted record to .opencode/datasets/opencode-dataset.jsonl.