A fast, interactive CLI for discovering and running npm scripts with fuzzy search
Stop scrolling through package.json to find the script you need. script-scan gives you an interactive, searchable prompt that shows all available scripts at a glance.
❯ script-scan
? Select script
❯ ● build bun build ./src/cli/index.ts --outdir ./dist
◆ dev bun --watch src/cli/index.ts
■ start bun dist/index.js
▸ typecheck tsc --noEmit
★ link bun link
- Fuzzy search - Type to filter scripts instantly. Search matches script names and commands
- Multi-term search - Space-separated terms use AND logic (
build prodmatches scripts containing both) - Monorepo support - Scan all workspace packages with
-wflag - Multi-select - Run multiple scripts sequentially with
-mflag - Smart discovery - Automatically finds
package.jsonby walking up the directory tree - Clean UI - Color-coded output with command previews that adapt to terminal width
bun install -g script-scangit clone https://github.com/fernandobelotto/script-scan.git
cd script-scan
bun install
bun run build
bun linkRun in any directory with a package.json:
script-scanStart typing to filter scripts. Press Enter to run the selected script.
-m, --multi Select and run multiple scripts
-w, --workspaces Scan all packages in a monorepo
-V, --version Show version number
-h, --help Show help
Run a single script interactively:
script-scanSelect multiple scripts to run sequentially:
script-scan -mScan all workspace packages in a monorepo:
script-scan -wWhen using the -w flag, script-scan will:
- Find the monorepo root by detecting
workspacesinpackage.jsonorpnpm-workspace.yaml - Recursively scan all packages for scripts
- Display scripts with their package name in brackets
? Select script (workspaces)
❯ ● build [api] tsc && node dist/index.js
◆ build [web] next build
■ dev [api] ts-node-dev src/index.ts
▸ dev [web] next dev
★ test [shared] vitest
Scripts run from their respective package directories, so relative paths and dependencies work correctly.
- Discovery - Walks up from the current directory to find the nearest
package.json - Parsing - Extracts all scripts and their commands
- Presentation - Displays an interactive autocomplete prompt using Enquirer
- Execution - Runs the selected script via
bun runas a child process
- Bun - JavaScript runtime and build tool
- Commander - CLI argument parsing
- Enquirer - Interactive prompts
# Install dependencies
bun install
# Run in development mode (with watch)
bun run dev
# Build for production
bun run build
# Type check
bun run typecheck
# Build standalone executable
bun run build:executable-
Create an alias for quick access:
alias n="script-scan"
-
Use in any subdirectory - script-scan finds the nearest
package.jsonautomatically -
Combine flags for powerful workflows:
script-scan -wm # Multi-select across all workspace packages
Contributions are welcome! Please feel free to submit a Pull Request.
MIT - see LICENSE for details.
Made by Fernando Bosco