How do I stop a destructive command on a production server before it runs?

Mark the host as Production once. Valakes then holds a dangerous command on a card until you type the host name.

Last updated

A mistyped rm -rf on the wrong server is hard to undo: the shell has no trash and no undo. Valakes does two things about it. It makes production hard to miss, and it makes a dangerous command ask before it runs. Production marking has the details on the first. To run one command on several hosts at once, production included, see Broadcast a command to several servers safely. The whole day on live servers is in working on production servers without fear of one wrong command.

Steps

  1. Mark the host as production

    In the host editor, set Environment to Production. Valakes will not save a host without an environment. It pre-selects Production when the name, address or tags contain prod, production, live or prd, and says why ("Looks like production"). You confirm or change it. Hosts you import from ~/.ssh/config go through the same step. The picture shows the editor with Production selected.

    Changing a host away from Production asks for a confirmation in a native window.

  2. Look for the red

    On a production host you see red in six places: a stripe and a PROD badge on the tab, a thin line along the top of the terminal, a prod badge in the composer, a PROD segment in the status bar, a red focus ring on the composer and a Run button that reads Run on PROD.

    The environment always comes from the host record you saved, never from anything the server prints, so a server cannot make a production tab look like a development one. The terminal background stays untinted so that vim and htop keep their colors.

  3. Type the command in the composer

    Type the command and press Enter. Valakes reads the line before it runs. A dangerous command opens the "High risk" card. It gives the reason and, for a delete, the blast radius: "3 files" in the picture, where the test folder holds three files.

    Cancel has the focus, so pressing Enter does not run the command. On a production host the card carries the red PROD badge, and Run anyway stays disabled until you type the host name. On production, a command rated Medium counts as High and asks too.

  4. Cancel, or type the host name

    If the command is wrong, press Cancel. If you mean it, type the host name in the field and press Run anyway.

    Do not use Don't ask on this host on a production server. It switches the card off for that host after one native confirmation. In Settings, Command check, the choice Off silences the check for every host. The default is "Dangerous only", and "Explain all" also explains every command in one line.

  5. Know that the Files panel asks too

    Delete on the server pane of the Files panel always asks, with Cancel focused. On a production host, deleting a folder with content shows "Delete ... on PROD", the number of files and their size, and you type the host name. The typed host name applies while Command check is on for that host. The picture shows a folder with 17 files and folders.

    Valakes refuses to delete /, your home directory on the server and every folder above it. Dropping files on a production server pane first asks "Upload ... to PROD?".

The screenshots show Valakes built from commit 0b8738d, taken on 25 November 2026.

What it does not do

The check reads the line you typed in the composer. It does not see inside a script (sh x.sh), a remote alias or function, SQL read from a file, or what a program does after it starts. Commands you type in Raw mode, in a full-screen program or in a nested shell never reach it. A keystroke broadcast runs no check either.

The count of affected files assumes the default shell options. rm -rf "$HOME/x" still asks, but the path depends on shell expansion, so no count is shown.

The check is mistake prevention for you. The typed host name and Run anyway guard your own hand, not a window that something else has taken over. The second question in Files protects you from a slip in the same way, and it goes away with the command check for that host.

The app is free.

Get notified at launch

macOS is coming to the MacĀ AppĀ Store. iOS and Android later.