npm i -g @mountainpass/hooked-cli
I want to be able to setup advanced build server scripts, that can be run:
- by anyone
- with no project knowledge
- anywhere (locally or remotely)
- anytime
When executing the scripts, it must be:
- consistent
- intuitive
- forgiving
- suggestive
- simple
🔨 tool 🔨 | 🚨 cons 🚨 | ✅ pros ✅ |
---|---|---|
NPM |
|
|
Makefile |
|
|
Javascript |
|
|
Shell Scripts |
|
|
I want something simpler and more easy to use...
✅ pros of hooked ✅
- less context switching - one file for all scripts (or multiple, choose your own adventure!).
- more readable - because of "smart" completion, script names can be more verbose (symbols!).
- less environment configuration - only required environment variables are resolved, meaning non-admins don't need a full environment setup.
- more extensible - supports more generic, reusable, parameterised scripts.
- less typing - using
j _logs_
, users can rebuild/redeploy (almost) handsfree. - scripts reuse - scripts that call other scripts = easy pipelines.
- scripts for documentation - scripts can print out information, or be used to open websites e.g.
open https://somewebsite.com
j --help
(the 'j' is a fishing hook!)
Just type --init
, and it'll ask to choose a sample hooked.yaml
config file to start with.
j --init
Use --env
to specify the global environment/s you'd like to use.
j --env <yourenv1,yourenv2,etc>
Here is some example output:
Using environment: default
? What is your name? Bob
? Please select a script say
? Please select a script hello
Found script: say hello
rerun: j say hello -e default -in '{"FIRSTNAME":"Bob"}'
Hello world, Bob (nickpersonal)!
git commit is -> (279e8b9)
Note the rerun: ...
output? You can use that, to rerun a command, with all inputs predefined:
j say hello --env default --stdin '{"FIRSTNAME":"Bob"}'
Similar to the rerun
output, you can see (and copy) what others have run recently:
j --log
Don't worry, if you can't remember the full script path, you'll be prompted. Try this:
j
Feeling lazy efficient? Try typing some prefix characters of the script or environment. As long as it's enough to uniquely identify your script, the tool will do the rest!
Example: shorthand for run "say hello --env spanish
j s hel --env sp
Don't forget to commit hooked.yaml
and .hooked_history.log
files to source control, for the next person!
For detailed hooked configuration, please read here.
Impatient? Checkout the hooked.yaml
config we use!
More here.