Because sometimes you need to do it live

Current version: v3.0.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.3 with pip.


  1. Create a file called Fill it with bash commands.
  2. Run doitlive play
$ doitlive play
  1. Type like a madman.


# Use the "sorin" prompt theme
$ doitlive play -p sorin

# Increase speed
$ doitlive play -s 3

# Use zsh
$ doitlive play --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 file.


Themes preview

doitlive comes with many prompt themes. To use a theme:

$ doitlive play -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.

Comment magic (configuration)

Any line in a session file that begins with # is a comment. Comments are ignored unless they begin with #doitlive, in which case they are used to configure the session.

The following options can be included at the top of your session file (all are optional).

#doitlive speed: <int>

configures “typing” speed. Defaults to 1.

Example: #doitlive speed: 3

#doitlive prompt: <theme_name_or_template>

configures the prompt. Can be any of the built-in themes or a custom prompt template.

Using a custom template:

You can provide the prompt option with a custom template. To include the user, hostname, current directory, current path to working directory, current datetime, or vcs branch (git or Mercurial), use {user}, {hostname}, {dir}, {cwd}, {now}, and {vcs_branch}, respectively.

For git, {vcs_branch} just shows the branch. For Mercurial, this shows the branch name + the bookmark, except it omits the default branch name if there is a bookmark. This is equivalent to {git_branch}{hg_id}. There are also specialised {hg_branch}, and {hg_bookmark} keywords that only show that information, without the combined logic of {hg_id}.

Example: #doitlive prompt: {user} is at {cwd} $

Any of the prompt variables can be formatted with ANSI styles, like so:

Example: #doitlive prompt: {user.cyan}@{}:{dir.bold.magenta} $

Newlines can be included in prompts using {nl}.

Example: #doitlive prompt: {user}:{dir}{nl}$

Available styles: blue, magenta, red, white, green, black, yellow, cyan, bold, blink, underlined, dim, paren, square, curly, inverse, git, and hg.

#doitlive shell: <shell>

configures which shell is use. Default is /bin/bash.

Example: #doitlive shell: /bin/zsh

#doitlive alias: <alias>=<command>

adds an alias to the session.

Example: #doitlive alias: du="du -ach | sort -h"

#doitlive env: <envvar>=<value>

sets an environment variable.

Example: #doitlive env: EDITOR=vim

#doitlive unalias: <alias>

removes an alias.

#doitlive unset: <envvar>

unsets an environment variable.

#doitlive commentecho: [true|false]

Whether to echo comments or not. If enabled, non-magic comments will be echoed back in bold yellow before each prompt. This can be useful for providing some annotations for yourself and the audience.

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

echo "And now for something completely different"

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

def fib(n):
   a, b = 0, 1
   while a < n:
      print(a, end=' ')
      a, b = b, a+b

# Magic!
%time fib(100)



Only IPython>=5.0 is supported.

Bash completion

To enable bash completion, add the following to your .bashrc or .bash_profile.

eval "$(_DOITLIVE_COMPLETE=source doitlive)"

Completion is currently only supported for bash.


For more options, run

$ doitlive --help

You can also get help with subcommands.

$ doitlive play --help