
# ChatCrystal
**Crystallize knowledge from your AI conversations**
[](https://www.npmjs.com/package/chatcrystal)
[](https://github.com/ZengLiangYi/ChatCrystal)
[](https://github.com/ZengLiangYi/ChatCrystal/blob/main/LICENSE)
---
ChatCrystal collects conversations from 32 AI coding agent harnesses (Claude Code, Claude Desktop, Codex CLI, Cursor, Trae, GitHub Copilot Chat and CLI, Gemini CLI, Qwen Code, OpenCode, Cline, Roo Code, Kilo Code, Continue, DeepSeek Harness, WorkBuddy, CodeBuddy, Antigravity, Droid, Goose, Pi, omp, Raft, Cindy, Qoder/Qoder CN, ZCode, Hermes, Alma, Grok Build, Kimi Code, MiniMax Code — locally and from WSL distros on Windows), uses LLM to distill them into searchable structured notes, and builds your personal knowledge base.
## Install
```bash
npm install -g chatcrystal
```
Requires Node.js >= 20 and an LLM service ([Ollama](https://ollama.ai/), OpenAI, [OrcaRouter](https://www.orcarouter.ai/ref/ref_67516d927343232775e2), Anthropic, Google AI, or any OpenAI-compatible API).
## Quick Start
```bash
crystal import # Scan and import AI conversations
crystal summarize --all # Batch summarize into notes
crystal search "React state" # Semantic search your knowledge
```
The server auto-launches in background on first command. No manual setup needed.
## Cloud Connection
For a Docker cloud instance, save the shared token once:
```bash
crystal connect https://chatcrystal.example.com --token "your-long-token"
crystal import --yes
```
`crystal import` still scans and parses histories on the local device, then uploads normalized conversations to the cloud instance. The cloud server does not scan your local filesystem. `crystal mcp` reuses the same saved connection and token.
HTTPS is recommended for cloud connections, but HTTP works when that is the deployment you choose.
To manage a Docker cloud token:
```bash
# Rotate when you still know the current token.
crystal --base-url https://chatcrystal.example.com token rotate "new-long-token-at-least-16-chars" --current "old-token"
# Reset stored auth from the Docker host when the token is lost.
docker compose exec chatcrystal crystal token reset --yes
docker compose exec chatcrystal cat /data/setup-code
```
If `CHATCRYSTAL_API_TOKEN` is set in the deployment environment, change that environment variable and recreate the container instead of using `token reset`.
## CLI Commands
```bash
# Knowledge retrieval
crystal search