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 how 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
- Add tooltips. Xavier G. 6 months ago
- AbstractStep: on_click(): minor improvements. Xavier G. 6 months ago
- Bash functions: compute and display step duration. Xavier G. 6 months ago
- Documentation: add section "Design". Xavier G. 6 months ago
- AbstractStep: check Rich markup early. Xavier G. 6 months ago
- README: various improvements. Xavier G. 6 months ago
- Documentation: underline the difference between defining and using a theme. Xavier G. 6 months ago
- AnsiThemePolicy: ensure "verbatim" is the default policy in all cases. Xavier G. 6 months ago
- Move Textual line filters formatting to moulti.ansi. Xavier G. 6 months ago
- MoultiConsole: highlight theme policies. Xavier G. 6 months ago
- MoultiConsole: use non-ANSI colors. Xavier G. 6 months ago
- Documentation: minor improvements. Xavier G. 6 months ago
- AnsiThemePolicy: multiple improvements. Xavier G. 6 months ago
- MoultiLog: adjust background and foreground by following App.ansi_theme. Xavier G. 6 months ago
- Add bash/zsh completion using argcomplete. Xavier G. 6 months ago
- tools: add gogh2moulti.bash. Xavier G. 6 months ago
- Update Changelog. Xavier G. 6 months ago
- Documentation: describe MOULTI_ANSI & co. Xavier G. 6 months ago
- Expose ANSI themes to end users. Xavier G. 6 months ago
- MoultiConsoleHighlighter: use append_text(). Xavier G. 6 months ago
- app: disable command palette. Xavier G. 6 months ago
- Step: fix "next line color" heuristic. Xavier G. 6 months ago
- Documentation: mention NO_COLOR. Xavier G. 6 months ago
- app: preserve original ANSI colors. Xavier G. 6 months ago
- Tag v1.4.0. Xavier G. 6 months ago
- Changelog: NetBSD was also affected. Xavier G. 6 months ago
- protocol: work around recv_fds() limitation that affects FreeBSD. Xavier G. 6 months ago
- App: handle MarkupError exceptions. Xavier G. 6 months ago
- Documentation: mention the ability to copy to clipboard. Xavier G. 6 months ago
- Update Changelog. Xavier G. 6 months ago