preset is a program for managing and running command sequences at once, so you don't have to manually type your commands - just append them to your preset and run your preset.
- Create, delete and manage your presets
- Run your presets
- Placeholders for flexible values (user input)
- JSON saving
- Debugging messages
Your first step is to create your preset. You can do that by running preset create, followed by your preset's name:
preset create testAfter creating a preset, you need to add your commands to it. You can do that by running preset append, followed by your preset's name and a command:
preset append test echo Hi!
preset append test echo This is a test!Normally, the appended commands's value is fixed (e.g. echo Hi!). You can make a value flexible (make a preset ask for input when it reaches that command) by adding a placeholder {}:
preset append test echo {}Finally, you can run your preset by running preset run, followed by your preset's name:
preset run testYou can also disable debugging messages using the --no-message flag.
And, you can preview what would be ran without actually running commands using the --dry-run flag.
Note
If a command returns non-zero, the preset will crash. To keep the preset running despite a failed command, use the --skip-errors flag.
You can remove a specific command from your preset by running preset remove, followed by your preset's name and a command:
preset remove test echo Hi!You can pop a command from your preset at a given index by running preset pop, followed by your preset's name and an index:
preset pop test 0You can insert a command at a given index by running preset insert, followed by your preset's name, index and command:
preset insert test 0 echo Hi!You can see all of your created presets by running preset list:
preset listThis prints the pretty JSON where all of your created presets are saved.
cargo install presetThis project is distributed under the MIT License.
