npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@benryoung/cli-chat-exporter

v0.3.0

Published

Local CLI and scheduler for exporting AI chat histories to Markdown and HTML

Readme

CLI Chat Exporter

中文

npm version CI License: MIT

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 | Concise HTML export | Detailed HTML export | | Markdown (previewed) | Concise Markdown preview | Detailed Markdown preview |

Installation

npm install -g @benryoung/cli-chat-exporter

Requirements:

  • Node.js 20 or newer.
  • Python 3 available as python3 or python, or configured through CCE_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 backup

The 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 files

The 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 status

Configuration

cce config get
cce config init
cce config set --output ~/AIChatRecords --source all --earliest 00:00 --latest 23:00 --interval 1h

Configuration is stored at:

~/.config/cce/config.json

Runtime state and logs default to:

~/.local/state/cce/

Scheduled Service

Start a lightweight background scheduler:

cce service start
cce service status

Stop it:

cce service stop

This 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/AIChatRecords

This mode is intentionally not exposed through the npm CLI.

Troubleshooting

Check the runtime first:

cce doctor

If cce cannot find Python, either install Python 3 or set:

export CCE_PYTHON=/path/to/python

If exports appear empty, verify that the current user has local histories under supported application directories.

Development

npm test
npm run pack:check

License

MIT