| 🔄 Multi-CLI | Codex, Kiro, Gemini, Claude - all supported |
| ⚡ Real-time | Watch mode with system-level file monitoring |
| 🔢 Token Stats | Accurate counting using tiktoken (cl100k_base) |
| 🔍 Search | Find any conversation instantly |
| 📤 Export | JSON or CSV, your choice |
| 🚀 Zero Config | Auto-detects paths, just run it |
graph LR
subgraph Sources
A[~/.codex]
B[~/.kiro]
C[~/.gemini]
D[~/.claude]
end
subgraph Chat Vault
E[Watcher]
F[Parsers]
G[Storage]
end
subgraph Output
H[(SQLite DB)]
end
A --> E
B --> E
C --> E
D --> E
E --> F
F --> G
G --> H
sequenceDiagram
participant User
participant CLI as AI CLI (Codex/Kiro/...)
participant Watcher
participant Parser
participant DB as SQLite
User->>CLI: Chat with AI
CLI->>CLI: Save to local file
Watcher->>Watcher: Detect file change
Watcher->>Parser: Parse new content
Parser->>DB: Upsert session
DB-->>User: Query anytime
# Clone
git clone https://github.com/tukuaiai/vibe-coding-cn.git
cd vibe-coding-cn/libs/external/chat-vault
# Run (auto-installs dependencies)
./start.sh # Linux/macOS
start.bat # Windows
That's it! 🎉
==================================================
AI 聊天记录 → 集中存储
==================================================
数据库: ./output/chat_history.db
[Codex] 新增:1241 更新:0 跳过:0 错误:0
[Kiro] 新增:21 更新:0 跳过:0 错误:0
[Gemini] 新增:332 更新:0 跳过:0 错误:0
[Claude] 新增:168 更新:0 跳过:0 错误:0
==================================================
总计: 1762 会话, 40000+ 消息
✓ 同步完成!
=== Token 统计 (tiktoken) ===
codex: 11,659,952 tokens
kiro: 26,337 tokens
gemini: 3,195,821 tokens
claude: 29,725 tokens
总计: 14,911,835 tokens
| Command | Description |
|---|---|
python src/main.py |
Sync once |
python src/main.py -w |
Watch mode (real-time) |
python src/main.py --stats |
Show statistics |
python src/main.py --search "keyword" |
Search messages |
python src/main.py --export json |
Export to JSON |
python src/main.py --export csv --source codex |
Export specific source |
python src/main.py --prune |
Clean orphaned records |
chat-vault/
├── 🚀 start.sh / start.bat # One-click start
├── 📦 build.py # Build standalone exe
├── 📂 src/
│ ├── main.py # CLI entry
│ ├── config.py # Auto-detection
│ ├── storage.py # SQLite + tiktoken
│ ├── watcher.py # File monitoring
│ └── parsers/ # CLI parsers
├── 📂 docs/
│ ├── AI_PROMPT.md # AI assistant guide
│ └── schema.md # Database schema
└── 📂 output/
├── chat_history.db # Your database
└── logs/ # Sync logs
erDiagram
sessions {
TEXT file_path PK
TEXT session_id
TEXT source
TEXT cwd
TEXT messages
INTEGER file_mtime
TEXT start_time
INTEGER token_count
}
meta {
TEXT key PK
TEXT value
}
meta_codex {
TEXT key PK
TEXT value
}
Send docs/AI_PROMPT.md to your AI assistant for:
If this project helped you, consider supporting:
572155580TQtBXCSTwLFHjBqTS4rNUp7ufiGx51BReyHjYhozVf9AQmfv7yv79xSNs6uaEU5oUk2USasYQfUYau0xa396923a71ee7D9480b346a17dDeEb2c0C287BBC0xa396923a71ee7D9480b346a17dDeEb2c0C287BBCbc1plslluj3zq3snpnnczplu7ywf37h89dyudqua04pz4txwh8z5z5vsre7nlm0xb720c98a48c77f2d49d375932b2867e793029e6337f1562522640e4f84203d2eWe welcome all contributions! Feel free to open an Issue or submit a Pull Request.
MIT - Do whatever you want with it.