Skip to content

danieldelcore/scriptpal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Script Palette

ScriptPal 🤘

A simple npm script palette for lazy people who want a quick way to look through and pick npm scripts!

  • keyboard navigation
  • autocompletion
  • fuzzy finding
  • bookmarks

Demo

Install ⬇️

Install globally

npm install -g scriptpal

Usage 🏁

scriptpal

Usage with npx

npx scriptpal

API 🤖

  • --nowelcome, -n Omit welcome message
  • --last, -l Run previous command
  • --version, -v Version number
  • --clipboard, -c Copy command to clipboard
  • --help Help me 🙏
  • list, ls List local npm scripts from package.json
  • bookmark add <name> <command...> Add a bookmark
  • bookmark edit <name> <command...> Edit a bookmark
  • bookmark remove <name>, bookmark rm <name> Remove a bookmark
  • bookmark list, bookmark ls List bookmarks
  • bookmark run <name> [name=value ...] Run a bookmark and resolve wildcards
  • bookmark Open a fuzzy-findable bookmark picker and run selection

Running Arbitrary Scripts

It's possible to also run arbitrary scripts from your package.json by passing them as sub-commands, similar to yarn.

For example: scriptpal test will run npm run test.

list / ls

list List all scripts found in local package.json.

bookmark

Store reusable command bookmarks globally.

Wildcards use ${name} syntax and are resolved when running bookmarks. If a required wildcard is not provided, ScriptPal prompts for it.

Examples

  • $ scriptpal => Shows a prompt containing a list of npm scripts from the closest package.json.
  • $ scriptpal --last => Runs the previous command
  • $ scriptpal list / $ scriptpal ls => Prints all npm scripts from the closest package.json.
  • $ scriptpal start => Runs npm run start. Can be used with other scripts as well.
  • $ scriptpal bookmark add testpkg "yarn test src/packages/${package}" => Saves a bookmark.
  • $ scriptpal bookmark run testpkg package=ui-button => Runs yarn test src/packages/ui-button.
  • $ scriptpal bookmark ls => Lists bookmarks.
  • $ scriptpal bookmark => Opens fuzzy picker for saved bookmarks and runs selected one.

You might also like...

  • CommitPal: A delightful CLI tool for building complex commit messages
  • Enquirer: Stylish, intuitive and user-friendly prompts

About

A simple npm script palette for lazy people

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors