Because sometimes you need to do it live

Overview

doitlive

homebrew badge Build Status pypi badge Code style: Black

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.

Demo

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

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

More at https://doitlive.readthedocs.io

Project Links

Kudos

License

MIT licensed. See the bundled LICENSE file for more details.

Comments
  • Some keystrokes escape and get echoed

    Some keystrokes escape and get echoed

    I am working on Debian GNU/Linux, and I'm having trouble with some keystrokes getting echoed instead of getting swallowed. This is probably going to be difficult to debug, since it's obviously a timing problem, and I assume it must be dependent on something on my system.

    I'll attempt to fix this myself, but I'm recording the problem here for posterity.

    opened by jordigh 10
  • Echo command on windows 10

    Echo command on windows 10

    Hello. On windows 10 the echo command (that I use to write files) doesn't work. The programm crashes with the error No such file or directory when I use the record parameter to record the session.

    help wanted 
    opened by arthuro555 8
  • Unable to activate a conda environment during recording

    Unable to activate a conda environment during recording

    I am noticing a few issues that suggests that you are a different shell (and configuration) inside the recording session. Any idea?

    (REC) omry@debian:demo $ conda activate hydra-demo
    
    CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
    To initialize your shell, run
    
        $ conda init <SHELL_NAME>
    
    Currently supported shells are:
      - bash
      - fish
      - tcsh
      - xonsh
      - zsh
      - powershell
    
    See 'conda init --help' for more information and options.
    
    IMPORTANT: You may need to close and restart your shell after running 'conda init'.
    
    
    (REC) omry@debian:demo $ source activate hydra-demo
    /tmp/tmp5d9ws7: line 4: activate: No such file or directory
    
    opened by omry 7
  • Don't end at the end

    Don't end at the end

    I wish there was a way to not end automatically at the end of the session. This tool is like magic and seeing FINISHED SESSION breaks the illusion when up on stage.

    opened by technovangelist 7
  • ipython mode captures the key presses

    ipython mode captures the key presses

    Not sure, whether this is just me, but whenever I try to use an ipython mode, the interpreter starts to capture my random key presses, instead of the scripted commands.

    python-ipython.noarch 3.2.1-7.fc24

     cat doitlive-demo.sh 
    # in session.sh
    ```ipython
    def foo():
    	print('bar')
    
    foo()
    
    $ doitlive play doitlive-demo.sh 
    We'll do it live!
    STARTING SESSION: Press Ctrl-C at any time to exit.
    Press any key to continue ...
    
    [email protected]:playground $ ipython
    Python 2.7.13 (default, May 10 2017, 20:04:36) 
    Type "copyright", "credits" or "license" for more information.
    
    IPython 5.3.0 -- An enhanced Interactive Python.
    ?         -> Introduction and overview of IPython's features.
    %quickref -> Quick reference.
    help      -> Python's own help system.
    object?   -> Details about 'object', use 'object??' for extra details.
    
    In [1]: sadasdasdasdasdasfasfa
    ------------------------------------------------------------------------
    NameError                              Traceback (most recent call last)
    <ipython-input-1-0048448acb26> in <module>()
    ----> 1 sadasdasdasdasdasfasfa
    
    NameError: name 'sadasdasdasdasdasfasfa' is not defined
    
    In [2]: quit
    [email protected]:playground $ 
    FINISHED SESSION
    
    

    The basic python mode works well though.

    bug 
    opened by rplevka 6
  • Unicode literals and other stuff. Fixes #12 and #13 (nicely this time)

    Unicode literals and other stuff. Fixes #12 and #13 (nicely this time)

    Fixed #12 and #13 by removing the from __future__ import unicode_literals import and prefixing all the necessary strings with u' '. Also, hitting backspace while playing back now works as backspace usually does. Additionally setup.py was configured so it would run all unit-tests of all installed modules, which leads to errors when e.g. wheel or other stuff is installed. Unit-tests are now confined to the tests directory instead of looking everywhere.

    opened by Stefan-Code 5
  • Fixed #6 (characters sometimes echoed) and #12 (unit-test failure, click unicode warnings)

    Fixed #6 (characters sometimes echoed) and #12 (unit-test failure, click unicode warnings)

    Please also refer to the original issue Changes made:

    • termutils.py: added to provide contextmanager for raw mode
    • doitlive.py edited to use said contextmanager
    • .gitignore: added some virtualenv stuff
    opened by Stefan-Code 5
  • How to use with Windows ?

    How to use with Windows ?

    I'm using Windows 7. I've tried the session in examples, but it failed. I tried also with Git Bash it failed also. Could you tell me how to test on Windows ? Thank you.

    opened by revskill10 5
  • Issue with python 3.9 and ipython shell

    Issue with python 3.9 and ipython shell

    Script file example :

    ```ipython
    print("Hi!")
    ```
    

    When ipython starts :

    ...
    from prompt_toolkit.interface import CommandLineInterface, _InterfaceEventLoopCallbacks
    ModuleNotFoundError: No module named 'prompt_toolkit.interface'
    ...
    

    It seems that interface disappeared from prompt_toolkit a long time ago

    Python 3.9.0 (default, Oct 7 2020, 23:09:01) prompt-toolkit==3.0.8 doitlive==4.3.0

    Everything works well with

    ```python
    print("Hi")
    ```
    
    opened by lsignac 4
  • provide stealth mode allowing to pause and resume scenario silently

    provide stealth mode allowing to pause and resume scenario silently

    As described in #44, It would be nice to be able to switch to manual mode via a key combination and switch back to doitlive silently. The ctrl+z feature is nice but not quiet enough !

    enhancement 
    opened by ThinkBriK 4
  • doitlive handling of shell meta-metacharacters

    doitlive handling of shell meta-metacharacters

    Hi - love the product. I am a professor using it to teach Linux shell to a class of undergrads - makes demos so much smoother. I have attached a session-test.sh file, I noticed that doitlive doesn't handle shell meta-characters, for instance ~- and the backtick example of DT=date; echo $DT will be blank. Using Fedora 22 on Gnome-Terminal

    What is your opinion?

    session.sh

    cd ~/Documents
    pwd
    cd ~/Downloads
    pwd
    cd ~-
    pwd
    clear
    DT=`date`
    echo $DT
    date
    DT=date
    echo $DT
    DT=5
    echo $DT
    
    opened by jhajek 4
  • Using \ for line-break exits doitlive

    Using \ for line-break exits doitlive

    Hi, I cannot use \ to enter a line-break when using a lengthy command, e.g.

    $ vmcreate --project=lve \
    > --user=test \
    > --password=secret
    

    Can you please advise how to fix this?

    THX

    opened by cmonty14 0
  • Bump sphinx from 3.5.4 to 4.1.2

    Bump sphinx from 3.5.4 to 4.1.2

    Bumps sphinx from 3.5.4 to 4.1.2.

    Changelog

    Sourced from sphinx's changelog.

    Release 4.1.2 (released Jul 27, 2021)

    Incompatible changes

    • #9435: linkcheck: Disable checking automatically generated anchors on github.com (ex. anchors in reST/Markdown documents)

    Bugs fixed

    • #9489: autodoc: Custom types using typing.NewType are not displayed well with the HEAD of 3.10
    • #9490: autodoc: Some objects under typing module are not displayed well with the HEAD of 3.10
    • #9436, #9471: autodoc: crashed if autodoc_class_signature = "separated"
    • #9456: html search: html_copy_source can't control the search summaries
    • #9435: linkcheck: Failed to check anchors in github.com

    Release 4.1.1 (released Jul 15, 2021)

    Dependencies

    • #9434: sphinxcontrib-htmlhelp-2.0.0 or above
    • #9434: sphinxcontrib-serializinghtml-1.1.5 or above

    Bugs fixed

    • #9438: html: HTML logo or Favicon specified as file not being found on output

    Release 4.1.0 (released Jul 12, 2021)

    Dependencies

    • Support jinja2-3.0

    Deprecated

    • The app argument of sphinx.environment.BuildEnvironment becomes required
    • sphinx.application.Sphinx.html_theme
    • sphinx.ext.autosummary._app
    • sphinx.util.docstrings.extract_metadata()

    ... (truncated)

    Commits
    • 4ba5c21 Bump to 4.1.2 final
    • 4dc45f0 Merge pull request #9494 from tk0miya/9456_revert_9129
    • df562b4 Merge branch '4.1.x' into 9456_revert_9129
    • 5d8f925 Merge pull request #9493 from tk0miya/9436_autodoc_class_signature
    • ef53dec Fix #9456: html search: html_copy_source can't control the search summaries
    • 4f364a3 Fix #9436, #9471: autodoc: crashed if autodoc_class_signature = "separated"
    • 9218ad4 Merge pull request #9491 from tk0miya/9489_NewType
    • 68fb548 Fix #9490: autodoc: Some typing.* objects are broken
    • 771507e Fix #9489: autodoc: Custom types using typing.NewType are broken
    • 9ebdc98 Merge pull request #9467 from tk0miya/9435_disable_rewrite_github_anchor
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.

    Dependabot will not automatically merge this PR because it includes a major update to a production dependency.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Automerge options (never/patch/minor, and dev/runtime dependencies)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    dependencies 
    opened by dependabot-preview[bot] 0
  • Re-design the keyboard module

    Re-design the keyboard module

    Hi! After adding the support of ctrl-L keyboard shortcut, I've noticed the keyboard strokes are managed in a one big if...else, and that some of the keystrokes being handled are the same for both magictype and regulartype. ( Like ctrl-L :) )

    I think it will be better to manage the keystrokes for both magictype and regulartype together, at least some of them to avoid code duplication. Also, both of them are getting the same parameters but text, which also cause a little bit of code duplication.

    Any suggestions or disagreements will be happily received. I hope it's ok :worried: It's my first time trying to help an open-source project :)

    Thanks!

    opened by DvirB10 0
  • Upgrade to GitHub-native Dependabot

    Upgrade to GitHub-native Dependabot

    Dependabot Preview will be shut down on August 3rd, 2021. In order to keep getting Dependabot updates, please merge this PR and migrate to GitHub-native Dependabot before then.

    Dependabot has been fully integrated into GitHub, so you no longer have to install and manage a separate app. This pull request migrates your configuration from Dependabot.com to a config file, using the new syntax. When merged, we'll swap out dependabot-preview (me) for a new dependabot app, and you'll be all set!

    With this change, you'll now use the Dependabot page in GitHub, rather than the Dependabot dashboard, to monitor your version updates, and you'll configure Dependabot through the new config file rather than a UI.

    You have configured automerging on this repository. There is no automerging support in GitHub-native Dependabot, so these settings will not be added to the new config file. Several 3rd-party GitHub Actions and bots can replicate the automerge feature.

    If you've got any questions or feedback for us, please let us know by creating an issue in the dependabot/dependabot-core repository.

    Learn more about migrating to GitHub-native Dependabot

    Please note that regular @dependabot commands do not work on this pull request.

    dependencies 
    opened by dependabot-preview[bot] 1
  • Bump flake8-bugbear from 20.11.1 to 21.4.3

    Bump flake8-bugbear from 20.11.1 to 21.4.3

    Bumps flake8-bugbear from 20.11.1 to 21.4.3.

    Release notes

    Sourced from flake8-bugbear's releases.

    21.4.3

    Verify the element in item_context.args is of type ast.Name for b017

    21.4.2

    • Add another hasattr() check to b017 visit for .func

    21.4.1

    Happy April Fools! This is no joke, it's a real release.

    • Add B017: check for gotta-catch-em-all assertRaises(Exception)

    Catching them all is bad!

    21.3.2

    • Fix crash on tuple expansion in try/except block (#161)

    21.3.1

    • Fix grammar in B015 (#150)
    • Make sure float infinity/NaN does not trigger B008 (#155)
    • Handle positional-only args in class methods (#158)
    Commits
    • 63239e0 Update Change Log for 21.4.3 release
    • 3cab68c Bugfix: Verify the element in item_context.args is of type ast.Name (#166)
    • d3bf9ab Increment version to 21.4.2 for release + Update Changelog
    • a97d3db Add another hasattr() check to b017 visit (#165)
    • bfd3b7e Increment version to 21.4.1 for release
    • 9d18e5f Add B017 - detection for an evil form of assertRaises (#163)
    • e82bb8d Add 21.3.2 changes + increment version for release
    • 8d8d37b Hotfix issue 153 (#161)
    • eb85c48 Increment version to 20.3.1 for release
    • 810fa63 Update changelog for 21.3.1 (#160)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.

    Dependabot will not automatically merge this PR because it includes a major update to a development dependency.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Automerge options (never/patch/minor, and dev/runtime dependencies)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    dependencies 
    opened by dependabot-preview[bot] 0
Owner
Steven Loria
Always a student, forever a junior developer
Steven Loria
Ipylivebash - Run shell script in Jupyter with live output

ipylivebash ipylivebash is a library to run shell script in Jupyter with live ou

Ben Lau 6 Aug 27, 2022
Pyrdle - Play Wordle in the CLI. Write an algorithm to play Wordle for you. Ruin all of the fun you've been having

Pyrdle - Play Wordle in the CLI. Write an algorithm to play Wordle for you. Ruin all of the fun you've been having

Charles Tapley Hoyt 11 Feb 11, 2022
A cli tool , which shows you all the next possible words you can guess from in the game of Wordle.

wordle-helper A cli tool , which shows you all the next possible words you can guess from the Game Wordle. This repo has the code discussed in the You

null 1 Jan 17, 2022
Wordle helper: help you print posible 5-character words based on you input

Wordle Helper This program help you print posible 5-character words based on you

Gwan Thanakrit Juthamongkhon 4 Jan 19, 2022
CLI program that allows you to change your Alacritty config with one command without editing the config file.

Pycritty Change your alacritty config on the fly! Installation: pip install pycritty By default, only the program itself will be installed, but you ca

Antonio Sarosi 184 Jan 7, 2023
Lets you view, edit and execute Jupyter Notebooks in the terminal.

Lets you view, edit and execute Jupyter Notebooks in the terminal.

David Brochart 684 Dec 28, 2022
The project help you to quickly build layouts in terminal,cross-platform

The project help you to quickly build layouts in terminal,cross-platform

gojuukaze 133 Nov 30, 2022
Module for converting 2D Python lists to fancy ASCII tables. Table2Ascii lets you display pretty tables in the terminal and on Discord.

table2ascii Module for converting 2D Python lists to a fancy ASCII/Unicode tables table2ascii ?? Installation ??‍?? Usage Convert lists to ASCII table

Jonah Lawrence 40 Jan 3, 2023
CLabel is a terminal-based cluster labeling tool that allows you to explore text data interactively and label clusters based on reviewing that data.

CLabel is a terminal-based cluster labeling tool that allows you to explore text data interactively and label clusters based on reviewing that

Peter Baumgartner 29 Aug 9, 2022
👻 Ghoul is an easy to use information service, allowing you to get/add information on someone or something directly from your terminal.

?? Ghoul is an easy to use information service, allowing you to get/add information on someone or something directly from your terminal. It c

Billy 11 Nov 10, 2021
A ZSH plugin that enables you to use OpenAI's powerful Codex AI in the command line.

A ZSH plugin that enables you to use OpenAI's powerful Codex AI in the command line.

Tom Dörr 976 Jan 3, 2023
A CLI tools to get you started on any project in any language

Any Template A faster easier to Quick start any programming project. Installation pip3 install any-template Features No third party dependencies. Tem

Adwaith Rajesh 2 Jan 11, 2022
AWS Interactive CLI - Allows you to execute a complex AWS commands by chaining one or more other AWS CLI dependency

AWS Interactive CLI - Allows you to execute a complex AWS commands by chaining one or more other AWS CLI dependency

Rafael Torres 2 Dec 10, 2021
Output Analyzer for you terminal commands

Output analyzer (OZER) You can specify a few words inside config.yaml file and specify the color you want to be used. installing: Install command usin

Ehsan Shirzadi 1 Oct 21, 2021
Fun project to generate The Matrix Code effect on you terminal.

Fun project to generate The Matrix Code effect on you terminal.

Henrique Bastos 11 Jul 13, 2022
A terminal tool for git. When we use git, do you feel very uncomfortable with too long commands

PIGIT A terminal tool for git. When we use git, do you feel very uncomfortable with too long commands. For example: git status --short, this project c

Zachary 1 Apr 9, 2022
This is a CLI utility that allows you to view RedFlagDeals.com on the command line.

RFD Description Motivation Installation Usage View Hot Deals View and Sort Hot Deals Search Advanced View Posts Shell Completion bash zsh Description

Dave G 8 Nov 29, 2022
pyGinit is a command line tools that help you to initialize your current project a local git repo and remote repo

pyGinit pyGinit is a command line tools that help you to initialize your current project a local git repo and remote repo Requirements Requirements be

AlphaBeta 15 Feb 26, 2022
PdpCLI is a pandas DataFrame processing CLI tool which enables you to build a pandas pipeline from a configuration file.

PdpCLI Quick Links Introduction Installation Tutorial Basic Usage Data Reader / Writer Plugins Introduction PdpCLI is a pandas DataFrame processing CL

Yasuhiro Yamaguchi 15 Jan 7, 2022