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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@sitchco/cli

v2.1.8

Published

Unified CLI for Sitchco platform development

Readme

@sitchco/cli

Unified command-line interface for Sitchco WordPress platform development.

Overview

The @sitchco/cli package provides a single sitchco command that orchestrates all development tooling for WordPress projects following Sitchco platform conventions. It acts as a wrapper around specialized packages for linting, formatting, building, and more.

Key Features:

  • Module-based asset building with Vite
  • Automatic code formatting and linting
  • Git hooks integration via Husky
  • Environment adapters for DDEV, local, and other environments
  • Project scanning and module discovery

Installation

For WordPress Projects

Install as a development dependency in your WordPress theme or plugin:

npm install --save-dev @sitchco/cli
# or
pnpm add -D @sitchco/cli

For Monorepo Contributors

If you're working on the tooling packages themselves:

# From monorepo root
pnpm install

The sitchco command is available via pnpm workspaces.

Commands

Asset Building

sitchco build

Builds all module and block assets for production. Compiles and optimizes JavaScript, CSS, and other assets into the dist/ folder with a manifest.json.

sitchco build

sitchco dev

Starts the Vite development server with Hot Module Replacement (HMR). Watches for file changes and automatically rebuilds assets. Creates a hot file in dist/ to signal dev mode to WordPress.

sitchco dev

sitchco clean

Removes build artifacts from the dist/ directory.

sitchco clean

Code Quality

sitchco lint [targets...]

Runs ESLint on project files. Optionally specify file or directory paths to lint specific targets.

# Lint entire project
sitchco lint

# Lint specific directory
sitchco lint ./modules/Demo/

# Lint specific files
sitchco lint ./modules/Demo/assets/scripts/main.js

sitchco format [files...]

Formats code using Prettier (with PHP support), SVGO for SVGs, and other formatters. Optionally specify files to format specific targets.

# Format all files
sitchco format

# Format specific files
sitchco format ./modules/Demo/assets/scripts/main.js

Git Hooks

sitchco prepare

Installs Husky git hooks. This is typically called automatically via the prepare npm script during npm install.

sitchco prepare

Add to your package.json:

{
  "scripts": {
    "prepare": "sitchco prepare"
  }
}

sitchco pre-commit

Runs pre-commit checks: formats and lints all staged files. This is typically called automatically by the .husky/pre-commit hook.

sitchco pre-commit

What it does:

  1. Checks for staged files
  2. Formats them with Prettier
  3. Re-stages the formatted files
  4. Runs ESLint on the workspace
  5. Blocks commit if linting fails

Environment Adapters

sitchco run <command> [args...]

Executes commands with environment-agnostic context detection. Automatically detects if you're in a DDEV environment or local development and adjusts command execution accordingly.

# Run composer in appropriate environment
sitchco run composer install

# Run WP-CLI commands
sitchco run wp plugin list

Options:

  • -a, --adapter <name> - Force specific adapter (ddev, local, etc.)
  • -e, --enforce - Make fallback failures exit non-zero
  • -v, --verbose - Show detailed execution information

sitchco adapters

Lists available environment adapters and current environment information.

sitchco adapters

Shows:

  • Available adapters (DDEV, local, etc.)
  • Current environment detection
  • Selected adapter and its priority

Usage Examples

Basic WordPress Theme Development

# Install CLI
npm install --save-dev @sitchco/cli husky

# Add prepare script to package.json
# {
#   "scripts": {
#     "prepare": "sitchco prepare"
#   }
# }

# Install hooks
npm install

# Start development
sitchco dev

# In another terminal, make changes...
# Git hooks will auto-format and lint on commit

# Build for production
sitchco build

DDEV Environment

# CLI automatically detects DDEV
sitchco run composer install    # Runs inside DDEV container
sitchco run wp plugin list       # Runs WP-CLI inside DDEV

# Check environment detection
sitchco adapters

Architecture

The CLI delegates to specialized packages:

  • @sitchco/module-builder - Asset building with Vite
  • @sitchco/linter - ESLint runner
  • @sitchco/formatter - Multi-format code formatter
  • @sitchco/project-scanner - Module discovery
  • Adapter System - Environment-aware command execution

Configuration

The CLI uses shared configurations:

  • @sitchco/eslint-config - ESLint rules
  • @sitchco/prettier-config - Prettier rules

These are automatically applied when using the CLI commands.

Requirements

  • Node.js >= 18
  • npm or pnpm

License

ISC