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

@codeflow-team/cli

v0.3.0

Published

The `codeflow` command — scaffold a flow workspace, generate typed tool/library declarations from codeflow.config.ts, and check flows against the contract.

Readme

@codeflow-team/cli

The Node-only half of CodeFlow. It owns everything that touches the filesystem — the workspace scaffold, the generated type declarations, the function library stored in lib/, and a workspace-wide check you can put in CI — so that @codeflow-team/core can stay browser-safe.

Every command is also a plain function, so a host app can run the same generate pass without shelling out.

See the root README for what CodeFlow is.

Install

Prepared for npm as v0.1.0. Until the first release lands, the binary is packages/cli/dist/cli.js after pnpm build, and the package is added as a dependency the workspace way:

"dependencies": { "@codeflow-team/cli": "workspace:*" }

Needs Node 22.18+ or 23.6+ — codeflow.config.ts is loaded with Node's own type-stripping rather than a bundler, so the CLI adds no build dependency to your project.

Commands

codeflow init [dir] [--force]     scaffold codeflow.config.ts, flows/, lib/, tsconfig.json
codeflow generate [--agent-md]    regenerate generated/tools.d.ts + generated/lib.d.ts
codeflow check [--json]           analyze every flow, report diagnostics, flag stale artifacts

A full round trip, run end to end:

$ codeflow init myflows
codeflow init — /tmp/myflows
  write package.json
  write codeflow.config.ts
  write tsconfig.json
  write flows/README.md
  write lib/is-auth-change.ts
  write lib/index.ts

Next: codeflow generate

$ cd myflows && codeflow generate
codeflow generate — codeflow.config.ts
  registry: 3 tool(s), 1 library function(s)  [registryHash 0b84875efe85]
    ok  lib/index.ts
  write generated/tools.d.ts
  write generated/lib.d.ts
  write prompts/flow-style.md

$ codeflow check
codeflow check — /tmp/myflows/codeflow.config.ts
  registry: 3 tools, 1 library function  [registryHash 0b84875efe85]

flows/canonical.flow.ts — L2, 7 nodes
  no diagnostics

library function usage (@flows/lib)
  isAuthChange  ← flows/canonical.flow.ts

ok — 1 flow checked, 0 warnings

check exits 1 on any error diagnostic or any generated artifact that no longer matches the registry, which makes it a CI gate. --json prints the same result machine-readably. generate --agent-md additionally prints the CLAUDE.md / AGENTS.md section that points a coding agent at the generated files and the flow-style rules.

The API entry points that matter

| Export | What it is for | |---|---| | generate(options) | The generate pass. Returns which files it wrote and the registry it used. | | check(options) / checkToJson / formatCheck | Workspace analysis: per-flow level and diagnostics, stale-artifact detection, and the library usage index. | | init(options) | The scaffold. | | loadWorkspace / findConfig / loadConfigFile / registryFromConfig | Read codeflow.config.ts and turn it into a Registry — the piece to reuse if you want the registry without the CLI. | | FileFunctionLibraryStore / createLibraryStore | The function library over lib/. Metadata lives in a header comment inside each function's own file, so there is never a second copy to drift. | | buildUsageIndex / findFlowFiles / loadFlows | Which flow uses which library function — the guard behind "you cannot delete a function three flows still call". | | defineConfig | Typed codeflow.config.ts authoring. |

import { check, formatCheck } from "@codeflow-team/cli";

const result = await check({ cwd: process.cwd() });
console.log(formatCheck(result).join("\n"));   // formatCheck returns lines
process.exit(result.ok ? 0 : 1);

Notable behaviour

  • The generated prompts/flow-style.md is imported from core rather than duplicated here — one source of truth for the rules an AI is given.
  • Renaming a library function rewrites the declaration inside its own file so the workspace still type-checks, but it does not rewrite the flows that import it. That is deliberate: the CLI says what it did instead of guessing at call sites.
  • The scaffolded tsconfig.json uses moduleResolution: "Bundler", because the flow contract imports without file extensions.

Tests

pnpm --filter @codeflow-team/cli test   # 63 tests

License

GNU AGPL v3 or later.