Skip to content
Phillip Markert edited this page Jan 2, 2017 · 22 revisions

Installing

To install hyperpotamus, you should already have node.js and npm installed.

Once you have npm installed, execute:

npm install -g hyperpotamus

NOTE: If you are on a Mac or Linux machine, you may have to use

sudo npm install -g hyperpotamus

This will install hyperpotamus and the command-line interface (cli) into your path. Once you have hyperpotamus installed, you should be able to check the current version by executing the cli with the --version option:

hyperpotamus --version

Updating

To update to the latest version of hyperpotamus, execute:

npm update -g hyperpotamus

Uninstalling

npm uninstall -h hyperpotamus

Writing scripts

Hyperpotamus scripts are written with a simple text editor and are expressed in JSON or preferrably YAML format.

Let's write a basic script to print out "Hello world." Open any text editor and save either of the following contents to a file: hello_world.yaml

print: Hello world.

or alternatively hello_world.json

{ "print": "Hello world." }

For more information about the structure/contents of a script, see scripts.

Executing a scripts

To execute a script, simple run hyperpotamus and pass it the name of your script file.

hyperpotamus hello_world.yaml

TIP: To make scripts self-executing, see Tips: Making a script self executable

Logging

When you run a script, you may not see anything output (depending upon what the script does). To see more information about what hyperpotamus is doing behind the scenes, you can add a --verbose ( -v) flag to the command-line. Adding multiple --verbose flags (up to 3) will increase the amount of detail that shows up. -v, -vv, or -vvv are shortcuts to increase the logging level.

Logging can also be very helpful when debugging your scripts and trying to figure out what value a particular variable holds or why a specific action was processed.

Stopping a script

When running a script, you can press Ctrl-C to request hyperpotamus to stop processing any future script executions.

If you are running a script multiple times, for example with --loop or --csv, then hyperpotamus will finish the current iteration of the script, but no new iterations will be started. Hyperpotamus will display a message telling you that it will attempt a graceful shutdown.

If you do not want to wait for the script to complete and want to interrupt processing immediately, press Ctrl-C a second time.

Getting Help

There are a lot of command-line options that you can use to control hyperpotamus. To display the help information, run:

hyperpotamus --help

or more concisely, you can run hyperpotamus with no options or parameters to get the same help.

For overall help and training, this wiki is the best place to look. There are tutorials and guides as well as reference materials to document specific actions, pipes, and interpolation.