What's that script again ? npm run uh...
- You have a lot of npm scripts in your package.json ?
- Don't you love sometimes an interactive CLI instead of a regular one with every other flag to remember ?
In every project you have multiple CLI tools and even your own nodejs scripts, and you don't want to bother remembering or typing them every time. 😕
So you hardcode those binaries, flags and paths into npm scripts and give them nice and short names. 😀
It's all right at the beginning, but at some point, you end up with a lot of them. 😟
Now, you and your team struggle typing the right one without looking into the package.json file. 😤
How about npm run uh
and simply choose your script from a neat and organised list ? 😅
The uh command will parse your npm scripts and launch an interactive CLI list, from which you can choose the script you want to run.
uh will also group your scripts that start identically and have a colon :
delimiter.
"build"
, "build:staging"
, "build:prod"
, "build:prod:frontend"
will all be grouped under the build
list item.
Detects and works both with NPM and Yarn.
Install locally with :
- NPM:
npm install -D uh-cli
- Yarn:
yarn add -D uh-cli
Run locally with :
- NPM:
npx uh
- Yarn:
yarn uh
To use npm run uh
, you need to put "uh": "uh"
in your package.json scripts (it will be stripped from the choice list).
You can also install the package globally and simply run uh
in your terminal.