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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@johnlindquist/cursor-history

v0.9.2

Published

A new CLI generated with oclif

Readme

cursor-history

A fast CLI for exporting and searching Cursor conversation history, built with TypeScript + oclif.


Installation — TL;DR

# with npm
npm install -g @johnlindquist/cursor-history

# with pnpm ≥ 10 (read the next section!)
PNPM_ENABLE_PREBUILDS=true pnpm add -g @johnlindquist/cursor-history

Why two commands? cursor‑history depends on better‑sqlite3, a native add‑on. npm will download a ready‑made binary for your platform; pnpm won't unless you flip an opt‑in flag. Details below.
When the binary is missing you'll get the famous Could not locate the bindings file stack‑trace at runtime.


Basic usage

# Export the latest conversation to a Markdown file + clipboard
chi

# Extract *all* conversations to ./conversations/<timestamp>/*
chi --extract

# Fuzzy‑search by title and copy the chosen conversation to clipboard
chi --search

# Interactively browse any workspace and pick a conversation
chi --browse

# Manage old exports (delete older than 30 d)
chi --manage --older-than 30d

See chi --help for the full command list.


Troubleshooting checklist

  1. node -p "process.versions.modules" returns 115 on Node 20; match that to the folder name in better-sqlite3/lib/binding. (github.com)
  2. Make sure you're actually running the pnpm‑installed binary: which chi.
  3. Delete stale global installs (pnpm uninstall -g, npm uninstall -g) before switching package managers.

Troubleshooting: Native Module Version Mismatch (better-sqlite3)

If you see errors like this when running the CLI globally:

The module 'better_sqlite3.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 127. This version of Node.js requires NODE_MODULE_VERSION 115. Please try re-compiling or re-installing the module (for instance, using `npm rebuild` or `npm install`).

Solution for pnpm global installs

Run this command:

cd $(pnpm root -g)/better-sqlite3 && npm rebuild better-sqlite3

This will rebuild the native binary for your current Node.js version and architecture. After running this, your CLI should work globally.

Why is this needed?

  • pnpm's global store does not always trigger a native rebuild for dependencies like better-sqlite3 when installing a tarball or linking.
  • The native binary may be left in an old or missing state after a Node.js upgrade or a global install.
  • Manually running npm rebuild in the global store directory ensures the binary is rebuilt for your current environment.

If you still have issues

  • Make sure you are using the same Node.js version for both the install and when running the CLI.
  • You may need to remove and reinstall the global package if the error persists.

Using pnpm with native modules

What's happening under the hood?

| Step | npm | pnpm ≤ 10 default | |------|-----|-------------------| | Install better‑sqlite3 | Downloads pre‑built better_sqlite3.node that matches your Node ABI (node‑v115‑darwin‑arm64, etc.) | Skips the prebuild and blocks the post‑install compile script unless the package is in the allow‑list | | Runtime | require('better-sqlite3') finds the binary and works | Throws Could not locate the bindings file |

The pnpm behaviour is intentional: it prevents unreviewed packages from running arbitrary build scripts on your machine. You have three ways to opt‑in:

  1. Turn on the prebuild switch (the quickest fix) 🟢

    PNPM_ENABLE_PREBUILDS=true pnpm add -g @johnlindquist/cursor-history

    The env‑var (or the matching .npmrc key enable-prebuilt-binary=true) tells pnpm to download official prebuilt binaries for all packages that ship them, including better‑sqlite3. No compilation needed. (github.com, github.com)

  2. Manually approve the build scripts 🟡

    If you forgot the flag and saw

    Ignored build scripts: better-sqlite3, sqlite3.
    Run "pnpm approve-builds -g" to pick which dependencies should be allowed to run scripts.

    just do it:

    pnpm approve-builds -g   # interactive prompt ‑ pick better‑sqlite3 & sqlite3

    This whitelists the packages globally and re‑runs their install/postinstall scripts, compiling the native addon from source. Docs: pnpm approve-builds was added in v10.1 and gained the ‑g flag in v10.4. (pnpm.io, github.com)

  3. Force a rebuild 🔧

    # prerequisite tool‑chain once per machine
    xcode-select --install      # macOS — installs clang & make
    pnpm install -g node-gyp    # wrapper around gyp
    
    # then, inside the global store path
    cd "$(pnpm root -g)/.pnpm/better-sqlite3@*/node_modules/better-sqlite3"
    pnpm rebuild                # runs node-gyp from source

    Use this when you need a from‑source build (e.g. bleeding‑edge Node version without prebuilds). (github.com, github.com)

FAQ

  • Do I have to do this every time?
    No. Set the flag once in your user npmrc:
    pnpm config set enable-prebuilt-binary true or export the env variable from your shell profile.
  • What if I see arm64e vs arm64 errors?
    You're probably mixing Rosetta and native Node builds. Re‑install Node with the same architecture as your terminal session. (github.com)
  • Is there a prebuild‑only fork?
    Yes, better-sqlite3-with-prebuilds publishes the binary directly in the tarball, avoiding the download step altogether. Feel free to swap it in your own projects. cite turn1search9

Contributing

PRs and issues are welcome! If you have ideas for smoothing out the native‑module install story (post‑install hook, binary‑safe fork, Docker build, etc.) open a discussion.


© 2025 John Lindquist — MIT