CLEO(1p)

πŸ“¦
version 0.004 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

✨ cleo β€” NAME πŸ’–

okay so bestie, welcome to cleo(1p), from the User Contributed Perl Documentation crew, and it is literally the tool for playing back shell commands during a live demo. like, you pre-write your commands, and cleo types them out for you like the main character you are. πŸŽ€


πŸ¦‹ SYNOPSIS

cleo COMMAND_FILE

🌸 DESCRIPTION

cleo is a lil utility for playing back pre-recorded shell commands in a live demonstration. cleo displays the commands as if you had actually typed them, and then it executes them interactively. it's giving effortless. πŸ’…

ngl there's probably an easy way to do this with expect or a similar tool. but I couldn't figure it out, so I built this. your mileage may vary. πŸ™ˆ


πŸŽ€ PLAYBACK

cleo always pauses and waits for a keypress before displaying a command and before executing it. pressing any key besides the ones listed below just advances the playback:

  • s β€” skip the current command
  • r β€” redo the current command
  • p β€” redo the previous command
  • q β€” quit playback

so iconic. those four keys are the whole vibe check. ✨


πŸ’œ COMMANDS

cleo reads commands from a file. each line is treated as one command. blank lines and lines starting with # get ignored, no cap. the commands themselves can be anything you'd type into an interactive shell. plus you can sprinkle in a few special tokens that cleo recognizes:

  • !!! β€” commands starting with !!! (three exclamation points) are not displayed and will be executed immediately. this is useful for running setup commands at the beginning of your demonstration. lowkey the best part. πŸ”₯
  • %%% β€” within a command, %%% (three percent signs) will cause cleo to pause and wait for a keypress before displaying the rest of the command. this is useful if you want to stop in the middle of a command to give some explanation. perfect for the dramatic pause. 😭

otherwise, cleo displays and executes the commands verbatim. note that some interactive commands like vim are picky about STDOUT and STDIN. to make them work properly with cleo, you may need to force them to attach to the terminal like this:

(exec < /dev/tty vim)
fr fr, if your fancy interactive program is acting brand new, that (exec < /dev/tty ...) trick is the fix. 🫢

🌈 EXAMPLE

I use this for giving demonstrations of pinto, such as the one seen at <https://www.youtube.com/watch?v=H-JkFXm8Xgk> (the live demonstration part starts around 10:47).

the command file that I use for that presentation is included inside this distribution at examples/pinto.demo. this file is for illustration only, so don't expect it to actually work for you. πŸ’€


πŸ’€ LIMITATIONS

cleo only works on Unix-like platforms. it may work on Windows if you use Cygwin. personally, I have only used cleo on Mac OS X.


⭐ TODO

  • Jump to arbitrary command number
  • Support backspacing in recorded command
  • Support multi-line recorded commands
  • Write unit tests

(the to-do list is to-doing, bestie. it'll get there. 🧚)


πŸ‘‘ AUTHOR

Jeffrey Ryan Thalhammer <thaljef@cpan.org>


Copyright (c) 2014, Imaginative Software Systems


and that's the whole page, bestie β€” written by perl v5.40.1, dated 2025-12-10, filed under CLEO(1p). slay, go give the demo of your dreams. πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from