Shellbook
is a command-line tool that allows playing a Markdown
document, executing the shell commands that it contains,
and interacting with it. The same document that you can see statically, with shellbook
can be reproduced on the command line,
allowing you to generate files and execute commands directly.
You can see the source code
This can be useful to:
- Onboarding
- Learning
- Setup
$ brew tap javierfreire/apps
$ brew install shellbook
$ shellbook https://raw.githubusercontent.com/javierfreire/shellbook/main/examples/setup.md
$ shellbook folder/onboarding.md#linux
You can follow the onboarding manual
```shell {.play}
$ echo hola
$ cat debug.log
```
# Choice {.menu}
## Option 1
...
## Option 2
...
# Choice {.choice}
## Option 1
...
## Option 2
...
## Any title {.optional}
...
```yaml {"file1.yml"}
property:
nested: hello
```
You can declare variables as link definitions.
If the variable destination is {input}
then the user will be prompted.
The app name is [APP_NAME]
...
[APP_NAME]: {input} "Application name"
If the variable destination is {parsed}
then it can be extracted from a command result.
```shell
$ cat /proc/sys/kernel/random/uuid
[APP_ID]
```
...
The app id is [APP_ID]
...
[APP_ID]: {parsed} "Application name"
- output file option with the document played and the command results
- yaml metainfo with url to upload the output report to github, stackoverflow, ... in case of error, success, ...
- Improve documentation
- Append code fragments to files
- Follow a link