Failure cards

When a command fails and what it printed matches an error Opsty knows, a card under the prompt says what usually causes it, in one sentence, and offers the one next command.

A failure card for a package that is not installed: the sentence, the install command with Put on the line, and Copy error at the foot.

What the card says

The card’s title says what happened. Under it is the line Opsty read, quoted exactly as the program printed it, which you can select and copy; then the usual cause. When there is one sensible next step, its command sits in a well of its own with Put on the line: it is placed on your line, never run. The foot says where the sentence came from, the error text the program printed, and the × (Dismiss) closes the card.

The sentences come from a table of known errors written in advance, not from an AI. The card does not appear over ssh, and steps aside once you start typing. When the command ran long enough to count as stopped, the card also has Show in Running, which opens its detail on the Running list, and closing the card puts out its tab’s red cross.

The twenty errors it knows:

  • a port already in use (see the port card);
  • a missing npm script, or no package.json in the folder;
  • a Node module or a Python package that is not installed;
  • a folder that is not a git repository, a merge conflict, a rejected push;
  • a script without permission to run;
  • an ssh key the server refused;
  • macOS blocking a protected folder, permission denied, a file that does not exist;
  • a refused connection, an address that cannot be found, a certificate that cannot be verified;
  • a full disk;
  • the wrong Node version, pip refusing to install into the system’s Python;
  • Docker not running.

How it reads the output

Opsty reads a failed command’s output from the end, and the latest line an explanation recognizes is the one it explains. An explanation recognizes a tool’s own error line, not a phrase anywhere in the output: ls: Mail: Operation not permitted is macOS blocking a protected folder, but the same words inside another program’s log, echoed by a script that failed for a different reason, are not. A failed release script is explained by its own last error, not by something it printed on the way.

When no explanation fits, there is no card. A command that stopped still gets its reason on the Running list: What the command said last, the program’s own last error lines (✗, ERROR, error: and the like), quoted, with no cause guessed.

Copy error, for an AI chat

Copy error · to paste into an AI copies what an assistant will ask for next: the command, the last 60 lines of its output, the exit code and the folder, with a question at the end. Passwords, tokens and keys are removed first, and Opsty says how many: 2 secrets removed. Read it once before you paste it. When it found none, it still says Known secret formats are removed. Read it once before you paste it.

Did you mean, and the project strip

Mistype a command’s name, gti status, and after command not found Opsty looks for a similar name on your PATH and asks whether you meant git, with Put on the line for the corrected line. Settings ▸ Helpers ▸ Did you mean turns it off.

The first time you enter a project folder, one line says what kind of project it is and which scripts it has; click to put one on the line. It leaves when you run a command. Settings ▸ Helpers ▸ Project strip turns it off, and Explain a failure, in the same place, turns off the failure cards.