Skip to main content

Overview

The pm run command executes scripts defined in your package.json file. It’s a simple passthrough to your package manager’s run command.

Syntax

Arguments

string
required
The name of the script to run from package.json
string[]
Additional arguments to pass to the script

Examples

Run Build Script

Output

Run Test Script

Output

Run Script with Arguments

Output

Run Custom Script

Output

Package.json Scripts

Define scripts in your package.json:
package.json
Then run them with:

How It Works

From src/commands/run.ts:14:
The command:
  1. Detects your project’s package manager
  2. Passes all arguments directly to <pm> run
  3. Executes the command with the script and any additional arguments

Package Manager Compatibility

All package managers support the run command, making this a universal way to execute scripts.

Common Scripts

Typical scripts you might run:
  • dev - Start development server
  • build - Build for production
  • test - Run tests
  • lint - Run linter
  • format - Format code
  • typecheck - Run TypeScript type checking
  • preview - Preview production build
  • pm x - Execute packages without installing
  • pm install - Install dependencies