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

@openplaw/openclash

v0.1.4

Published

ACP to OpenAI protocol conversion gateway - expose ACP agents as OpenAI-compatible API endpoints

Readme

OpenClash

ACP to OpenAI protocol conversion gateway. Expose ACP-based agents (like Cursor Agent, Qoder CLI) as OpenAI-compatible API endpoints.

What it does

OpenClash acts as a bridge between the Agent Client Protocol (ACP) and the OpenAI Chat Completions API. It spawns ACP agent subprocesses, manages their lifecycle, and translates incoming OpenAI-format requests into ACP sessions — allowing any tool that speaks the OpenAI API to use ACP agents.

Install

npm install @openplaw/openclash

Usage

As a standalone gateway

  1. Create a config file at ~/.config/openclash/openclash.json:
{
  "server": {
    "port": 8080,
    "host": "0.0.0.0"
  },
  "providers": {
    "cursor-acp": {
      "name": "Cursor Agent (ACP)",
      "type": "acp",
      "options": {
        "command": "agent",
        "args": ["acp"],
        "env": {}
      },
      "models": {
        "auto": {
          "id": "auto",
          "name": "Cursor Auto",
          "limit": { "context": 200000, "output": 16384 }
        },
        "claude-opus-4-6": {
          "id": "claude-opus-4-6",
          "name": "Claude Opus 4.6",
          "limit": { "context": 200000, "output": 16384 }
        }
      }
    },
    "qoder-acp": {
      "name": "Qoder CLI (ACP)",
      "type": "acp",
      "options": {
        "command": "qodercli",
        "args": ["--acp"],
        "env": {
          "QODER_PERSONAL_ACCESS_TOKEN": "your-token"
        }
      },
      "models": {
        "auto": {
          "id": "auto",
          "name": "Qoder Auto",
          "limit": { "context": 200000, "output": 16384 }
        },
        "ultimate": {
          "id": "ultimate",
          "name": "Qoder Ultimate",
          "limit": { "context": 200000, "output": 16384 }
        }
      }
    }
  }
}
  1. Start the gateway:
npx openclash start
# or with debug logging:
npx openclash start --log-level debug
  1. Send requests using the OpenAI API format:
curl http://localhost:8080/cursor-acp/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4-6",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

As an OpenCode plugin

Add to your opencode.json:

{
  "plugin": ["@openplaw/openclash@latest"]
}

The plugin reads the same config file (~/.config/openclash/openclash.json) and starts the gateway automatically in the background. Then configure providers in opencode.json pointing to the local gateway:

{
  "provider": {
    "cursor-acp": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Cursor (via OpenClash)",
      "options": {
        "baseURL": "http://localhost:8080/cursor-acp/v1"
      },
      "models": {
        "claude-opus-4-6": {
          "name": "Claude Opus 4.6",
          "limit": { "context": 200000, "output": 16384 }
        }
      }
    }
  }
}

Configuration

| Field | Description | |-------|-------------| | server.port | Gateway port (default: 8080) | | server.host | Gateway host (default: 0.0.0.0) | | providers.<id>.name | Display name | | providers.<id>.type | Always "acp" | | providers.<id>.apiKey | Optional Bearer token for per-provider auth | | providers.<id>.options.command | ACP agent binary path | | providers.<id>.options.args | Arguments passed to the agent | | providers.<id>.options.env | Environment variables for the subprocess | | providers.<id>.models | Available models with context/output limits |

Config file location (in priority order):

  1. OPENCLASH_CONFIG environment variable
  2. ~/.config/openclash/openclash.json

CLI Commands

openclash start       Start the gateway server
openclash config      Print resolved configuration
openclash keygen      Generate an apiKey for a provider
openclash version     Print version

Features

  • Streaming (SSE) and non-streaming responses
  • Per-provider Bearer token authentication
  • Automatic model matching (fuzzy match for short aliases)
  • Provider initialization with auto-reconnect
  • OpenCode plugin mode (auto-start with TUI, auto-shutdown on exit)

License

MIT