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-profile-card

v0.1.1

Published

Generate SVG Codex usage profile cards from local Codex logs or ChatGPT Analytics API data.

Readme

Codex Profile Card

Generate an SVG Codex usage profile card from local Codex logs or ChatGPT Analytics API buckets.

Codex profile card example

Direct Usage

Generate a local Codex profile card:

npx -y codex-profile-card

Or with Bun:

bunx codex-profile-card

Both commands default to local Codex logs and write codex-local.svg.

Use npx -y in copy-paste commands so npm does not stop to ask before fetching a package. bunx does not need -y.

CLI

npx -y codex-profile-card --help

Usage:
  codex-profile-card --source local --output codex-local.svg [options]
  codex-profile-card --source analytics --output codex-analytics.svg [options]

Options:
  --source local|analytics        Data source. Defaults to local.
  --output <path>                 SVG output path. Defaults to codex-<source>.svg.
  --name <name>                   Display name. Defaults to Codex auth name, then "Codex User".
  --handle <handle>               Display handle. Defaults to empty.
  --initials <letters>            Avatar initials. Defaults to name initials.
  --avatar-url <url>               Avatar image URL. Used when the avatar identity field is visible.
  --identity-fields <fields>      Comma-separated name,handle,avatar fields. Defaults to all; use none or "" to hide all.
  --codex-home <path>             Local Codex home for local source.
  --api-key <key>                 Analytics API key for live analytics source.
  --workspace-id <id>             Analytics workspace ID for live analytics source.
  --analytics-base-url <url>      Analytics API base URL override.
  --analytics-group <group>       Analytics API group. Defaults to workspace, or user when --analytics-user is set.
  --analytics-user <id-or-email>  Keep one user from per-user Analytics buckets.
  --fixture <path>                Read Analytics buckets from a real captured fixture.
  --history-path <path>           Analytics history JSON path.
  --days <count>                  Days to render. Defaults to 182.
  --now <iso-date>                Override current time for reproducible runs.

Live analytics mode needs --api-key and --workspace-id.

JavaScript API

import {
  fetchAnalyticsUsage,
  mergeAnalyticsHistory,
  buildAnalyticsCardData,
  renderCodexStatsCard,
} from "codex-profile-card";

const endTime = Math.floor(Date.now() / 1000);
const startTime = endTime - 90 * 24 * 60 * 60;

const buckets = await fetchAnalyticsUsage({
  apiKey: "chatgpt-api-key",
  workspaceId: "workspace-id",
  startTime,
  endTime,
  group: "workspace",
});

const merged = await mergeAnalyticsHistory({ buckets });
const data = buildAnalyticsCardData({ buckets: merged.days });

const svg = renderCodexStatsCard({
  name: "Ambar Li",
  handle: "@ambarli",
  initials: "AL",
  identityFields: ["name", "handle", "avatar"],
  data,
});

Mock Cards

Generate visual mock cards for identity-field checks:

npm run generate:mock

Regenerate the README example SVG:

npm run generate:example

Test

npm test
npm run check