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

@coma111/ccapi

v0.1.0

Published

One-click Codex environment setup for NewAPI-compatible channels

Readme

NewAPI Codex Env Installer

这是一个面向 NewAPI 兼容渠道的 Codex 环境一键配置工具。

当前 npm 包名:@coma111/ccapi 当前命令名:ccapi

现在的逻辑

当前版本采用全局直写模式:

  1. 直接写 ~/.codex/config.toml
  2. 直接写 ~/.codex/auth.json
  3. 覆盖前自动生成 .bak
  4. config.toml 使用自定义 provider
  5. auth.json 写入:
{
  "OPENAI_API_KEY": "用户输入的 key"
}

当前行为

只做了两处必要参数化:

  1. base_url
    • 使用用户输入的 Base URL
    • 自动规范成 .../v1
  2. provider
    • 默认使用 newapi
    • 也支持通过 --provider 自定义

生成的 config.toml 结构

脚本会写成下面这种结构:

cli_auth_credentials_store = "file"
model_provider = "newapi"
model = "gpt-5.4"
model_reasoning_effort = "high"
disable_response_storage = true
preferred_auth_method = "apikey"

[model_providers.newapi]
name = "newapi"
base_url = "https://your-newapi.example.com/v1"
wire_api = "responses"
requires_openai_auth = true

[features]
apps = false

使用方式

cd installer/codex-env
node cli.js \
  --api-key sk-your-newapi-key \
  --base-url https://your-newapi.example.com

发布到 npm 后可直接这样用:

npx @coma111/ccapi --api-key sk-your-newapi-key --base-url https://your-newapi.example.com

可选指定模型:

node cli.js \
  --api-key sk-your-newapi-key \
  --base-url https://your-newapi.example.com \
  --model gpt-5.4

可选指定 provider 名:

node cli.js \
  --api-key sk-your-newapi-key \
  --base-url https://your-newapi.example.com \
  --provider my_newapi

当前定位

这版是最小可用版,适合先验证:

  1. 当前 newapi 渠道对 Codex 是否能直接跑通
  2. base_url=/v1 的兼容性是否正常
  3. 用户本地的 Codex 配置是否能被这种方式稳定接管

如果你后面确认这条路没问题,再往里加:

  1. 自动安装 @openai/codex
  2. 隐藏输入 API Key
  3. 交互式 prompts
  4. Windows 兼容增强