Tree @master (Download .tar.gz)
- ..
- ansible.md
- classes.md
- commands.md
- design.md
- diff.md
- direction-and-position.md
- dividers.md
- documentation.md
- environment-variables.md
- existing-scripts.md
- first-steps.md
- index.md
- install.md
- manpage.md
- progressbar.md
- python-scripting.md
- questions.md
- saving-and-loading.md
- scrolling.md
- shell-scripting.md
- steps.md
- subcommands.md
- technical-requirements.md
- text-search.md
- tools.md
first-steps.md @master — view markup · raw · history · blame
First steps
Prerequisites
This document assumes you have installed Moulti.
First steps with Moulti
-
Open two terminals on the same machine/host/VM/container.
For better visual results, these terminals should ideally support 24-bit colors and advertise it to applications. This typically does the trick:
!!! example "Both terminals"
shell export TERM=xterm-256color COLORTERM=truecolor
-
In the first terminal, launch the Moulti instance, i.e. the Terminal User Interface (TUI) itself:
!!! example "Terminal #1: TUI"
shell moulti init
Upon startup, Moulti is empty: it shows nothing beyond a title bar and a footer: !!! example "Terminal #1: TUI" -
From now on, we will use the second terminal to issue commands to the Moulti instance through the Command-Line Interface (CLI) client. First, make yourself at home by setting its title:
!!! example "Terminal #2: CLI"
shell moulti set --title='This is MY (first) Moulti instance'
The effect should be immediate in the first terminal:!!! example "Terminal #1: TUI"
-
Create your first Moulti step with step id "my_step":
!!! example "Terminal #2: CLI"
shell moulti step add my_step --title='My first step'
!!! example "Terminal #1: TUI"
-
Now, fill the "log" part of your step with some content:
!!! example "Terminal #2: CLI"
shell ip -c a | moulti pass my_step
Again, the effect should be immediate in the first terminal:!!! example "Terminal #1: TUI"
-
Back to the second terminal, adjust your step:
!!! example "Terminal #2: CLI"
shell # Applying the "success" class turns the step green: moulti step update my_step --classes='success' # Steps have optional top and bottom texts: moulti step update my_step --top-text='Here is the output of [red bold]ip -color address[/]:'
!!! example "Terminal #1: TUI" -
That syntax we used to turn the command red is called "Rich markup". Its BBcode-like syntax is described here, the list of available colors is there and styles that typically work fine in a modern terminal emulator are:
blink
bold
conceal
italic
overline
reverse
strike
underline
underline2
. Try them all at once:!!! example "Terminal #2: CLI"
shell moulti step update my_step --bottom-text \ '[blink]blink[/] [bold]bold[/] [conceal]conceal[/] [italic]italic[/] [overline]overline[/] [reverse]reverse[/] [strike]strike[/] [underline]underline[/] [underline2]underline2[/] [blue]blue[/] [on yellow1]on yellow1[/] [blue on yellow1]blue on yellow1[/]'
!!! example "Terminal #1: TUI"!!! warning "Important: Rich markup cannot be used in the log part of a step."
-
And of course, you can add multiple such steps:
!!! example "Terminal #2: CLI"
shell for class in warning error inactive standard; do moulti step add "${class}_example" \ --classes="${class}" \ --title="${class^} step" \ --text="This is a step with class '${class}'." \ --bottom-text=' ' done
!!! example "Terminal #1: TUI"!!! warning "Step ids (e.g. "my_step") must remain unique in a Moulti instance."
-
If necessary, you can also clear (i.e. empty) a step:
!!! example "Terminal #2: CLI"
shell moulti step clear warning_example
or simply delete it:!!! example "Terminal #2: CLI"
shell moulti step delete error_example
!!! example "Terminal #1: TUI"
!!! info "Refer to the output of moulti step add --help
for more options."
What next?
You now know how to add, update, fill, clear and delete steps. Steps are a core feature of Moulti, but they are not the only widgets available: you can also leverage questions, dividers and the progress bar. Or you can head straight to the Documentation section and browse its various topics, starting with shell scripting.