pyr
v1.1.1
Published
A package for creating a script to store and run your most commonly used CLI commands
Maintainers
Readme
📜 Pyr
pyr is a tool for storing and running project specific commands in the CLI and documenting those commands in an easy format that can be committed directly to a projects repo for developers to share common commands.
Scripts
pyr uses the concept of scripts stored as .yml files. Scripts are made up of options, command, message and directory tags that are used to construct the layout of the script e.g.
hello:
message: "What language would you like to use?"
directory: "~/Desktop"
options:
spanish:
directory: "~/Desktop/Spain"
message: "Hola mundo!"
command: "echo Hola mundo >> spanish.txt"
french:
directory: "~/Desktop/French"
message: "Bonjour le monde!"
command: "echo Bonjour le monde! >> french.txt"
english:
message: "Australian or British?"
options:
australian:
directory: "~/Desktop/Australia"
message: "G'day world!"
command: "echo g'day world >> australian.txt"
british:
directory: "~/Desktop/British"
message: "Hello world!"
command: "echo hello world >> british.txt"Scripts are easy to build and follow simple rules:
- The first tag in a script serves as the scripts name
optionstags are used to store lists of moreoptionsorcommand'scommandtags are used to store a string containing a shell commandmessagetags are used to store messages that are printed to stdout when an option or command is selecteddirectorytags are used to set where a command should be ran. When a command is ran, pyr recursively searches for the most recentdirectorytag tocdinto
Local PYR file
Add and commit a pyr.yml to your project so developers can run pyr or pyr -D to run shared commands.
Commands
λ pyr
Usage: pyr [options]
Options:
-V, --version output the version number
-c, --config display configuration
-d, --delete [script name] delete a previously saved script
-A, --delete-all delete all previously saved scripts
-D, --documented prepends the command to the questions when running a script
-l, --list list previously saved scripts
-m, --modify [script name] modify a previously saved script
-p, --print [script name] print a saved script
-r, --run [script name] run a previously saved script
-s, --save <path to .yml file> process and save a script
-S, --shell set the which shell should run commands
-u, --update <script name> <path to .yml file> process and update a script
-h, --help output usage informationCopyright
MIT
