---
url: /intro/overview/index.md
---
> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /intro/overview/index.md.
# Overview
`pacwich` is an npm package that works with your package manager's workspace functionality.
`pacwich` supports [Bun](https://bun.sh/docs/pm/workspaces), [npm](https://docs.npmjs.com/cli/v11/using-npm/workspaces), and [pnpm](https://pnpm.io/workspaces) workspaces.
We take [package security](/security.md) seriously.
This page focuses on the overall motivations and design philosophy of `pacwich`. See
the [getting started guide](/intro/getting-started.md) to jump straight in.
## What does it do?
`pacwich` gives you means of getting metadata about your monorepo in human-readable
CLI output or JSON.
You can orchestrate [running scripts](/cli/commands.md#run-script) from workspaces' package.json files.
The optional configuration enriches workspaces with additional metadata and can
define [rules](/config/workspace.md) for enforcing code sharing restrictions between workspaces.
---
## Easy, Zero-Config
`pacwich`'s main goal is to provide a straightforward monorepo tooling layer that
uses as much data from your package manager as it can, not requiring special configuration to get started,
though accepting [optional config](/config.md) for more advanced usage.
It works with your workspaces' `package.json` scripts directly instead of defining a new mental model for
your processes.
---
## A CLI and TS/JS API
`pacwich` provides both a [CLI](/cli.md) and a [TS/JS API](/api.md) for interacting with your monorepo.
Since the CLI is developed via TypeScript, providing the API is natural, since the
CLI needs a TypeScript core underneath it anyway.
The API is held in close parity with the CLI. This means that you can write scripts
for your repo's automation tasks that involve `pacwich` for getting metadata or running
scripts in either shell code or TypeScript/JavaScript.
---
## Decoupling from Your Package Manager
The top package managers for JavaScript provide their own monorepo functionality, but there are several reasons to decouple your monorepo tooling from your package manager of choice.
### Scope and Development Process of PMs
Every package manager comes with various advantages and disadvantages. Package manager directions can change, and
they compete on a variety of fronts, not just monorepo features. One can be the hot favorite one day and fall out
of favor the next. One may have the best monorepo support but stall its progress as priorities shift.
Package managers' surfaces are large and cover many different concerns, which can often mean
that monorepo features are more expensive to add, especially if a CLI is already crowded with various concerns,
and some advanced monorepo features may never be in scope for these tools.
### `pacwich`'s Answer
`pacwich` has the advantage of being able to focus scope entirely on monorepo features and develop quickly
as a straightforward TypeScript package, free of package managers' red tape.
`pacwich` seeks to provide a unified layer for your monorepo tooling, so that you're free to swap package managers
without losing your monorepo metadata or script orchestration, with little to no friction when doing so.
---
## A Lightweight Project Graph
`pacwich` is aware of how your [workspaces depend on each other](/concepts/workspace-dependencies.md), opting to read dependencies from
package.json files instead of relying on analysis your JavaScript/TypeScript files. This makes
analyzing your project graph simple and fast.
Since declaring workspaces as dependencies in package.json files isn't required in all package managers,
`pacwich` includes a [`verify` feature](/concepts/verify.md) to help detect missing dependencies via simple code analysis.
© 2026 [Smorsic Labs, LLC](https://smorsic.io). All rights reserved.
---
url: /cli/index.md
---
> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /cli/index.md.
# CLI
Alt install instructions for .md page in place of above:
Installing:
### npm:
Global install: `npm install -g pacwich
# Print help for installing completions
pacwich completion
# Attempt to automatically install completions for your shell
pacwich completion install
`
Local install: `npm install -D pacwich`
Local/one-off execution: `npx pacwich`
### pnpm:
Global install: `pnpm add -g pacwich
# Print help for installing completions
pacwich completion
# Attempt to automatically install completions for your shell
pacwich completion install
`
Local install: `pnpm add -D pacwich`
Local/one-off execution: `pnpm exec pacwich`
### bun:
Global install: `bun add -g pacwich
# Print help for installing completions
pacwich completion
# Attempt to automatically install completions for your shell
pacwich completion install
`
Local install: `bun add -d pacwich`
Local/one-off execution: `bunx pacwich`
Note that the global install will delegate to the local install when available.
See the [Getting Started](/intro/getting-started) or [Glossary](/concepts/glossary) pages for more starting info.
**Stale workspace data:** Note that you need to run your package manager's install for `pacwich` to have current workspace data available, e.g. via `bun install`, `pnpm install`, or `npm install`. If you've added/removed/updated any workspace package.json, you'll likely need to run this again.
## Quick Start
See full [global options](/cli/global-options.md) or [commands](/cli/commands.md) documentation.
````
##########
# Global #
##########
# Show usage (you can pass --help to any command)
pacwich --help
# Show version
pacwich --version
# Pass --cwd to any command
pacwich --cwd=/path/to/your/project ls
pacwich --cwd=/path/to/your/project run my-script
# Specify package manager, if you have multiple lockfiles
pacwich --pm=pnpm ls
# Pass --log-level to any command (debug, info, warn, error, or silent)
# A default can also be set with the PACWICH_LOG_LEVEL env var (the flag overrides it)
pacwich --log-level=debug ls
# Suppress specific warning messages (can also be set by project config)
# Warning IDs can be seen in warning log prefixes (full list: https://pacwich.dev/config/warnings)
pacwich --suppress-warnings=MultiplePackageManagerLockfiles ls
pacwich --suppress-warnings=MultiplePackageManagerLockfiles,ParallelExceedsAvailableCpus run lint
####################
# Getting metadata #
####################
# List all workspaces in your project
pacwich list-workspaces
# ls is an alias for list-workspaces
pacwich ls --json --pretty # Output as formatted JSON
# Get info about a workspace
pacwich workspace-info my-workspace
pacwich info my-workspace --json --pretty # info is alias for workspace-info
# Get info about a script, such as the workspaces that have it
pacwich script-info my-script
##########
# Verify #
##########
# Check for issues with your project
# Can be useful as your root package.json "prepare" script
# or as a pre-commit hook
pacwich verify
# Fails if workspaces detected that import/export from each other
# without explicit dependency declared in package.json
pacwich verify --strict
###################
# Running scripts #
###################
# Run the lint script for all workspaces in parallel
# that have it in their package.json "scripts" field
pacwich run lint
pacwich run lint my-workspace # Run for a single workspace
pacwich run lint my-workspace-a my-workspace-b # Run for multiple workspaces
pacwich run lint my-alias-a my-alias-b # Run by alias (set by optional config)
# A workspace's script will wait until
# any workspaces it depends on have completed
pacwich run lint --dep-order
pacwich run lint --dep-order --ignore-dep-failure
# Workspace patterns
pacwich run lint "my-workspace-*" # Run for matching workspace names
pacwich run lint "alias:my-alias-*" "path:my-glob/**/*" "tag:my-tag"
pacwich run lint "re:my-name-regex.*" "path:re:my-path-regex.*"
pacwich run lint "*" "not:path:my-path/*" # Run for all workspaces not in my-path/
pacwich run lint --args="--my-appended-args" # Add args to each script call
pacwich run lint --args="--my-arg=" # Use the workspace name in args
pacwich run "cat package.json" --inline # Run an inline shell command
# Inline scripts can use the Bun shell if Bun is available,
# which is a cross-platform Bash-like shell
# This can be helpful for multi-OS support
pacwich run "cat package.json" --inline --shell=bun
# Scripts run in parallel by default
pacwich run lint --parallel=auto # Default, based on available logical CPUs
pacwich run lint --parallel=false # Run sequentially
pacwich run lint --parallel=2 # 2 max scripts run concurrently
pacwich run lint --parallel=50% # half of available logical CPUs
# Set the max preview lines for script output
# when "grouped" output style is used (the default on TTY)
pacwich run my-script --output-style=grouped --grouped-lines=10
# Use simple script output with workspace prefixes (default when not on a TTY)
pacwich run my-script --output-style=prefixed
# Use the plain output style (no workspace prefixes)
pacwich run my-script --output-style=plain
# Run an interactive script with full stdio, for user input etc.
# Requires a script and one workspace name or alias
# A script only gets a TTY if the caller is a TTY (i.e. not piped or redirected)
pacwich run-interactive my-interactive-script my-workspace-name-or-alias
# ri is an alias for run-interactive
pacwich ri my-interactive-script my-workspace-name-or-alias
# Silence all output
pacwich --log-level=silent run my-script --output-style=none
#####################
# Affected Features #
#####################
# List affected workspaces based on git diff (main vs. HEAD by default)
pacwich affected list
# Set the git base and head for comparison
pacwich affected list --base=my-branch-a --head=my-branch-b
# See detailed reasons for affected workspaces
pacwich affected list --explain --detailed
# Run a script across the workspaces affected by a change
pacwich affected run my-script
pacwich affected run my-script --base=my-branch-a --head=my-branch-b
# Aliases
pacwich affected ls
pacwich af ls
pacwich af run
##########
# Config #
##########
# Commands for pacwich's optional configuration
# Print project and all workspace configs as JSON
pacwich config debug
pacwich config debug --pretty # pretty print JSON
# Print just the project config as JSON
pacwich config debug --project
# Print a single workspace config as JSON
pacwich config debug --workspace=name-or-alias
# Print workspace configs matching a pattern as JSON
pacwich config debug --workspace-patterns="my-pattern-*"
````
© 2026 [Smorsic Labs, LLC](https://smorsic.io). All rights reserved.
---
url: /cli/global-options/index.md
---
> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /cli/global-options/index.md.
# CLI: Global Options
See the [Getting Started](/intro/getting-started) or [Glossary](/concepts/glossary) pages for more starting info.
**Stale workspace data:** Note that you need to run your package manager's install for `pacwich` to have current workspace data available, e.g. via `bun install`, `pnpm install`, or `npm install`. If you've added/removed/updated any workspace package.json, you'll likely need to run this again.
See also [all CLI commands here](/cli/commands.md) or the [CLI quick start](/cli.md).
## All Global Options
### Working Directory
**Usage**: `--cwd` | `-d`
**Description:** Get the project root from a specific directory. This should be where the root package.json of your project is located.
##### *Examples:*
````
pacwich --cwd=/path/to/your/project list-workspaces
pacwich -d /path/to/your/project list-workspaces
````
---
### Package Manager
**Usage**: `--pm`
**Values**: `auto``bun``pnpm``npm`
**Description:** Expect a specific package manager. This overrides config and environment variable settings.
##### *Examples:*
````
pacwich --pm=pnpm list-workspaces
````
---
### Include Root
**Usage**: `--include-root` | `-r`
**Description:** Include the root workspace as a normal workspace. This overrides config and environment variable settings.
##### *Examples:*
````
pacwich --include-root list-workspaces
pacwich -r list-workspaces
pacwich --no-include-root list-workspaces # disable (to override config/env)
````
See more on the [Root Workspace](/concepts/root-workspace.md).
---
### Disable Executable Configs
**Usage**: `--disable-executable-configs`
**Description:** Disable loading of executable config files (written in TS/JS) for untrusted contexts. This can be set by default using the environment variable PACWICH_DISABLE_EXECUTABLE_CONFIGS_DEFAULT=true.
##### *Examples:*
````
pacwich --disable-executable-configs list-workspaces
````
---
### Suppress Warnings
**Usage**: `--suppress-warnings`
**Description:** Suppress warning logs by id, in addition to the PACWICH_SUPPRESS_WARNINGS env var
##### *Examples:*
````
pacwich --suppress-warnings=MissingWorkspacesHint,MultipleConfigsFound ls
````
See the [warning page](/config/warnings.md) for a list of all IDs and means of setting suppression.
---
### Log Level
**Usage**: `--log-level` | `-l`
**Values**: `debug``info``warn``error``silent`
**Default Value**: `info`
**Description:** Set the logging level. For the run-script (run) command, silence output with --output-style=none. A default can be set with the PACWICH_LOG_LEVEL env var, which this flag overrides when passed.
##### *Examples:*
````
pacwich --log-level=debug list-workspaces
pacwich -l error list-workspaces
````
---
### Help
**Usage**: `--help` | `-h`
**Description:** Print help. Available on the CLI itself and on every command to show its usage and options.
##### *Examples:*
````
# Help for the CLI overall
pacwich --help
# Help for a specific command
pacwich run --help
pacwich affected list -h
````
Also available as the [help command](/cli/commands.md#cli-command-help).
---
### Version
**Usage**: `--version` | `-V`
**Description:** Print pacwich's version.
##### *Examples:*
````
pacwich --version
pacwich -V
````
© 2026 [Smorsic Labs, LLC](https://smorsic.io). All rights reserved.
---
url: /cli/commands/index.md
---
> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /cli/commands/index.md.
# CLI: Commands
See the [Getting Started](/intro/getting-started) or [Glossary](/concepts/glossary) pages for more starting info.
**Stale workspace data:** Note that you need to run your package manager's install for `pacwich` to have current workspace data available, e.g. via `bun install`, `pnpm install`, or `npm install`. If you've added/removed/updated any workspace package.json, you'll likely need to run this again.
See also [all CLI global options here](/cli/global-options.md) or the [CLI quick start](/cli.md).
## All Commands
### List Workspaces
**Usage**: `list-workspaces [workspacePatterns...]`
**Aliases**: `ls``list`
**Description**: List workspaces in the project.
##### Options:
`-W | --workspace-patterns ` :Workspace patterns to match, separated by whitespace. Use backslashes to escape spaces if needed.
`-n | --name-only` :Only show workspace names
`-j | --json` :Output as JSON
`-p | --pretty` :Pretty print JSON
##### *Examples:*
````
# Default output. Shows metadata about workspaces
pacwich list-workspaces
# Output only the list of workspace names
pacwich list-workspaces --name-only
# Output as JSON
pacwich list-workspaces --json
# Output as formatted JSON
pacwich list-workspaces --json --pretty
# Filter workspaces by pattern
pacwich list-workspaces my-workspace "my-name-pattern-*" "path:packages/**/*"
# Filter workspaces by pattern using the --workspace-patterns|-W option
pacwich list-workspaces --workspace-patterns="my-name-pattern-* path:packages/**/*"
````
#### More Info
See more on [workspace patterns](/concepts/workspace-patterns.md).
---
### Workspace Info
**Usage**: `workspace-info `
**Aliases**: `info`
**Description**: Show metadata about a workspace
##### Options:
`-j | --json` :Output as JSON
`-p | --pretty` :Pretty print JSON
##### *Examples:*
````
# Default output. Shows metadata about a workspace
pacwich workspace-info my-workspace
# Output as JSON
pacwich workspace-info my-workspace --json
# Output as formatted JSON
pacwich workspace-info my-workspace --json --pretty
````
---
### List Scripts
**Usage**: `list-scripts`
**Aliases**: `ls-scripts`
**Description**: List all scripts available with their workspaces
##### Options:
`-n | --name-only` :Only show script names
`-j | --json` :Output as JSON
`-p | --pretty` :Pretty print JSON
##### *Examples:*
````
# Default output. Shows metadata about scripts found in all workspaces
pacwich list-scripts
# Output only the list of script names
pacwich list-scripts --name-only
# Output as JSON
pacwich list-scripts --json
# Output as formatted JSON
pacwich list-scripts --json --pretty
````
---
### Script Info
**Usage**: `script-info