Manage Codex threads across providers with a macOS menu bar app and Rust CLI.
Codex Thread Manager 用来处理本机 ~/.codex 里的线程数据:
- 同步多个 provider 的线程副本
- 查看活跃 / 归档线程空间占用
- 清理已归档线程
- 修复 rollout 和线程元数据不一致
- 在同步和清理前自动备份
- 自动发现数据库里实际存在的 provider
同步全部 provider同步指定 provider...- 已归档线程清理预览与执行
- 菜单栏查看状态、空间占用和最近一次结果
- Rust CLI 支持
status-all、space、sync-all、sync-selected、cleanup
- macOS 13+
- Xcode Command Line Tools / Swift 6
- Rust stable toolchain
./scripts/install_bar_app.sh
open ~/Applications/CodexThreadManager.app默认安装位置:
~/Applications/CodexThreadManager.app
查看状态:
cargo run --manifest-path rust/codex_thread_manager/Cargo.toml --bin codex_thread_manager -- status-all查看空间占用:
cargo run --manifest-path rust/codex_thread_manager/Cargo.toml --bin codex_thread_manager -- space同步全部 provider:
cargo run --manifest-path rust/codex_thread_manager/Cargo.toml --bin codex_thread_manager -- sync-all同步指定 provider:
cargo run --manifest-path rust/codex_thread_manager/Cargo.toml --bin codex_thread_manager -- sync-selected \
--provider openai \
--provider cpa预览归档清理:
cargo run --manifest-path rust/codex_thread_manager/Cargo.toml --bin codex_thread_manager -- cleanup \
--scope archived \
--older-than-days 30 \
--keep-latest 20执行归档清理:
cargo run --manifest-path rust/codex_thread_manager/Cargo.toml --bin codex_thread_manager -- cleanup \
--scope archived \
--older-than-days 30 \
--keep-latest 20 \
--apply运行时会使用你本机 ~/.codex 下的文件:
state_5.sqliteprovider_sync_state.jsonprovider_sync.logprovider_sync_backups/
这些文件不属于仓库内容,不应该提交。
运行菜单栏应用:
swift run CodexThreadManager运行检查:
swift build --disable-sandbox
cargo fmt --manifest-path rust/codex_thread_manager/Cargo.toml --all --check
cargo test --manifest-path rust/codex_thread_manager/Cargo.tomlMIT