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

ccapi-cli

v0.0.6

Published

CLI tool to launch Claude Code as an HTTP API via pm2

Readme

ccapi-cli

English

ccapi 的 CLI 工具。在任意 workspace 目录下执行 ccapi start,即可通过 pm2 启动一个由 Claude Code 驱动的 HTTP API。

安装

npm install -g ccapi-cli

快速开始

1. 创建 workspace 目录并编写系统提示词:

my-api/
├── CLAUDE.md          # 在这里定义 Claude 的行为
└── .claude/
    └── settings.json  # 可选:限制 Claude 可用的工具

翻译 API 的 CLAUDE.md 示例:

你是一个专业翻译引擎。

规则:

- 只输出译文,不要解释、不要注释
- 自动检测源语言
- 默认翻译为中文,如果源语言是中文则翻译为英文
- 保持原文格式(markdown、代码块等)

2. 启动服务:

cd my-api
ccapi start
# 首次启动会询问端口,之后自动保存到 ccapi.json

3. 调用 API:

curl -X POST http://localhost:3000 -H 'Content-Type: application/json' -d '{"prompt": "Hello World"}'
# {"result":"你好世界","cost":0.001,"duration_ms":1234}

命令

| 命令 | 说明 | | --------------- | ----------------- | | ccapi start | 通过 pm2 启动服务 | | ccapi stop | 停止服务 | | ccapi restart | 重启服务 | | ccapi logs | 查看日志 | | ccapi status | 查看 pm2 状态 | | ccapi delete | 从 pm2 移除 |

配置

首次 ccapi start 时会询问端口号,配置保存到 workspace 目录下的 ccapi.json,后续启动直接复用。

{
  "port": 3000,
  "maxTurns": 1,
  "timeoutMs": 60000
}

示例

参考 examples/ 目录,里面有可直接使用的 workspace 配置。