Termiyo
← All solutions

Solutions

Snippets with questions, and runbooks that run

The commands you repeat, saved once and never mistyped, and a checklist that runs itself and stops when something is wrong.

A Termiyo snippet is a saved command with a ${name} wherever a value changes, and Termiyo asks for that value each time it runs. A runbook is a note whose sh blocks run one by one in the session you pick, each with its output and exit code under it, stopping at the first step that fails. Use them for the commands and checklists you repeat.

A snippet is a command you keep; write ${name} where a value goes and Termiyo asks for it each time, from a list if you give one. A note whose steps are in ```sh blocks is a runbook: each step runs in the session you pick, its output and exit code appear under it, and nothing after a failed step runs.

Recorded in Termiyo against a test server on the recording machine, answering as a demo machine written for the recording.

Steps

  1. Save a command as a snippet

    Open Snippets in the menu and press “New snippet”. Give it a name and the command, with ${app} (any name) where a value goes. Under the command, give the allowed answers one per line if there are only a few; press “Save”.

    tail -n 20 /var/log/${app}/error.log
  2. Run it

    Press the snippet with a terminal in front. Termiyo asks for each value — a list when you gave the answers — and “Run snippet” types the finished command into the terminal.

  3. Write a runbook

    Open Notes, press “New note” and write the checklist. Put each command in a ```sh block; {"name":"…"} after the sh names the step.

    ```sh {"name":"disk"} df -h / | tail -1 ```
  4. Run it step by step

    Pick the session under “Where the steps run” and press “Run all”. Each step’s output and exit code appear under it; when a step fails, the steps after it are not run, and Termiyo says so. Each step also has its own “Run step”.

Good to know

  • A step that looks destructive, or that runs on a production server, asks before it runs, as a command typed in that terminal would.
  • Runbooks need Command blocks on (Settings › Terminal, on by default) and bash or zsh, so the shell can say where each command ends.

Transcript

The commands you repeat, saved once and never mistyped, and a checklist that runs itself and stops when something is wrong.

Save a command you repeat as a snippet, with the part that changes as a question.

Run it, and Termiyo asks for the value each time, so a blank never runs.

Write a runbook: your checklist and its commands, in one note.

Run all, and each step’s result appears under it. It stops at the first failure.