@benryoung/cli-chat-exporter
v0.3.0
Published
Local CLI and scheduler for exporting AI chat histories to Markdown and HTML
Maintainers
Readme
CLI Chat Exporter
CLI Chat Exporter provides the cce command for exporting local AI assistant chat histories to readable Markdown and HTML archives.
It currently supports local histories from Codex, Cursor, and OpenClaw. The npm CLI is intentionally scoped to the current local user.
Preview
| Format | Concise | Detail |
| --- | --- | --- |
| HTML |
|
|
| Markdown (previewed) |
|
|
Installation
npm install -g @benryoung/cli-chat-exporterRequirements:
- Node.js 20 or newer.
- Python 3 available as
python3orpython, or configured throughCCE_PYTHON/runtime.python. - Automatic local-user discovery uses native system paths; Windows currently auto-discovers Codex only.
Quick Start
cce help
cce doctor
cce config init # interactive setup, including scheduled service
cce export --source all --format both --output ~/AIChatRecords # manual backupThe default output directory is ~/AIChatRecords. Each export writes both concise and detailed versions unless you choose a single format.
What It Exports
cce export scans local session files for:
- Codex
- Cursor
- OpenClaw
Supported output formats:
- Markdown (
.md) - HTML (
.html) - Both formats in one run
Each session is exported as:
*_concise: user and assistant conversation content for reading and archiving.*_detail: additional metadata, tool calls, events, and diagnostic context.
How It Works
Current user home
|
+-- ~/.codex/sessions/...
+-- ~/.cursor/projects/...
+-- ~/.openclaw/agents/...
|
v
Python exporter core
|
v
Markdown / HTML archive filesThe npm package is a Node.js wrapper around the Python exporter core. Runtime logs are written outside the package directory under the configured state/log paths.
Commands
cce help
cce version
cce doctor
cce export [--source all|codex|openclaw|cursor|auto] [--format both|html|md] [--output DIR] [--overwrite]
cce config get
cce config init
cce config set [--source SOURCE] [--output DIR] [--earliest HH:MM] [--latest HH:MM] [--interval 1h] [--log-dir DIR]
cce service run
cce service start
cce service stop
cce service statusConfiguration
cce config get
cce config init
cce config set --output ~/AIChatRecords --source all --earliest 00:00 --latest 23:00 --interval 1hConfiguration is stored at:
~/.config/cce/config.jsonRuntime state and logs default to:
~/.local/state/cce/Scheduled Service
Start a lightweight background scheduler:
cce service start
cce service statusStop it:
cce service stopThis is a user-level process, not a system service manager integration. If npm removes or replaces the package while the scheduler is running, the background process detects the missing package files and exits.
Current-User Scope and Privacy
The npm CLI exports only the current local user's readable chat histories. It does not request elevated privileges, write sudoers rules, or attempt to read other users' home directories.
All processing is local. The tool does not upload chat records.
Advanced Python Usage
The underlying Python exporter still supports explicit user scope for local administrator workflows. For example, on a machine you administer:
sudo /path/to/python /path/to/chatManager/export_session.py --user all --format both --output /path/to/AIChatRecordsThis mode is intentionally not exposed through the npm CLI.
Troubleshooting
Check the runtime first:
cce doctorIf cce cannot find Python, either install Python 3 or set:
export CCE_PYTHON=/path/to/pythonIf exports appear empty, verify that the current user has local histories under supported application directories.
Development
npm test
npm run pack:checkLicense
MIT
