
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@aicodewith/ccstatusline
Advanced tools
AiCodeWith credits display plugin for Claude Code with customizable status line
🎯 Claude Code 专用 AI Code With 积分显示插件
在 Claude Code 终端实时显示 AI Code With 网站的月卡、加油包和今日消耗积分
简体中文 | English
今日消耗: 71500 | 月卡剩余: 0 | 月卡总额: 71500 | 加油包: 59880 | 总积分: 59880 | 使用率: 100.0% | 剩余率: 0.0% | 剩余: 0天 | 到期: 8/19 22:36 | 套餐: 独享 | 用户: 参宿四 | 邮箱: 1307398262@qq.com
一行命令,立即体验!
npx @aicodewith/ccstatusline
✨ 就是这么简单! 运行后将自动:
npx @aicodewith/ccstatusline
# 全局安装
npm install -g @aicodewith/ccstatusline
# 运行 TUI 配置界面
ccstatusline
# 或使用短命令
ccsl
git clone https://github.com/XiaoYanKongLing/AiCodeWith-ccstatusline.git
cd AiCodeWith-ccstatusline
npm install
这将自动安装所有依赖。
如果你更喜欢使用 bun(速度更快):
bun install
npm run build
这将在 dist 目录生成编译后的文件。
运行配置工具:
node dist/ccstatusline.js
在 TUI 中:
在 TUI 主菜单中:
或手动编辑 ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "node \"/path/to/AiCodeWith-ccstatusline/dist/ccstatusline.js\"",
"padding": 0
}
}
验证 Node.js 安装:
node --version # 应该是 v14.0.0 或更高
npm --version # 应该是 v6.0.0 或更高
# 克隆仓库
git clone https://github.com/XiaoYanKongLing/AiCodeWith-ccstatusline.git
cd AiCodeWith-ccstatusline
# 安装依赖
npm install
# 构建项目
npm run build
启动 TUI 配置界面:
node dist/ccstatusline.js
使用方向键导航并配置:
插件将 API 密钥安全存储在:
C:\Users\[用户名]\.config\ccstatusline\aicodewith\credentials.json~/.config/ccstatusline/aicodewith/credentials.json创建配置文件:
{
"apiKey": "你的API密钥"
}
```json
{
"email": "your-email@example.com",
"password": "base64编码的密码"
}
编码密码:
# Linux/macOS
echo -n "你的密码" | base64
# Windows PowerShell
[Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("你的密码"))
| 文件 | 用途 | 位置 |
|---|---|---|
settings.json | 主配置 | ~/.config/ccstatusline/ |
credentials.json | API 密钥配置 | ~/.config/ccstatusline/aicodewith/ |
full-data-cache.json | 完整数据缓存 | ~/.config/ccstatusline/aicodewith/ |
auth.json | 认证状态 | ~/.config/ccstatusline/aicodewith/ |
debug.log | 调试信息 | ~/.config/ccstatusline/aicodewith/ |
直接测试状态栏显示:
echo '{"model":{"display_name":"Claude 3.5 Sonnet"}}' | node dist/ccstatusline.js
预期输出(完整数据):
今日消耗: 71500 | 月卡剩余: 0 | 月卡总额: 71500 | 加油包: 59880 | 总积分: 59880 | 使用率: 100.0% | 剩余率: 0.0% | 剩余: 0天 | 到期: 8/19 22:36 | 套餐: 独享 | 用户: 参宿四 | 邮箱: 1307398262@qq.com
错误输出:
月卡: - | 加油包: - | 今日消耗: - (API错误)
月卡: - | 加油包: - | 今日消耗: - (网络错误)
月卡: - | 加油包: - | 今日消耗: - (离线)
echo '{"model":{"display_name":"Claude 3.5 Sonnet"},"transcript_path":"test.jsonl"}' | node dist/ccstatusline.js
插件在以下条件下自动刷新积分,默认每30秒,可通过环境变量调整:
可配置的环境变量:
Windows PowerShell 示例:
$env:CCSTATUSLINE_REFRESH_INTERVAL_MS = "30000"; $env:CCSTATUSLINE_API_TIMEOUT_MS = "8000"
bash 示例:
export CCSTATUSLINE_REFRESH_INTERVAL_MS=30000; export CCSTATUSLINE_API_TIMEOUT_MS=8000
说明:刷新管理器的提示文本会动态显示当前配置的间隔,不再固定显示“每30秒”。
rm ~/.config/ccstatusline/aicodewith/auth.jsoncat ~/.config/ccstatusline/aicodewith/debug.logrm ~/.config/ccstatusline/aicodewith/full-data-cache.jsonrm ~/.config/ccstatusline/aicodewith/refresh.locknpm run buildls dist/ccstatusline.js查看调试日志:
# 查看最近的获取尝试
tail -f ~/.config/ccstatusline/aicodewith/debug.log
# 检查错误日志
cat ~/.config/ccstatusline/aicodewith/error.log
# 监控缓存更新
watch -n 1 cat ~/.config/ccstatusline/aicodewith/full-data-cache.json
清除所有数据:
# 清除所有缓存和日志
rm -rf ~/.config/ccstatusline/aicodewith/*.json
rm -rf ~/.config/ccstatusline/aicodewith/*.log
AiCodeWith-ccstatusline/
├── src/
│ ├── ccstatusline.ts # 主入口点
│ ├── cli.js # CLI 包装器
│ ├── tui.tsx # React/Ink TUI 界面
│ ├── utils/
│ │ ├── config.ts # 设置管理
│ │ ├── aicodewith.ts # 积分显示逻辑
│ │ ├── claude-settings.ts # Claude 集成
│ │ ├── renderer.ts # 渲染器
│ │ └── aicodewith/
│ │ └── background-refresh.cjs # 后台刷新脚本
├── dist/ # 构建文件(生成)
├── patches/ # Ink 补丁文件
├── screenshots/ # 屏幕截图
├── package.json
├── tsconfig.json
├── build.cjs # 构建脚本
└── README.md # 本文件
# 开发模式运行(TUI 模式)
bun run src/ccstatusline.ts
# 生产构建
npm run build
# 使用示例数据测试
echo '{"model":{"display_name":"Claude 3.5"}}' | bun run src/ccstatusline.ts
# 监控调试日志
tail -f ~/.config/ccstatusline/aicodewith/debug.log
// 智能自动刷新检测
function shouldEnableAutoRefresh(): boolean {
if (process.env.CCSTATUSLINE_AUTO_REFRESH === '0') return false;
if (process.env.CCSTATUSLINE_AUTO_REFRESH === '1') return true;
const hasTTY = Boolean(process.stdin?.isTTY) || Boolean(process.stdout?.isTTY);
return hasTTY;
}
// 使用 unref() 的非阻塞定时器
refreshTimer = setInterval(() => {
fetchCreditsSync();
}, CACHE_TTL_MS);
refreshTimer.unref(); // 不阻止进程退出
// 防止并发获取
const lockPath = path.join(configDir, 'refresh.lock');
try {
const fd = fs.openSync(lockPath, 'wx'); // 独占创建
fs.closeSync(fd);
// 继续获取
} catch {
// 另一个进程正在获取
return getCachedCredits();
}
// 适用于 Windows、Linux 和 macOS
const configDir = path.join(
process.env.HOME || process.env.USERPROFILE || '',
'.config',
'ccstatusline',
'aicodewith'
);
如果这个项目帮助你显示 AI 积分,请给它一个 ⭐!
为 AI Code With 和 Claude Code 社区用 ❤️ 制作
FAQs
AiCodeWith credits display plugin for Claude Code with customizable status line
The npm package @aicodewith/ccstatusline receives a total of 29 weekly downloads. As such, @aicodewith/ccstatusline popularity was classified as not popular.
We found that @aicodewith/ccstatusline demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.