Overview
Thepm run command executes scripts defined in your package.json file. It’s a simple passthrough to your package manager’s run command.
Syntax
Arguments
The name of the script to run from package.json
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 yourpackage.json:
package.json
How It Works
Fromsrc/commands/run.ts:14:
- Detects your project’s package manager
- Passes all arguments directly to
<pm> run - Executes the command with the script and any additional arguments
Package Manager Compatibility
| Package Manager | Command |
|---|---|
| pnpm | pnpm run <script> |
| bun | bun run <script> |
| npm | npm run <script> |
Common Scripts
Typical scripts you might run:dev- Start development serverbuild- Build for productiontest- Run testslint- Run linterformat- Format codetypecheck- Run TypeScript type checkingpreview- Preview production build
Related Commands
- pm x - Execute packages without installing
- pm install - Install dependencies