veracioux / tuterm

A better way to learn CLI programs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tuterm

Learn the CLI by doing instead of watching

AUR License

Also check out: A collection of tutorials for your favorite CLI programs

Tuterm is a framework for running and creating real-time interactive tutorials and demonstrations of CLI programs.

Key features:

For users

  • Ridiculously easy to use
  • Step by step instructions
  • Learn at your own pace
  • No mistakes possible
  • Customizable colors, delays and prompts

For tutorial creators

  • Nothing more than a bash extension
  • Create interactive tutorials and non-interactive demos with the same code
  • Simple framework and minimalistic design
  • Well documented
  • Doesn't reinvent the wheel
  • 100% repeatable

Example

The following script defines a short tutorial/demo for the command ls.

# file: ls_tutorial
configure() {
    DELAY=0.09
    DELAY_SEP=0.12
    DELAY_PROMPT=1.5
    COLOR_MESSAGE='1;32'
}

run() {
    mkdir dir
    touch file1 file2 .file3 dir/file
    M "Let's just run the command."
    cmdline ls
    M "The -a option shows hidden files."
    # c is an alias for cmdline
    c ls -a
    M "The -R option recurses into directories"
    c ls -R
    M "You can also see the file modes"
    c ls -l
}

This script is run as:

tuterm ls_tutorial --mode MODE

There are two supported MODEs: tutorial and demo. Demo mode types out the commands in real time just like a human would. Tutorial mode shows the user what to type and then waits for them to type it, correcting any mistakes.

Demo mode is great for creating terminal recordings. The video below was generated using asciinema:

asciinema rec -c 'tuterm ls_tutorial --mode demo' ls_tutorial.cast

Installation

Arch Linux

[aur-helper] -S tuterm

From source

After cloning this repository or downloading the source code, simply run

make install

(You may need to use sudo)

This will install tuterm under /usr/local. You can change this by setting PREFIX=/your/path/of/choice.

Documentation

Everything is documented inside the man page that is installed with tuterm.

Projects using tuterm

Contributing

Please, feel free to report any issues or feature requests here. But before you do that, have a look at TODO. (this file will steadily dissolve into GitHub issues)

If you want to submit a bug fix, you can simply open a pull request. But if you want to add a new feature, open an issue so we can discuss it first.

Everyone is welcome to contribute.

A note: Tuterm is a simple program, so most issues or features should be a good choice for a beginner.

About

A better way to learn CLI programs.

License:MIT License


Languages

Language:Shell 89.5%Language:Dockerfile 5.7%Language:Makefile 4.8%