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

codex-sync

v1.0.12

Published

Sync your OpenAI Codex CLI sessions to OpenSync dashboard

Readme

codex-sync

npm version License: MIT

Sync your OpenAI Codex CLI sessions to OpenSync dashboard. Track coding sessions, analyze tool usage, and monitor token consumption across projects.

GitHub: github.com/waynesutton/codex-sync-plugin

npm: npmjs.com/package/codex-sync

OpenSync Ecosystem

| Project | Description | Links | | ---------------------- | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | OpenSync | Dashboards for AI coding sessions | Website / GitHub | | opencode-sync-plugin | Sync OpenCode sessions | GitHub / npm | | claude-code-sync | Sync Claude Code sessions | GitHub / npm | | droid-sync | Sync Factory Droid sessions (community built) | GitHub / npm | | codex-sync | Sync Codex CLI sessions | GitHub / npm | | cursor-opensync-plugin | Sync Cursor sessions | GitHub / npm |

Installation

npm install -g codex-sync

Upgrading

To upgrade to the latest version:

npm update -g codex-sync

Check your current version:

codex-sync --version

Quick Start

1. Get Your API Key

  1. Log into your OpenSync dashboard
  2. Go to Settings
  3. Click Generate API Key
  4. Copy the key (starts with osk_)

2. Configure the Plugin

codex-sync login

Enter when prompted:

  • Convex URL: Your deployment URL (e.g., https://your-project.convex.cloud)
  • API Key: Your API key from Settings (e.g., osk_abc123...)

3. Add to Codex CLI

codex-sync setup

This automatically adds the notify hook to ~/.codex/config.toml.

Manual setup (if needed):

Add this line to ~/.codex/config.toml:

notify = ["codex-sync", "hook", "agent-turn-complete"]

4. Verify Setup

codex-sync verify

You should see:

  OpenSync Setup Verification

Credentials: OK
   Convex URL: https://your-project.convex.cloud
   API Key: osk_****...****

Codex CLI Config: OK
   Config file: ~/.codex/config.toml
   Hook: codex-sync

Connection Test: OK
   Connected to OpenSync

Sessions Directory: OK
   Found 5 recent session(s)

Ready! Start Codex and sessions will sync automatically.

Sessions will now sync automatically when you use Codex CLI.

CLI Commands

| Command | Description | | ------------------------------ | ------------------------------------ | | codex-sync login | Configure Convex URL and API Key | | codex-sync setup | Add hooks to Codex CLI config | | codex-sync verify | Verify credentials and config | | codex-sync synctest | Test connectivity and sync a session | | codex-sync sync | Sync recent sessions | | codex-sync sync --all | Sync all sessions | | codex-sync sync --limit N | Sync last N sessions | | codex-sync status | Show connection status | | codex-sync config | Show current configuration | | codex-sync config --json | Show config as JSON | | codex-sync set <key> <value> | Update a config value | | codex-sync logout | Clear stored credentials | | codex-sync hook <event> | Handle Codex hook events (internal) | | codex-sync --version | Show version number | | codex-sync --help | Show help |

See full command reference for detailed usage.

How It Works

Codex CLI stores sessions as JSONL files in ~/.codex/sessions/. The plugin uses the notify hook to trigger sync when Codex finishes a turn, then parses the session file to extract:

  • Session metadata (project path, model, timestamps)
  • User prompts and assistant responses
  • Tool calls and results
  • Token usage (input, output, cached, reasoning)
  • Estimated cost

The data is sent to your OpenSync backend via the sync API.

Configuration Options

| Option | Type | Default | Description | | --------------- | ------- | ------- | --------------------------- | | autoSync | boolean | true | Automatically sync sessions | | syncToolCalls | boolean | true | Include tool call details | | syncThinking | boolean | false | Include thinking traces | | debug | boolean | false | Enable debug logging |

Set options with:

codex-sync set syncToolCalls false
codex-sync set debug true

Environment Variables

You can also configure via environment variables:

export CODEX_SYNC_CONVEX_URL="https://your-project.convex.cloud"
export CODEX_SYNC_API_KEY="osk_your_api_key"
export CODEX_SYNC_AUTO_SYNC="true"
export CODEX_SYNC_TOOL_CALLS="true"
export CODEX_SYNC_THINKING="false"
export CODEX_SYNC_DEBUG="false"

What Gets Synced

| Data | Description | | ------------------- | ------------------------------------------------------- | | Session metadata | Project path, working directory, git branch, timestamps | | User prompts | Your messages to Codex | | Assistant responses | Codex's responses | | Tool calls | Shell commands, file operations, and their results | | Token usage | Input, output, cached, and reasoning token counts | | Model info | Which model was used (gpt-5-codex, etc.) | | Cost estimate | Estimated session cost based on token usage |

Privacy

  • All data goes to YOUR Convex deployment login profile if you're using opensync.dev the cloud version.
  • Run convex locally for the 100% sefl host
  • Sensitive fields can be redacted
  • Full file contents are not synced, only paths
  • Thinking traces are off by default
  • You control what gets synced via configuration

Troubleshooting

# Check status and connection
codex-sync status

# View current config
codex-sync config --json

# Enable debug mode
codex-sync set debug true

# Full reset
npm uninstall -g codex-sync
rm -rf ~/.config/codex-sync
npm install -g codex-sync
codex-sync login
codex-sync setup

Common Issues

Hook not triggering:

  • Make sure Codex CLI is updated: npm update -g @openai/codex
  • Verify hook is in config: cat ~/.codex/config.toml | grep notify
  • Check debug logs: codex-sync set debug true

Connection errors:

  • Verify Convex URL is correct (no trailing slash)
  • Check API key starts with osk_
  • Test connection: codex-sync synctest

Sessions not appearing in dashboard:

  • Wait a few seconds for sync to complete
  • Check sessions exist: ls ~/.codex/sessions/
  • Manual sync: codex-sync sync --limit 5

Need Help?

Requirements

  • Node.js 18 or later
  • OpenAI Codex CLI (npm install -g @openai/codex)
  • A deployed OpenSync backend

Links

OpenSync

codex-sync (this package)

Related Plugins

License

MIT