Composer and Raw mode
The composer is the command line under the terminal. You write a command there, check it, and send it with Enter. Raw mode is the other way to work: your keys go straight to the terminal, as in any SSH client.
When the composer is active
Section titled “When the composer is active”The composer is active when you are at a shell prompt and Valakes knows what the shell is doing. That needs shell integration, described below. In the composer you get:
- Highlighting while you type.
- History with
UpandDown, and a search withCtrl+R. - Tab completion.
- Several lines at once:
Shift+Enteradds a line, and so does Enter when the command is not finished yet (an open quote, aforloop withoutdone).Ctrl+Entersends an unfinished command anyway (Cmd+Enteron macOS). - A chip with the exit code and the duration after each command.
When keys go straight to the terminal
Section titled “When keys go straight to the terminal”A bar under the terminal says why the composer stepped aside:
- A full-screen program such as
vim,htop,lessormcis running. The bar says “Terminal input: full-screen program”. When the program ends, the composer comes back. - A command is running and may be waiting for input, such as a password prompt,
catwith no file, or a REPL. The bar says “Terminal input: a command is running”. - There is no shell integration on this connection: the host has it switched off, the login shell is not bash or zsh, or the bash is older than 4.4. The status bar then says “Shell integration inactive”. The terminal works as a plain terminal and there is no bar.
- A local shell tab (a development tool) never has the composer.
You can switch by hand. Press Raw next to the Run button, or Ctrl+Shift+M (Cmd+Shift+M on macOS), and your keys go to the terminal until you press Back to composer in the bar or the same keys again. Commands you type in raw mode are not stored in the history.
Shell integration
Section titled “Shell integration”After login, Valakes asks the server which shell you have. If it is bash 4.4 or newer, or zsh, and the host’s Shell integration is Auto, Valakes types one setup line into the shell. It is the same line every time, apart from a random number made for this connection, and it is removed from the shell’s history.
What the setup does:
- It tells Valakes when a prompt appears, when a command starts and ends, with what exit code, and in which directory you are.
- It turns off history expansion (
!!,!$) and makes the shell skip history for lines that start with a space, so what Valakes parsed is what runs. - It adds helper functions that start with
__valakes_. - It does not change
PATH, aliases or your own functions, it never reads secrets and it never uses the network.
The marks the shell sends are accepted only with this connection’s random number, and they are removed from the terminal stream before you see them. A file with look-alike marks, shown with cat, cannot fake “command finished” or a password request.
Valakes does not send the setup into a nested shell such as sudo -i, su or docker exec. In those, the composer steps aside until you leave. Set Shell integration to Off in the host editor to switch it off for one host.
History and Tab completion
Section titled “History and Tab completion”History is kept by Valakes for each host, on your computer, not on the server. Up goes to the previous command and Down returns, ending at what you were typing. Ctrl+R searches for a piece of a command, and Enter on a result puts it in the composer without running it. It survives a restart.
Tab completion asks the server through a second hidden channel, so it needs a server that allows exec. Names it offers are quoted for the shell. Names with control or invisible characters are not offered.
Credentials
Section titled “Credentials”You can keep passwords, tokens and key passphrases in the vault (Settings, Credentials and vault) and have Valakes use them for you. You write {{cred:name}} where a secret belongs, or run the command and let Valakes answer the password prompt.
A credential is useful once you bind it to a tool on a host. The ten built-in tool rules are psql, mysql, mongosh, redis-cli, curl, docker login, sudo, git, ssh and scp. When your command uses a tool with a binding, a chip under the composer shows what Valakes will do. If a binding has Auto-fill on, Valakes answers the password prompt itself. If it is off, the chip asks whether to fill (for example “Fill with pg?”) and waits for you.
Three ways a value can reach the server:
- Prompt. The program asks for a password. Valakes checks that the prompt is genuine, then sends the value once, straight from its main process to the server connection. It does not pass through the window, the composer, the history or any log. This is the usual way.
- Standard input. For
docker login --password-stdin, a small helper in your shell reads the value with echo off and hands it to the program. Valakes writes the value only after the helper has announced itself. - Inline. The value is written into the command, for example
curl -u user:{{cred:http}}. This is the last resort and only for you, never for an agent. It needs the binding’s Allow inline or a confirmation each time, and a native dialog warns that the password will appear in the process list on the server and may be kept in its history. It also stays in this terminal’s scrollback.
Your own display and Valakes’ history keep {{cred:name}}, never the value. A placeholder works only in a simple command, not in a pipe or a list, and only for the tool and host it is bound to.
Method 1 has a small gap that Valakes cannot close: the program that reads the prompt belongs to the server. If it exits in the instant between its prompt and the answer, the answer can land at the shell prompt as typed text and enter the server’s shell history. Valakes narrows this window and masks the echo on your screen.
For what masking covers, see What does masking catch and what not? The whole vault, bindings and the rules for agents are on Credentials and auto-fill.
The command check and the risk card
Section titled “The command check and the risk card”Valakes reads the command you typed before it runs. Settings, Command check chooses how much it says:
- Off: never asks and shows no hint.
- Dangerous only: asks before a dangerous command and shows a line under the composer for a risky one. This is the default.
- Explain all: also explains every command in one line.
A dangerous command opens the risk card, “High risk”. It gives the reason and, for deletes, a count of what would be affected (“Blast radius: 3 files”). Cancel has the focus, so pressing Enter does not run the command. On a production host the card has the red PROD badge, and Run anyway stays disabled until you type the host name. Elsewhere Run anyway is ready at once. Don’t ask on this host switches the card off for that host after a native confirmation. You can also set Command check on this host in the host editor.
On a production host a Medium command is raised to High and asks too. See Hosts and production marking. The levels, the rules and what the check cannot see are on Command check.
The check is mistake prevention for you. It reads the line you typed, so 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. rm -rf "$HOME/x" still asks, but the path depends on shell expansion, so no count is shown.
Pasting several lines
Section titled “Pasting several lines”A paste of more than one line on a production host is shown to you as numbered lines, and nothing is sent until you confirm. Settings, Command check has a choice to ask on every host instead of only on production. A multi-line paste into a full-screen program gets a review overlay before it reaches the terminal. Pasted and dropped text is filtered for terminal escape codes first.