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

convex-duckdb

v0.0.5

Published

CLI to sync a local DuckDB mirror of Convex data for ad-hoc analytics.

Downloads

673

Readme

convex-duckdb

convex-duckdb keeps a local DuckDB copy of your Convex data in sync so you and your AI agents can run fast, read-only SQL for counts, joins, aggregates, filtering, and exploratory debugging.

The CLI does not talk to Convex directly. It connects to a convex-duckdb-proxy service that holds your Convex deploy key, buffers document deltas in SQLite, and passes full snapshot requests through to Convex.

Quick Start

First deploy the proxy. The fastest path is the tested Railway template:

https://railway.com/deploy/p-a9bt

The template provisions the proxy service, a volume for the SQLite delta buffer, and a generated CONVEX_DUCKDB_ACCESS_TOKEN. After deployment, add your Convex deployment URL and deploy key in Railway.

Then configure the CLI in the repository where you want the local DuckDB file:

npx convex-duckdb install

install is interactive and writes .convex-duckdb/config.json with:

  • CONVEX_DUCKDB_PROXY_URL - your Railway proxy URL
  • CONVEX_DUCKDB_ACCESS_TOKEN - the token from the Railway deployment

The CLI reads only .convex-duckdb/config.json. It never reads environment variables or .env files.

Usage

npx convex-duckdb status
npx convex-duckdb sync
npx convex-duckdb sync --full

The first sync performs a full restore through the proxy snapshot routes. Later syncs use buffered document deltas. If the delta retention window has expired, the CLI automatically falls back to a full restore.

Query the synced database with DuckDB:

duckdb -readonly .convex-duckdb/data.duckdb -markdown <<< "SHOW TABLES;"

Example:

duckdb -readonly .convex-duckdb/data.duckdb -markdown <<'SQL'
SELECT table_name, estimated_size
FROM duckdb_tables()
ORDER BY table_name;
SQL

Agent Workflow

Install the reusable skill into supported agents:

npx skills add maksymilian-majer/convex-duckdb-mirror

With the skill installed, agents can:

  • check mirror status with npx convex-duckdb status --json
  • sync data with npx convex-duckdb sync
  • inspect schemas with DuckDB SHOW TABLES and DESCRIBE
  • run read-only analytical SQL against .convex-duckdb/data.duckdb

Agents should read your Convex schema first, usually convex/schema.ts, then confirm actual DuckDB columns with DESCRIBE because types are inferred from exported data.

How It Works

The proxy exposes a small subset of Convex streaming export:

  • GET /api/document_deltas - buffered in proxy SQLite for fast incremental sync
  • GET /api/json_schemas - passed through to Convex for full restore
  • GET /api/list_snapshot - passed through to Convex for full restore

The Convex deploy key stays on the proxy. The CLI only needs the proxy URL and access token.

Links