For developers

Folder commands

A .rqn file gives a folder its own commands, run by name and as buttons.

A folder can keep its own commands in a file called .rqn, and the rqn command runs them from any terminal: rqn deploy runs the command called deploy of the nearest .rqn, whatever that folder's way of deploying is. Raqun Commander's terminal shows the same commands as buttons above its bar, and an editor writes the file for you.

Good for developers and keyboard users.

The command editor: the commands of the folder's .rqn file in a list at the left, and at the right a form with the selected command's name, description, look and command.
The command editor: the folder's commands in a list at the left, and the form of the selected command at the right.
  • A file of commands in the folder

    A line name: command, or name: with the command indented below it for several steps; a # line directly above a command is its description. One name then means the right thing in each project, and a command that is hard to remember, such as firebase deploy --only hosting, has a short name that stays. File ▸ New .rqn makes a starting file in a folder.

  • The rqn command

    rqn name runs the command of the nearest .rqn from any terminal, in the folder that holds that file, with the output, ⌃C and exit status of the terminal you typed it in. Arguments are passed on, commands may run each other, and exit status 2 is rqn itself saying no. rqn alone opens Raqun Commander, rqn . shows a folder in its active pane, and any other word is a command and nothing else, so a typo never opens a folder.

  • The project's, and yours

    The commands are the nearest .rqn, looked for from the folder where you typed up to your home folder, and the global ones of ~/.rqn, which every terminal has. A command of the same name in the nearest file wins, and a global command runs in the folder where you typed rqn.

  • Files that are refused

    A .rqn that is not yours, or is a link, is refused, and the search does not go on to a parent's, so a command never changes because a file in the way was passed over. A wrong file is an error that names its line. A file with control characters or text-direction characters is refused too: what a .rqn says is printed before it runs, and none of those can rewrite what the terminal shows.

  • Buttons above the terminal

    In a terminal tab a row of buttons above the bar has one for each command of the shell's folder, the project's first and then the global ones, each with its symbol and colour from a #: look line, or guessed from its name. A click types the command at the prompt, ⌥-click types it without Return so arguments can be added, and a running command's button becomes Stop. Drag a button to put the commands in another order.

  • Typed, not hidden

    A button types the command's own lines, in a subshell, so you see what runs and it is in your history, and your shell's folder and variables stay as they were: a cd or an export in a command does not leak out, and an exit does not close the tab. The buttons are dim while something is typed on the line or a program runs, and a button made for another folder is never run.

  • The command editor

    Terminal ▸ Edit Commands… opens a sheet with This Folder | Global, the commands at the left and a form at the right: name, description, look and the command. What is wrong is said in red and Save stays off. Save changes only what you changed: a command you did not touch is copied byte for byte, comments stay where they are, and the result is read again before it is written. A folder with no .rqn offers to make one, never over a file that appeared meanwhile.

  • Installing the rqn command

    Settings ▸ Integration ▸ Command line puts a link at /usr/local/bin/rqn, asking for the administrator password unless you can write there already. It says what is there: installed, installed for another copy, a broken link, or something else, and something else is left alone, because it never replaces a file it did not make. Raqun Commander's own terminal finds rqn before it is installed.