Tree @master (Download .tar.gz)
MOULTI
Moulti changes the way your shell scripts (bash, zsh, etc.) display their output in your terminal. Moulti enables you to assign the numerous lines emitted by your scripts to "steps", i.e. visual, collapsible blocks featuring their own title and color.
Here is what upgrading a Debian system looks like with Moulti:
Interested? Run this demo in a container using docker or podman
Not convinced yet? What if the output of your Ansible playbooks looked like this?
Moulti is a tool meant for people who write and execute shell scripts and/or Ansible playbooks. Specifically, if you find yourself scrolling up your terminal to ensure everything went fine while your script is still running, then Moulti is made for you.
By the way, Moulti can also display man pages and unified diff files (with colors courtesy of delta):
Installation
TL;DR: pipx install moulti; pipx ensurepath
More details in the Documentation
How?
Synopsis:
- Start a Moulti instance:
moulti init
- Add a step:
moulti step add step_name --title='some clever title here'
- Fill it:
whatever_your_script_does | moulti pass step_name
- Repeat #2 and #3 until your script is done.
Learn how to leverage Moulti by jumping to its Documentation.
Features
As shown in the demo, Moulti enables user interactions through questions:
Moulti also features:
- text search, similar to less
: documentation
- ability to maximize a single step log, similar to tmux's zoom feature
- a progress bar: documentation
- programmatic scrolling: documentation
- an askpass helper named moulti-askpass
: documentation
- support for Ansible playbooks, man pages and unified diff
When it comes to look and feel, Moulti can be customised:
- through
moulti set
: define whether Moulti steps flow up or down: documentation - through Textual CSS (TCSS): documentation
- through ANSI themes: documentation
Implementation
Moulti is written in Python and leverages Textual, along with Pyperclip, argcomplete and unidiff.
Inspiration
Moulti remained a mere idea for a significant time (possibly years).
The idea of driving TUI elements from scripts obviously comes from tools like dialog and whiptail.
At some point, the author stumbled upon multiplex, which is probably the closest thing to Moulti. multiplex was deemed unsatisfying on multiple points (including architecture) and that prompted the development of Moulti.
procmux is also similar to Moulti but did not affect its development.
Acknowledgments
The Textual framework helped a lot, so kudos to the Textual team, and specifically to: - Will McGugan for creating it - Dave Pearson for his regular help and feedback about Textual issues
Commit History @master
- protocol: fix useless return. Xavier G. 5 months ago
- Ensure only one instance of the quit dialog is shown at any time. Xavier G. 5 months ago
- Introduce the help screen. Xavier G. 5 months ago
- requirements: unidiff was missing. Xavier G. 5 months ago
- App: log Textual and Python versions to the console. Xavier G. 5 months ago
- Tag v1.12.1. Xavier G. 6 months ago
- Ansible callback plugin: handle Ansible >= 2.17 Kevin Yokley (commit: Xavier G.) 6 months ago
- Tag v1.12.0. Xavier G. 6 months ago
- Introduce moulti manpage. Xavier G. 6 months ago
- Bash functions: moulti_process_lines: close fd. Xavier G. 6 months ago
- README: mention how to install Moulti. Xavier G. 6 months ago
- Tag v1.11.0. Xavier G. 6 months ago
- copy to clipboard: support OSC 52. Xavier G. 6 months ago
- Footer: fix key text color in light mode. Xavier G. 6 months ago
- Tag v1.10.0. Xavier G. 7 months ago
- Footer: restore the usual look'n feel for Textual >= 0.63.0. Xavier G. 7 months ago
- Step: throttle calls to step.append(buffer). Xavier G. 7 months ago
- Examples: add README. Xavier G. 7 months ago
- Examples: fix shellcheck warnings. Xavier G. 7 months ago
- Examples: rename two scripts for harmonisation purposes. Xavier G. 7 months ago
- Bash functions: fix two shellcheck warnings. Xavier G. 7 months ago
- Tag v1.9.0. Xavier G. 7 months ago
- Bash functions: add stdbuf() for NetBSD and OpenBSD. Xavier G. 7 months ago
- Examples: adjust xargs command. Xavier G. 7 months ago
- Bash functions: moulti_iso_date(): leverage gdate if available. Xavier G. 7 months ago
- Update Changelog. Xavier G. 7 months ago
- Bash functions: improve moulti_iso_date. Xavier G. 7 months ago
- OCI: deploy moulti-functions.bash. Xavier G. 7 months ago
- setup.py: deploy moulti-functions.bash Xavier G. 7 months ago
- Examples: leverage moulti_check_requirements. Xavier G. 7 months ago