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

contentrain

v0.2.3

Published

CLI for Contentrain — AI content governance infrastructure

Readme

contentrain

npm version GitHub source

CLI for Contentrain.

contentrain is the local operations surface for a Contentrain project:

  • initialize .contentrain/ in an existing repo
  • inspect project health and validation state
  • generate the typed #contentrain SDK client
  • review pending contentrain/* branches
  • run the local review UI
  • expose the MCP server over stdio for IDE agents

This package is the human-facing companion to:

🚀 Install

Use npx:

npx contentrain init

Or install globally:

pnpm add -g contentrain
contentrain status

Requirements:

  • Node.js 22+
  • Git available in PATH

🧰 Commands

| Command | Purpose | | --- | --- | | contentrain init | Initialize .contentrain/, git workflow, templates, and IDE rules | | contentrain status | Show project overview, models, branch pressure, and validation summary | | contentrain doctor | Check setup health, SDK freshness, orphan content, and branch limits | | contentrain validate | Validate content against schemas, optionally create review-branch fixes | | contentrain generate | Generate .contentrain/client/ and #contentrain package imports | | contentrain diff | Review and merge or reject pending contentrain/* branches | | contentrain serve | Start the local review UI or the MCP stdio server |

🔄 Typical Flow

Initialize a project:

contentrain init

Check project state:

contentrain status
contentrain doctor

Generate the typed SDK client:

contentrain generate

Validate content and create review-branch fixes when possible:

contentrain validate
contentrain validate --fix

Review pending changes:

contentrain diff

Open the local UI:

contentrain serve

🖥 serve Modes

contentrain serve has two roles.

Start the local review UI:

contentrain serve
contentrain serve --port 3333 --host localhost

This serves:

  • REST endpoints for status, content, validation, branches, and normalize data
  • a WebSocket stream for live updates
  • the embedded Vue serve-ui app bundled with the CLI

Start the MCP server for IDE integration:

contentrain serve --stdio

Use stdio mode when connecting Claude Code, Cursor, Windsurf, or another MCP client to the local project.

📦 generate and #contentrain

contentrain generate writes a typed client to .contentrain/client/ and injects #contentrain imports into your package.json.

After generation:

import { query, singleton, dictionary, document } from '#contentrain'

Run with watch mode during local model/content work:

contentrain generate --watch

👀 Review Workflow

Most write operations create contentrain/* branches in review mode.

Use:

contentrain status
contentrain diff

to understand:

  • how many active review branches exist
  • whether branch health is blocking new writes
  • what changed before merging or deleting a branch

🤖 IDE Rules

contentrain init installs project-level AI rules automatically:

  • CLAUDE.md for Claude Code or generic fallback
  • .cursorrules for Cursor
  • .windsurfrules for Windsurf

If the target file already exists, Contentrain appends its rules instead of overwriting unrelated content where possible.

📚 Documentation

Full documentation at ai.contentrain.io/packages/cli.

🛠 Development

From the monorepo root:

pnpm --filter contentrain test -- --run
pnpm --filter contentrain exec tsc --noEmit
pnpm --filter contentrain build