The hatoba command

Describes Hatoba 0.8.6.

Opening hosts

Settings → General → Use the hatoba command in terminals (off by default, kept per device) adds a hatoba command: on Windows in a bin folder beside Hatoba that goes on your PATH, on Linux at ~/.local/bin/hatoba, and on macOS at /usr/local/bin/hatoba after macOS asks for an administrator’s password. hatoba <host name> connects that saved SSH or Telnet host in Hatoba, and hatoba user@host or other ssh arguments, or hatoba telnet <address> [<port>], connect as quick connect does. Hatoba comes to the front, and a launch while it is locked waits for the unlock.

Other programs

Let other programs use saved hosts, below it, lets coding agents such as Claude Code and Codex, and scripts, work on the saved SSH hosts without a copy of their passwords or keys:

  • hatoba hosts lists the saved SSH hosts with their user@address:port and group. hatoba hosts --json also gives each one’s id, how it signs in (password, key, agent, or ask for a password Hatoba asks for), its tags, jump host and AI Notes. Neither shows a password or a key.
  • hatoba exec <host> <command> runs the command with the host’s login shell and without a terminal, and prints its output as it comes. A stdin from a pipe or a file is the command’s, as with ssh, so hatoba exec <host> 'sh -s' < script.sh runs a local script; from a terminal, the command’s stdin is empty. It exits with the command’s exit status, or with 255 when Hatoba could not run it. --cwd <dir> starts it in another directory, absolute or from the home directory; a Windows host runs commands with cmd.exe or PowerShell and refuses it, so change the directory in the command there.
  • hatoba cp <file> <host>:<path> uploads one file and hatoba cp <host>:<path> <file> downloads one, over SFTP. A remote path is from the home directory, and a target that is a folder or ends with / gets the file under its own name. A file it replaces on the host keeps its permissions, and --mode 600 gives the file those.
  • --sudo runs the command, or reads or writes the file on the host, as root with sudo, which has to let the login user run sh as root. The command starts in the same directory, where ~ and $HOME are root’s. A file it writes keeps its owner and permissions when it was already there, as with sudo cp, and a copy that fails while writing can leave it cut short. When sudo asks for a password, Hatoba tries the host’s saved password, then asks in its window, and remembers what you enter until it locks or the host has had no --sudo for 15 minutes.
  • hatoba memory --host <host> lists the memories the assistant keeps of that host, which a conversation on it starts with; --json prints them for programs. hatoba memory save --host <host> <name> <text> saves one in place of the host’s memory of that name, with the text from stdin when none is given, and hatoba memory delete --host <host> <name> deletes one. So a coding agent starts with what the assistant noted about a host, and what it saves reaches the assistant’s next conversations on it. The global memories stay with the assistant: the commands neither list nor change them. The limits are those of the assistant’s own memories, and the commands fail while Remember across conversations is off (Custom instructions, host notes and memory).
  • <host> is a saved SSH host’s name or id; for a Telnet host they fail and say to open it with hatoba <host name>. Hatoba has to be running and unlocked. It connects with the host’s saved sign-in, jump host and proxy, uses the host’s open connection (its terminal tabs’ and port forwards’) when there is one, and otherwise keeps its own for later commands until it has been unused for 10 minutes.
  • When a connection needs you, for a host key that is not trusted yet, a password that is not saved or a code, Hatoba comes to the front and asks as it does for a terminal, and the command says what it waits for. With --no-prompt it fails instead.
  • Ending the command (Ctrl+C, or a timeout of the program that ran it) stops what it started on the host. Locking Hatoba stops every command and copy and closes their connections.
  • Recent use, below the switch, counts what other programs ran until Hatoba locks, and Details beside it lists each one, on which host and how it ended.
  • Only programs that run as you on this computer can reach Hatoba this way. hatoba --help lists the commands and options.
  • Skill for coding agents, below the switch, shows npx skills add scarletkc/Hatoba --skill hatoba-cli -g with Copy Command. It installs the hatoba-cli skill, which teaches Claude Code, Codex and other agents to use these commands on your saved hosts.

Edit this page on GitHub