Execute
package.jsonscripts with a single click from the sidebar, featuring automatic package manager detection.
The ultimate Visual Studio Code extension for running npm, pnpm, yarn, and bun scripts directly from the explorer sidebar. No more switching to terminal or remembering command syntaxβjust click and run.
VS Marketplace β’ Features β’ Usage β’ Configuration β’ Multi-Workspace
- π Scripts Sidebar View: A dedicated "Quick Scripts Runner" panel in the Explorer view that displays all available scripts from your
package.json - π One-Click Execution: Execute any script with a single clickβno terminal commands needed
- π Automatic Package Manager Detection: Intelligently detects your package manager (npm, pnpm, yarn, bun) based on lock files
- π Auto-Refresh: Automatically updates the scripts list when
package.jsonor lock files change - π Status Bar Indicator: Visual indicator in the status bar showing the current package manager
- π Multi-Workspace Support: Works seamlessly with multiple workspace folders, showing scripts hierarchically
- π― Smart Workspace Detection: Automatically shows scripts from the active workspace based on your current editor
- π» Terminal Reuse: Reuses existing terminals for the same script, keeping your workspace organized
- π Script Preview: Hover over scripts to see the full command in tooltips
- β‘ Quick Actions: Access common actions directly from the view title bar
- π¨ Intuitive Icons: Visual indicators for each package manager and script type
The extension adds a new "Quick Scripts Runner" section in the explorer sidebar, displaying all available scripts from your package.json. Scripts are automatically grouped by workspace folder when working with multiple projects.
- Open VS Code
- Press
Ctrl+Shift+X(orCmd+Shift+Xon Mac) to open Extensions - Search for "Quick Scripts Runner"
- Click Install
Or install via command line:
code --install-extension alckordev.quick-scripts-runner- Clone this repository
- Open the folder in VS Code
- Run
pnpm install - Press
F5to open a new VS Code window with the extension loaded
- Open the Explorer sidebar (View β Explorer or
Ctrl+Shift+E) - Locate the "Quick Scripts Runner" section
- Click on any script to execute it
- The script runs in an integrated terminal with the correct package manager
- Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) - Type "Quick Scripts Runner: Run Script"
- Select the script from the list
- Right-click on any script in the Quick Scripts Runner view
- Select "Run Script" from the context menu
The scripts list automatically refreshes when:
package.jsonis modified- Lock files are created, modified, or deleted
- Workspace folders are added or removed
Manual Refresh:
- Click the refresh button (π) in the Quick Scripts Runner view title bar
- Or use the command:
Quick Scripts Runner: Refresh Scripts(Ctrl+Shift+P)
- Click the package manager button (π¦) in the Quick Scripts Runner view title bar
- Select your desired package manager from the quick pick menu
- Click on the package manager indicator in the status bar (bottom-left)
- Select your desired package manager
- Open VS Code Settings (
Ctrl+,) - Search for "Quick Scripts Runner"
- Set
quickScriptsRunner.defaultPackageManagerto your preferred manager
Note: The extension will use your selection when auto-detection is disabled or when no lock files are found.
- Click the file button (π) in the Quick Scripts Runner view title bar
- Press
Ctrl+Shift+P - Type "Quick Scripts Runner: Open package.json"
- Press Enter
If package.json doesn't exist:
- Use the "Open package.json" command
- When prompted, click "Create"
- A basic
package.jsontemplate will be created with a sample script
When working with multiple workspace folders, Quick Scripts Runner provides intelligent organization:
- Scripts are displayed directly in the Quick Scripts Runner view
- No folder hierarchy needed
- Each workspace with a
package.jsonappears as a folder in the view - Expand folders to see scripts for each workspace
- The active workspace is automatically detected based on your current editor
- Status bar shows the package manager for the active workspace
- Active Editor: If you have a file open, the workspace containing that file is considered active
- First Workspace: If no file is open, the first workspace folder is used
- Hierarchical View: All workspaces with scripts are shown as expandable folders
Customize Quick Scripts Runner through Settings β Extensions β Quick Scripts Runner:
Sets the default package manager when automatic detection is not possible or disabled.
| Setting | Type | Default | Description |
|---|---|---|---|
| Values | string | npm |
One of: npm, pnpm, yarn, bun |
| Scope | Workspace or User settings |
Example:
{
"quickScriptsRunner.defaultPackageManager": "pnpm"
}Enables or disables automatic package manager detection based on lock files.
| Setting | Type | Default | Description |
|---|---|---|---|
| Values | boolean | true |
When true, detects based on lock files; when false, uses default |
| Scope | Workspace or User settings |
Example:
{
"quickScriptsRunner.autoDetectPackageManager": false
}When auto-detection is enabled, the extension checks for lock files in this order:
pnpm-lock.yamlβ pnpmyarn.lockβ yarnbun.lockbβ bunpackage-lock.jsonβ npm- No lock file found β Uses
quickScriptsRunner.defaultPackageManager
Quick Scripts Runner works with any project that has a package.json, regardless of the technology stack:
- β
React -
npm run start,npm run build, etc. - β
Vue.js -
npm run serve,npm run build - β
Angular -
ng serve,ng build - β
Next.js -
npm run dev,npm run build - β
Svelte -
npm run dev,npm run build
- β Node.js - Standard Node.js applications
- β
Express -
npm start,npm run dev - β
NestJS -
npm run start:dev,npm run build - β
TypeScript -
tsc,tsc --watch
- β PHP/Symfony - Custom scripts in package.json
- β Go - Build and test commands
- β Python/Django - Management commands wrapped in scripts
- β Ruby on Rails - Custom npm scripts
- β Any project with custom package.json scripts
- Node.js >= 18
- pnpm >= 10.0.0 (enforced by project)
- TypeScript 5.0+
- VS Code 1.70+
# Install dependencies
pnpm install
# Compile TypeScript
pnpm run compile
# Watch mode (auto-compilation on file changes)
pnpm run watch
# Lint code
pnpm run lint
# Format code
pnpm run format
# Run tests (requires VS Code extension host)
pnpm testThis project enforces pnpm as the package manager:
packageManagerfield inpackage.jsonspecifies pnpm versionpreinstallscript blocks other package managers (npm, yarn, bun)enginesfield requires pnpm >= 10.0.0
Attempting to use npm, yarn, or bun will be blocked automatically with a clear error message.
The extension icon should be placed in images/icon.png:
- Size: 128x128 pixels (required)
- Format: PNG
- Recommended: Square icon with transparent background
- The icon path is specified in
package.jsonunder theiconfield
- Open the project in VS Code
- Press
F5to launch the Extension Development Host - In the new window, open a project with a
package.json - Check the "Quick Scripts Runner" section in the explorer sidebar
- Test script execution, package manager detection, and multi-workspace scenarios
Important: Tests require the VS Code extension host context to run properly because they import the vscode module.
From VS Code (Recommended):
- Open the project in VS Code
- Go to Run and Debug (
Ctrl+Shift+D) - Select "Extension Tests" from the dropdown
- Press
F5or click the play button - A new VS Code window will open and execute all tests with detailed output
From Terminal (requires VS Code context):
# This will fail without VS Code context
pnpm testNote: Running tests directly with node will fail because the vscode module is only available in the VS Code extension host environment.
Test Suite:
PackageJsonReadertests: File existence and script parsingPackageManagerDetectortests: Package manager detection logicScriptExecutortests: Script execution interface validation
MIT License - see LICENSE file for details
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch using kebab-case (
git checkout -b feature/amazing-feature) - Commit your changes following Conventional Commits
- Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project follows Conventional Commits:
feat:New featuresfix:Bug fixesrefactor:Code refactoringchore:Maintenance tasksdocs:Documentation updates
Use kebab-case for branch names:
- β
feature/add-new-command - β
fix/package-manager-detection - β
refactor/command-structure
If you encounter any issues, please open an issue in the repository with:
- Description of the problem
- Steps to reproduce
- VS Code version
- Operating system
- Expected vs actual behavior
- Screenshots (if applicable)
For questions or suggestions, please open an issue in the repository.
Authors:
- Francisco Luis Rios Vega
- Email: alckordev@gmail.com
- Website: https://alckor.dev
- Jhoel Cordova
- GitHub: @jhoelcq
- Original idea author
Made with β€οΈ for the developer community
