Skip to content

Shellbook is a command-line tool that allows playing a `Markdown` document, executing the shell commands that it contains, and interacting with it.

License

Notifications You must be signed in to change notification settings

javierfreire/shellbook

Repository files navigation

Shellbook

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.

generate setup file example

You can see the source code

This can be useful to:

  • Onboarding
  • Learning
  • Setup

Installation

  $ brew tap javierfreire/apps

  $ brew install shellbook

Usage

  $ shellbook https://raw.githubusercontent.com/javierfreire/shellbook/main/examples/setup.md
  $ shellbook folder/onboarding.md#linux

How to start to develop?

You can follow the onboarding manual

Features

Execute shell commands

    ```shell {.play}
    $ echo hola

    $ cat debug.log
    ```

Build a menu

    # Choice {.menu}
    ## Option 1
    ...
    
    ## Option 2
    ...

Choice one option

    # Choice {.choice}
    ## Option 1
    ...
    
    ## Option 2
    ...

Optional

    ## Any title {.optional}
    ...

Save to file

    ```yaml {"file1.yml"}
    property:
        nested: hello
    ```

Variables

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"

TODO

  • 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

About

Shellbook is a command-line tool that allows playing a `Markdown` document, executing the shell commands that it contains, and interacting with it.

Topics

Resources

License

Stars

Watchers

Forks

Languages