-
-
Notifications
You must be signed in to change notification settings - Fork 1
How to write a simple cbf script
Joshua Vernon edited this page Jan 3, 2020
·
4 revisions
Simple scripts are made up of options and commands.
- The first tag is required and is the scripts name
- options are stored as keys
- commands are stored as values
- Choose a name for your CLI e.g.
hello
- Add an option for users to select to run the command
- That's it 😊
hello:
world: "echo 'Hello, world!'"
mars: "echo 'Hello, mars!'"
jupiter: "echo 'Hello, jupiter!'"
- Choose a name for your CLI e.g.
hello
- Add an option for users to select to run the command
- Wrap it all in some braces 😊
{
"hello": {
"world": "echo 'Hello, world!",
"mars": "echo 'Hello, mars!",
"jupiter": "echo 'Hello, jupiter!"
}
}
You can fine more example advanced scripts here.
Save it to cbf
$ cbf -s hello.json
Run it with cbf
$ cbf -r hello
Thanks for using cbf
🦥