AI 自动化 / 安全研究 / 本地工具链 AI automation · security research · local tooling
做的东西大多围绕一件事:让本机的 AI 工具链更省心 —— 把散落的数据、配置、模型调用统一起来, 顺手把过程中的坑记下来。
| 项目 | 说明 | 技术 |
|---|---|---|
| cc-switch-hermes-usage | 把 Hermes Agent 的 token 用量同步进 CC Switch 的「使用统计」页。读 Hermes 本地累计计数器,转成增量写进 CC Switch 统计库,token 总量准确。附带 opencode skill 与 4 个用例的单测 | Python(仅标准库)· SQLite |
这些都是别人做的,我 fork 下来做本地部署 / 二次修改。版权归原作者,成果不归我, 所以不列在上面的项目表里。
| 项目 | 原作者做什么 |
|---|---|
| qoder2api | 把 Qoder 转成 OpenAI/Claude/Codex 兼容 API |
| workbuddy2api | 把 CodeBuddy / WorkBuddy 变成 OpenAI 兼容 API |
| autoclaw2api | AutoClaw 移动端 → OpenAI 兼容 API(Python) |
| dunhuang-aura-skill | 敦煌风格 skill |
| freesub | 订阅管理 |
我对 fork 仓库的改动主要是本地部署、账号/代理适配和跨平台问题修复。 值得合并的改动我会提 PR 回上游 —— 详见下面的「参与开源」。
- chunai-bboy.github.io — 个人站点
关注 CC Switch(13.8k star 的 AI 编程工具切换器):
- 它是「统计多个 AI 工具的 token 用量」这类需求的最佳载体,本项目的 skill 就是给它用的
- 官方暂未支持 Hermes Agent;我的 cc-switch-hermes-usage 是 用户侧的解法,不侵入它的代码
- 官方已有 PR #6120 在做这件事,
我的实现读的是
session_model_usage(按(会话, 模型, 任务)分行), 正好绕开了维护者当年放弃该功能时提到的「模型字段锁定为初始模型」问题。 两套方案并存,若官方合入,本项目降级为「仅验证」
所有自写项目放在 D:\GitHub\<项目名>\,一条仓库一个文件夹,每个都自带
README.md + LICENSE + .gitignore。第三方项目和大型构建目录留在
D:\security-research\projects\(不入库)。
欢迎提 issue 或 PR,尤其是:
- 同步脚本的边界情况:计数器重置、会话过期清理、跨版本 schema 变更
- 准确性验证:如果你发现 token 统计对不上,请附上你的
state.db计数对比
Building things around one theme: making a local AI toolchain less painful — unifying scattered data, config and model calls, and writing down the pitfalls along the way.
- cc-switch-hermes-usage — Syncs Hermes Agent token usage into the CC Switch usage dashboard. Reads Hermes' local cumulative counters, converts them to deltas, and writes into CC Switch's stats database so token totals are accurate. Ships as an opencode skill with 4 unit tests. Python (stdlib only) · SQLite
qoder2api · workbuddy2api · autoclaw2api · dunhuang-aura-skill · freesub
These belong to their original authors. My changes are local deployment, account and proxy adaptation, and cross-platform fixes. Changes worth upstreaming go out as PRs.
Following CC Switch (a 13.8k-star
provider switcher for AI coding tools) — the best host for "track token usage
across AI tools". It has no official Hermes Agent support yet, so my
cc-switch-hermes-usage is a user-side solution that doesn't touch its code.
Upstream PR #6120 is doing the same thing natively; my implementation reads
session_model_usage (keyed per session × model × task), which sidesteps the
"model field locked to the initial model" problem that made the maintainer drop
this feature once. Both can coexist.
Self-written projects live in D:\GitHub\<project>\ — one folder per repo, each
with README.md + LICENSE + .gitignore. Third-party projects and large build
directories stay in D:\security-research\projects\ (not version-controlled).
Issues and PRs welcome, especially around: counter resets, expired-session
cleanup, cross-version schema changes, and accuracy reports — if your token
totals don't match, please attach a comparison against your state.db counters.
MIT licensed unless stated otherwise.