Because sometimes you need to do it live

Current version: v4.2.1.

doitlive is a tool for live presentations in the terminal. It reads a file of shell commands and replays the commands in a fake terminal session as you type random characters.

Get it now¶ macOS with Homebrew:¶ $ brew update $ brew install doitlive With pip:¶ $ pip install doitlive Requires Python >= 2.7 or >= 3.5 with pip.

Quickstart¶ Create a file called session.sh . Fill it with bash commands. Run doitlive play session.sh . $ doitlive play session.sh Type like a madman.

Examples¶ # Use the "sorin" prompt theme $ doitlive play session.sh -p sorin # Increase speed $ doitlive play session.sh -s 3 # Use zsh $ doitlive play session.sh --shell /bin/zsh

Using the recorder¶ You can record session files using the built-in recorder command. $ doitlive record This will start a recording session. When you are finished recording, run the stop command. All commands will be written to a session.sh file.

Themes¶ doitlive comes with many prompt themes. To use a theme: $ doitlive play session.sh -p <theme_name> You can also change a session’s theme by using a comment directive (see Comment magic below). To view a list of available themes, run doitlive themes or doitlive themes --preview .

Python mode¶ doitlive supports autotyping in a Python console. You can enter Python mode in a session by enclosing Python code in triple-backticks, like so: # in session.sh echo "And now for something completely different" ``` python list = [ 2 , 4 , 6 , 8 ] sum = 0 for num in list: sum = sum + num print ( "The sum is: {sum}" .format ( sum = sum )) ```

IPython mode¶ If you have IPython installed, you can run doitlive in ipython mode. Just enclose your Python code in triple-backticks, like so: # in session.sh ``` ipython def fib ( n ) : a, b = 0 , 1 while a < n: print ( a, end = ' ' ) a, b = b, a+b print () # Magic! %time fib ( 100 ) ``` Note Only IPython>=5.0,<7.0 is supported.

Shell completion¶ Note If you installed doitlive with Homebrew, bash and zsh completion are already installed. Shell completion is available for bash , zsh , and fish . For bash or zsh, add the following to your .bashrc or .zshrc : eval " $( doitlive completion ) " For fish, add the following to ~/.config/fish/completions/doitlive.fish : eval ( doitlive completion )