ghostplay is an automatic terminal input tool.
Intended to create terminal demo that can easily modified for documentation. (not for live presentations)
[example/script.sh]
#!/bin/sh echo This is your script. echo ghostplay types your script and execute.ghostplay example/script.shSee what happens in your terminal. Ghost is typing your script!
Another example scripts is in the example directory.
Just get the ghostplay and create a symlink in your PATH!
For example
$ git clone https://github.com/ko1nksm/ghostplay.git $ ln -s $PWD/ghostplay/ghostplay /EXECUTABLE/PATH/ # (e.g. /EXECUTABLE/PATH/ = /usr/local/bin/, $HOME/bin/)To create terminal demo, you can use asciinema, ttyrec or favorite terminal recorder.
# Record terminal asciinema rec -c "ghostplay example/script.sh"# Record terminal to a file "ttyrecord' ttyrec -e "ghostplay example/script.sh" # Convert to animated gif seq2gif -i ttyrecord -o demo.gifYou can customize ghostplay's behavior by directives, custom functions, handlers, and hooks.
See References
Example
#!/bin/sh #ghostplay silent ghostplay_custom_prompt() { # change prompt printf '$ ' } #ghostplay end echo This is your script. echo ghostplay types your script and execute. #ghostplay sleep 3 #ghostplay batch cat<<DATA line1 line2 line3 DATA #ghostplay end