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

v1.0.4

Published

OpenCode plugin that rewrites bash tool calls through Hypa for local, deterministic output compression.

Readme

opencode-hypa

Hardwire Hypa into OpenCode — no MCP required.

npm CI License: MIT

OpenCode plugin that intercepts bash / shell tool calls and rewrites them through hypa rewrite --json before execution. Noisy command output is compressed locally and deterministically — the same hardwire pattern Hypa uses for Claude, Codex, and Pi.

OpenCode bash tool call
        ↓
  opencode-hypa plugin
        ↓
   hypa rewrite --json
        ↓
hypa git … / hypa -c "…"
        ↓
errors · warnings · failing tests · exit codes

Install

opencode plugin opencode-hypa --global

Or add to ~/.config/opencode/opencode.json / opencode.json:

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

Requirements

  • OpenCode with plugin support
  • Node.js 18+ (or Bun) for the plugin runtime
  • Hypa available via PATH, or installed as this package’s dependency (@hypabolic/hypa)

What it does

| Hypa outcome | Plugin behavior | |---|---| | Rewritten / GenericWrapper | Replaces the bash command with Hypa’s rewritten form | | Passthrough | Leaves the original command alone | | Deny | Blocks the tool call | | Ask | Blocks by default; set OPENCODE_HYPA_ASK_NON_INTERACTIVE=allow to proceed | | Rewrite error / timeout | Fails open — runs the original command |

Commands that already start with hypa are never double-wrapped.

Agent visibility

When Hypa rewrites a command, OpenCode would otherwise hand the LLM a tool result whose title shows the rewritten command (hypa git log …) with no marker that a plugin changed it. The LLM can misread the prefix as its own typo. To prevent that, this plugin also registers tool.execute.after and annotates the tool result with a one-line note:

[hypa Rewritten] git log --oneline -10 => hypa git log --oneline -10

The note is prepended to both output.title and output.output, and the full record is written to output.metadata.hypaRewrite. Non-rewritten outcomes (passthrough / skipped / error) leave the tool result untouched.

Configuration

Set options in opencode.json as the second element of a nested plugin tuple (string | [name, options] — one array item, not a string plus a sibling object), or override any field with an environment variable (env wins over options).

{
  "plugin": [
    [
      "opencode-hypa",
      {
        "binary": "hypa",
        "rewriteTimeoutMs": 5000,
        "askNonInteractive": "deny",
        "enabled": true
      }
    ]
  ]
}

| Option (PluginOptions) | Env var | Default | Description | |---|---|---|---| | binary | OPENCODE_HYPA_BIN | hypa (PATH / bundled) | Hypa executable or absolute path | | rewriteTimeoutMs | OPENCODE_HYPA_REWRITE_TIMEOUT_MS | 5000 | Timeout for hypa rewrite --json | | askNonInteractive | OPENCODE_HYPA_ASK_NON_INTERACTIVE | deny | allow or deny when Hypa returns Ask | | enabled | OPENCODE_HYPA_ENABLED | true | Set false / 0 to disable the plugin |

Diagnostics

In the OpenCode TUI, run /hypa to open a modal with:

  • whether the plugin is enabled
  • resolved Hypa binary path and whether it exists
  • installed Hypa version (hypa --version, cached at TUI load)
  • effective config for each field with source tag (env, options, or default)
  • the last rewrite (input, command, outcome, timestamp) or none

Re-open /hypa to refresh the snapshot after config or rewrite changes.

Why not MCP?

hypa serve works as an MCP server, but the model has to choose those tools. This plugin rewrites every bash call automatically — the integration that actually saves context.

Development

npm install
npm test
npm run build

CI keeps a fast lockfile job on Node 18 and 22. A separate opencode-latest job (push/PR and weekly) installs @opencode-ai/plugin@latest from npm — the same version OpenCode publishes for the CLI (opencode-ai / GitHub Releases) — and re-runs typecheck, tests, the rewrite/hook smoke, and a real OpenCode bash-dispatch smoke (POST /session/:id/shell, with a dummy-model fallback because /shell does not invoke tool.execute.before).

Publishing

Releases publish to npm via Trusted Publishers (GitHub OIDC). No long-lived npm token is stored in the repo.

  1. On npm: opencode-hypa → Settings → Trusted Publisher
  2. Add GitHub with:

| Field | Value | |---|---| | Organization or user | kipyin | | Repository | opencode-hypa | | Workflow filename | publish.yml | | Environment | (leave empty) |

  1. Publish a GitHub Release (vX.Y.Z), or run the publish workflow manually.

Related

License

MIT