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

52token-cli

v1.2.0

Published

52Token 配置工具 - Claude Code / Codex / OpenClaw 一键配置 (默认 API: https://52token.online, 教程: https://doc.52token.online/)

Downloads

49

Readme

52Token CLI

🚀 52Token AI 工具一键配置工具

一行命令自动配置 Claude Code / Codex / OpenClaw,无需手动填写任何配置。

  • 📦 默认 API 地址:https://52token.online
  • 📚 教程文档:https://doc.52token.online/

快速开始

npx 52token-cli

需要 Node.js 16+,如未安装请先 下载 Node.js

功能

  • 🧠 Claude Code - 一键配置 Anthropic Claude 编程助手
  • 🤖 Codex - 一键配置 OpenAI Codex 代码生成
  • 🔧 OpenClaw - 一键配置开源 AI 代码助手
  • 🌐 智能线路 - 国内/国外线路自动选择
  • 零依赖 - 纯 Node.js 实现,无需额外安装

使用方式

交互式配置(推荐)

npx 52token-cli

按提示依次输入:

  1. 卡密 (API Key)
  2. 选择服务 (Claude / Codex / OpenClaw)
  3. 选择线路 (国内 / 国外)

查看帮助

npx 52token-cli --help

诊断环境(Node / npm / 已装工具 / 环境变量)

npx 52token-cli --doctor

非交互模式(自动回答 YES)

npx 52token-cli --yes

跳过自动安装

npx 52token-cli --no-install

查询额度

npx 52token-cli --quota

✨ v1.2.0 新功能

  • 🔍 自动检测 目标 CLI 是否已安装(在服务选择列表中直接显示 [已安装] / [未安装]
  • 📦 自动安装 未安装的工具(Claude Code / Codex → npm,OpenClaw → pip)
  • 🧹 ENOTEMPTY 自愈 自动清理 npm 残留目录,避免安装失败
  • 🩺 --doctor 一键诊断:Node/npm/Python/各 CLI/环境变量状态
  • 🔄 完成后给出 一行命令 立即生效:source ~/.zshrc && claude

API 地址

| 服务 | 国内线路 | 国外线路 | |------|---------|---------| | Claude | https://52token.online | https://52token.online | | Codex | https://52token.online | https://52token.online | | OpenClaw | https://52token.online | https://52token.online |

手动配置

如果你更喜欢手动配置,可以设置以下环境变量:

Claude Code

export ANTHROPIC_BASE_URL="https://52token.online"
export ANTHROPIC_API_KEY="你的卡密"

Codex

export OPENAI_BASE_URL="https://52token.online"
export OPENAI_API_KEY="你的卡密"

OpenClaw

export OPENCLAW_API_BASE="https://52token.online"
export OPENCLAW_API_KEY="你的卡密"

系统支持

  • ✅ macOS (Intel / Apple Silicon)
  • ✅ Linux (x64 / arm64)
  • ✅ Windows (x64 / arm64)

常见问题

Q: 运行后提示权限不足? A: macOS/Linux 用户请使用 sudo npx 52token-cli

Q: 配置后 claude 命令不生效? A: 请重新打开终端,或运行 source ~/.zshrc(或对应的 shell 配置文件)

Q: 如何更换 Key? A: 重新运行 npx 52token-cli 即可自动覆盖旧配置(会识别并移除旧块)

Q: 配置后 claude 提示 command not found? A: v1.2.0 起会自动检测并提示安装;如仍有问题,先运行 npx 52token-cli --doctor 查看环境诊断。

Q: npm 安装报 ENOTEMPTY: directory not empty A: 这是之前安装被中断留下的残留。v1.2.0 已内置自愈逻辑,会自动清理并重试。若仍失败,可手动执行:

npm root -g   # 查看全局 node_modules 路径
rm -rf <上面路径>/@anthropic-ai/.claude-code-*
rm -rf <上面路径>/@anthropic-ai/claude-code
npm install -g @anthropic-ai/claude-code

Q: 我改了本地代码,为什么 npx 52token-cli 还在跑老版本? A: npx 会缓存远程包,本地测试请运行 node /path/to/52token-cli/index.js,或清 npx 缓存:rm -rf ~/.npm/_npx

教程文档

访问 52Token 教程站 获取完整教程。

License

MIT