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

@epicenter/cli

v0.1.0

Published

CLI for Epicenter workspaces. Inspect tables, query data, run actions, and manage sync from the terminal.

Readme

@epicenter/cli

@epicenter/cli is the package behind the epicenter command. It loads epicenter.config.ts, opens one or more workspace clients, runs a command, prints the result, and gets out of the way. Monorepo apps, playgrounds, and local debugging scripts use it when they need the same workspace data model outside the browser or desktop app.

Installation

Inside this monorepo:

{
	"dependencies": {
		"@epicenter/cli": "workspace:*"
	}
}

The package also exposes the epicenter binary through src/bin.ts.

Quick usage

From the terminal, the normal entry points are the built-in commands:

bun epicenter start
bun epicenter start ./my-project --verbose

bun epicenter list posts
bun epicenter list posts --format jsonl

Inside the package, the binary is intentionally thin:

import { hideBin } from 'yargs/helpers';
import { createCLI } from './cli';

await createCLI().run(hideBin(process.argv));

Command definitions follow the same pattern everywhere. defineCommand is just a typed identity helper, so each command stays close to plain yargs:

export const listCommand = defineCommand({
	command: 'list <table>',
	describe: 'List all valid rows in a table',
	builder: (y: Argv) =>
		withWorkspaceOptions(y).positional('table', {
			type: 'string',
			demandOption: true,
		}),
	handler: async (argv: any) => {
		await runCommand(
			{ dir: argv.dir, workspaceId: argv.workspace },
			(client) => resolveTable(client, argv.table).getAllValid(),
			argv.format,
		);
	},
});

API overview

Public exports from src/index.ts:

  • createCLI() — build the yargs-based CLI runner
  • resolveEpicenterHome() — resolve the session/config home directory
  • createAuthApi() and createSessionStore() — auth helpers for CLI login state
  • createCliUnlock() — workspace extension that loads encryption keys from the CLI session store
  • loadConfig() — import epicenter.config.ts and collect named workspace exports

Those are the pieces meant for reuse. Most command wiring stays internal.

How commands are defined

The package keeps command authoring boring on purpose.

  • createCLI() registers top-level commands like start, list, get, count, run, describe, size, rpc, and auth.
  • defineCommand() gives command modules type inference without adding runtime behavior.
  • runCommand() handles the common lifecycle: load config, resolve the workspace, wait for readiness, print output, dispose clients.
  • withWorkspaceOptions() adds the standard --dir, --workspace, and --format flags.

That split matters because it keeps each command file short. The command author writes the operation; the package handles the boilerplate once.

TypeBox to yargs

Action input schemas already exist in the workspace layer, so the CLI reuses them. src/util/typebox-to-yargs.ts converts a TypeBox object schema into a yargs options record, carrying over things like descriptions, defaults, required fields, and simple enum-like choices.

The conversion is permissive by design. If a schema field does not map cleanly to a yargs primitive, the option still exists and the action can do stricter validation after parsing.

Relationship to other packages

@epicenter/cli is a consumer-facing shell on top of the workspace package.

epicenter command
        │
@epicenter/cli         yargs commands, config loading, auth/session helpers
        │
@epicenter/workspace   tables, actions, sync, persistence, documents

In the monorepo:

  • playground projects use the binary to start workspace daemons and inspect data
  • workspace packages reuse createCliUnlock() when they need CLI-stored auth and encryption keys
  • the CLI does not reimplement sync or storage; it drives the APIs exposed by @epicenter/workspace

License

MIT.