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

@rousan/ccal

v1.3.0

Published

Claude Code Adapter for LLMs — an OpenAI-compatible HTTP server that proxies to the local `claude` CLI.

Readme


ccal ("Claude Code Adapter for LLMs") is a small, standalone HTTP server that proxies OpenAI-compatible requests to your local claude CLI. It lets any OpenAI-style client — an SDK, a chat UI, curl, or an app like Warren — talk to your Claude subscription as if it were a regular model endpoint.

Under the hood it shells out to claude -p --output-format stream-json ... and translates the CLI's streaming output into OpenAI Server-Sent Events.

Why

  • Use your Claude Code subscription anywhere. ccal does not call the Anthropic API directly — it drives the CLI you already have logged in, so no extra API key or billing is involved.
  • Drop-in OpenAI compatibility. Point any OpenAI client at http://127.0.0.1:8787/v1 and it just works — models, chat completions, streaming.
  • Local and simple. Binds to localhost by default, no daemon, no config files. One command starts it.

Requirements

  • Node 20+
  • The claude CLI installed and logged in. ccal drives your local Claude Code, so your normal Claude Code auth/subscription is what's used. Install it from https://docs.claude.com/claude-code and run claude once to sign in.

Install & usage

No install required — run it straight from npm:

npx @rousan/ccal serve --port 8787

You should see something like:

ccal listening on http://127.0.0.1:8787
OpenAI-compatible base URL: http://127.0.0.1:8787/v1
Using claude CLI at /Users/you/.local/bin/claude (2.x.x ...)

The OpenAI-compatible base URL is:

http://127.0.0.1:8787/v1

The API key is ignored (auth is handled by your local claude login), so any placeholder works.

Use with any OpenAI client

curl (streaming):

curl -N http://127.0.0.1:8787/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "sonnet",
    "stream": true,
    "messages": [{ "role": "user", "content": "Say hello in one word." }]
  }'

OpenAI Python SDK:

from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8787/v1", api_key="ccal")
resp = client.chat.completions.create(
    model="sonnet",
    messages=[{"role": "user", "content": "Say hello in one word."}],
)
print(resp.choices[0].message.content)

Warren (or any app with an OpenAI-compatible provider setting): add a custom provider with base URL http://127.0.0.1:8787/v1, any API key, and pick one of sonnet / opus / haiku as the model.

Endpoints

  • GET /health{ "ok": true }
  • GET /v1/models → the OpenAI model list. Three ids are advertised, matching the claude CLI's --model aliases: sonnet, opus, haiku.
  • POST /v1/chat/completions → OpenAI-compatible chat completions. Supports both stream: true (SSE data: {choices:[{delta:{content}}]} frames terminated by data: [DONE]) and the non-streaming case (a single assembled choices[0].message.content). Images work too: include image_url content parts (a data: base64 URL or a remote http(s) URL) and they are forwarded to claude as image blocks for the vision models to see.

How messages map to the CLI

  • system messages are combined and passed to claude via --append-system-prompt (appended to the default agent prompt, so tool use still works).
  • user / assistant messages are flattened into a single text transcript sent on stdin. A lone message is sent verbatim; a multi-turn conversation is rendered as a User: / Assistant: labeled transcript. This is one prompt in, one response out — claude's streaming JSON output is translated back into OpenAI chunks (assistant text plus compact one-line notes for any tool calls).

Commands

ccal serve [options]   Start the OpenAI-compatible server
ccal update            Update ccal to the latest published version
ccal version           Print the installed version (also: --version, -v)

Configuration

ccal serve [options]

  --port <n>              Port to bind (default: 8787)
  --host <addr>           Host to bind (default: 127.0.0.1)
  --cwd <dir>             Working directory for the claude process
  --permission-mode <m>   Permission mode passed to claude (non-default only)
  --help                  Show this help
  • --cwd controls where claude runs, which determines the tools, MCP servers, and CLAUDE.md it loads.
  • CCAL_CLAUDE_PATH (environment variable) forces a specific claude binary when auto-detection does not find the right one.

Documentation

License

MIT © Rousan Ali