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

cossack

v0.9.6

Published

The Cossack Framework CLI — scaffolding, code generation, lifecycle, and upgrades for Cossack projects.

Readme

Cossack CLI

The official CLI for the Cossack Framework. Use it to create and manage Cossack projects, generate code, and upgrade dependencies.

Installation

In a Cossack project

The CLI is installed automatically when you scaffold a project:

pnpm cossack create my-app
cd my-app

It is available through the generated project's cossack dependency, usually via scripts such as pnpm dev, pnpm build, and pnpm start.

Globally (optional)

pnpm add -g cossack
# or: npm install -g cossack
# or: yarn global add cossack

Requires Node.js >= 22.

cossack create detects whether it was invoked through npm, pnpm, Yarn or Bun and prints matching install/dev commands. Globally installed users can override detection with --package-manager <manager>.

Usage

cossack <command> [args] [options]

Run cossack --help to list all commands, or cossack <command> --help for command-specific options.

Commands at a glance

| Command | Description | | --- | --- | | create <name> | Scaffold a new Cossack project. | | dev | Start the Vite dev server. | | build | Production build (vite build; pages marked ssg: true are pre-rendered inside it). | | start | Start the production server. | | deploy | Build and deploy to Cloudflare (--env, --dry-run, --json). | | preview <create\|inspect\|cleanup> | Create, inspect and clean up isolated Cloudflare previews. | | resources <plan\|apply> | Select account-owned Cloudflare bindings. | | inspect <scope> | Show static facts: routes, cloudflare, providers, workflows, schedules. | | check <scope> | Validate the same scopes, or templates (html template diagnostics with file, line and column), and exit nonzero on errors. | | specs | Print the app model JSON: routes, classes, methods, props, state, comments and render() UI trees (--output, --schema). | | generate <type> <name> (g) | Generate a page/component/layout/middleware/service/model/migration/seeder. | | delete <type> <name> (d) | Delete a generated file/folder. | | add <feature> | Add a feature and its prerequisites (see the feature list below). | | remove <feature> | Remove a feature and anything that depends on it. | | plugins <list\|check\|upgrade\|remove> | Manage plugins rendered into src/plugins/<name>/. Render one with add plugin <directory\|tarball\|npm package>; packages are read as data and never executed. | | adapter <node\|cloudflare> | Switch the active runtime adapter. | | lang <sub> | Manage localization catalogs (publish, add <locale>, extract, check, types). | | migration <sub> (migrate) | Manage model-first ORM migrations (generate, snapshot, squash, up, down, status, rehash, check, baseline, plan). | | schema <sub> | ORM schema commands (inspect, pull, diff, check). | | seeder <sub> (seed) | Run registered seeders (list, run). | | studio | Inspect the configured database in a local browser. | | routes | List all routes in the project. | | typecheck | Write the generated types (bindings, typed URLs, config() keys), then run tsc --noEmit. | | config | List configuration factory type origins. Use --generate before standalone type checking. | | ssg | Pre-render pages marked ssg:true to static HTML. | | image optimize | Generate optimized image variants from <Image> usages (requires ImageMagick). | | docs | Read offline catalogs of installed package exports, declarations and guides. | | traces | Read recorded development snapshots and timelines. | | test-results | Read recorded test evidence and source freshness. | | cms <command> | Manage a running CMS site through its management API: login, whoami, entries, notes, users, roles, settings, terms, media, sites and mcp (MCP client setup). --site <id> acts on one site of a network. | | upgrade [dir] | Update a project in one command: Cossack dependencies and the files the scaffold wrote, with your edits merged. | | eject <package> <path> | Copy a page, configuration file or plugin that a mounted package serves into the project, where it overrides the package's. upgrade merges later changes into the copy. | | info | Print system/environment info for bug reports. | | version (v) | Print the CLI version. |

Global options

| Option | Description | | --- | --- | | --force, -f | Overwrite existing files / skip confirmation. | | --dry-run | Show the planned changes without writing files. | | --help, -h | Show help. | | --version, -V | Print the CLI version. |

Examples

# Scaffold and run
cossack create my-app
cd my-app && pnpm dev

# Generate code
cossack g page dashboard --head --title "Dashboard"
cossack g page hello --no-index          # -> src/pages/hello.ts (flat, no folder)
cossack g layout admin/dashboard
cossack g component UserCard
cossack g migration create_posts

# Add features
cossack add database --database d1
cossack add studio                 # Also adds database support when needed
cossack add auth --auth-methods credentials,oauth --oauth github
cossack add dashboard --features users,sessions
cossack add markdown               # Enables .md and .mdx routes
cossack remove database

# Open the installed database Studio
cossack studio

# Switch runtimes (configuration/code only; database data is not migrated)
cossack adapter node
cossack adapter cloudflare --database=turso

# Database lifecycle
cossack migration up
cossack seeder run

# Image optimization (build-time, via ImageMagick)
cossack image optimize --format webp --quality 80

# Stay current
cossack upgrade

How it works

The CLI is a small, dependency-light Node.js program (no commander/yargs). Commands are registered in src/dispatch.js. Each command lives in src/commands/ and follows the contract async function run(args, ctx): Promise<exitCode>. Generated file contents are pure template functions in src/templates.js (string in, string out) for easy testing.

Scaffolding is powered by @cossackframework/scaffold. cossack create writes a schema-v3 .cossack/scaffold.json manifest with capability ownership and baseline hashes. cossack add composes features, cossack remove removes features and their dependents, cossack adapter re-renders the recorded recipe for another runtime, and cossack upgrade re-renders only the installed capabilities.

Available presets are minimal, database, auth, and full-stack (the default; with --features cms the default is minimal, because the CMS cannot be combined with examples). Composable features are ui, database, studio, auth, dashboard, markdown, examples, desktop, resource, mutation, scoped-service, protected-route, jobs, turnstile, schedules, notifications, workflows, and cms. cossack add installs missing prerequisites first: for example, studio requires database, auth requires ui and database, and examples requires both ui and markdown. cossack --help and cossack add --help print the list from the scaffold registry. For example:

cossack create my-app --preset=minimal --yes
cd my-app
cossack add dashboard --features=users,sessions

Documentation