Skip to content
Releases

The agent guide

Flint is the person’s SSH client. Its flint CLI reaches their servers by alias through one encrypted vault: Flint logs in, and you get the output and the exit code. Passwords, keys and passphrases stay inside Flint. No command prints one, and you never need one.

This guide is printed by flint agent-guide and always matches the installed flint. It has two parts: how to work with Flint, then the reference, generated from the CLI’s own command table.

  1. Status first. Run flint --json vault status before anything else. unlocked says whether Flint holds the vault open; when it is false, your first command asks the person to unlock it.
  2. Prefer --json. Data goes to stdout, a Flint error is one JSON object on stderr with nothing on stdout. Read the exit code, not the text.
  3. List, then act. flint --json host list gives the aliases. Never guess one, never run ssh directly, never read ~/.ssh or the vault file.
  4. Never ask for a password, key or passphrase in the chat, and never pass one as an argument. Flint asks the person in its own window or terminal. When Flint lacks a secret it needs, tell the person to set it in Flint.
  5. Wait for the person. The first command from your program opens Flint’s approval window, and a locked vault its unlock screen. The command waits up to the approval wait the person chose (2, 5, 10 or 30 minutes); with --json it waits silently. If your tool cuts commands sooner, run flint in the background and check on it. Never start a second copy meanwhile.
  6. Never retry in a loop. 15 denied is a no: ask before trying again. 16 approval_timeout means nobody was there: one retry, then ask. 5 locked: run flint vault unlock (it waits for the person), then retry once. 11 host_key: stop and ask the person to check the server’s key.
  7. Quote the remote command as one word. Everything after -- is joined with spaces and parsed by the remote shell, as with ssh: flint --json exec web-01 -- 'cd /var/log && tail -n 50 syslog'. The command gets no terminal and its stdin is closed, so use non-interactive flags (apt-get -y, --no-pager). For a long job pass --exec-timeout <secs> (default 600).
  8. Copy files with flint cp, never exec cat or a heredoc. Exit 20 exists: the file is there; ask before passing --force.
  9. Reach a service inside a server with a saved tunnel: flint --json tunnel ls, then flint --json tunnel up <host>:<name> and connect to its listen address; flint tunnel down <host>:<name> when done. Never add or change tunnels without asking.
  10. Root only through --sudo: flint --json exec <alias> --sudo -- <command> [args], the arguments as separate words, not one quoted string. The person approves each command in Flint (or gives a few minutes of root on that one host) and Flint types the sudo password; you never see it.
  11. Change the vault only when asked. Adding, editing or removing hosts, keys, credentials, groups, tunnels or tokens needs a write grant and the person’s say. Never create a token for yourself.

Usage: flint [--json] [--vault <name|path>] <command> [args] [flags]. Flags go anywhere before --.

  • --json: Write JSON to stdout; an error is one JSON object on stderr.
  • --vault <name|path>: Use this vault instead of the current one.
  • --master-stdin: Read the master password from the first line of stdin (for a person’s scripts; an agent never has it).
  • --version, -V: Print the version and the linked libraries.
  • --help, -h: Print the short usage.
  • flint vault create <path> [--name <name>]
    Create a vault; asks the person for a master password.
    Example: flint vault create ~/work.flint --name Work
  • flint vault open <path>
    Open an existing vault file and make it the current one.
    Example: flint vault open ~/work.flint
  • flint vault list
    The recent vaults; current marks the one commands use.
    Example: flint --json vault list
  • flint vault use <name|path>
    Make a recent vault the current one.
    Example: flint vault use Work
  • flint vault status
    The vault’s path, whether it is unlocked in Flint (and why not), its counts and its sync state. Run it first. Grant: read.
    Example: flint --json vault status
  • flint vault unlock
    Ask Flint to unlock the vault, and wait for the person to do it, up to the approval wait.
    Example: flint vault unlock
  • flint vault lock
    Lock the vault in Flint and remove its remembered key where the CLI may. Ends every grant.
    Example: flint vault lock
  • flint vault rename <new-name>
    Rename the vault; its file is not moved. Grant: write.
    Example: flint vault rename Personal
  • flint vault passwd [--new-master-stdin]
    Change the master password; asks for the old and the new one.
    Example: flint vault passwd
  • flint vault merge <copy.flint>
    Merge a conflict copy of the vault into it, record by record.
    Example: flint vault merge ~/work.conflict-1.flint
  • flint vault connect <url> [--label <text>] [--token-stdin]
    Keep the vault in step with a flint-vault-server; asks for its token and the master password. The label is shown in the server’s list, in clear.
    Example: flint vault connect https://vault.example.com --label laptop
  • flint vault connect <url> --list
    The vaults the server keeps: id, label, version.
    Example: flint --json vault connect https://vault.example.com --list
  • flint vault connect <url> --to <path> [--id <id>]
    Download a vault from the server to a new file here (--id when the server keeps several).
    Example: flint vault connect https://vault.example.com --to ~/work.flint
  • flint vault sync [--new-master-stdin]
    Sync now with the vault’s server; Flint also syncs on its own. Grant: write.
    Example: flint --json vault sync
  • flint vault token [--token-stdin]
    Replace the server’s token after it was rotated.
    Example: flint vault token
  • flint vault disconnect
    Stop syncing on this machine; the file stays.
    Example: flint vault disconnect
  • flint vault forget <name|path>
    Drop a vault from the recent list; the file stays.
    Example: flint vault forget Work
  • flint group add <path>
    Create a group, for example homelab/proxmox. Grant: write.
    Example: flint group add homelab/proxmox
  • flint group list
    Every group with its host and subgroup counts. Grant: read.
    Example: flint --json group list
  • flint group rename <path> <new-name>
    Rename a group; its hosts follow. Grant: write.
    Example: flint group rename homelab/proxmox pve
  • flint group rm <path>
    Remove a group. Grant: write.
    Example: flint group rm homelab/pve
  • flint host add <alias> --hostname <host> [--port N] [--user U] [--label L] [--group <path>] [--tag T]... [--color #rrggbb] [--notes N] [--jump <alias>] [--cred <name>] [--key <name>] [--password | --password-stdin] [--command <cmd> [--no-keep-shell]] [--sudo-password | --sudo-password-stdin]
    Add an SSH host. --command runs on connect, then a login shell (--no-keep-shell ends the session there); the sudo password defaults to the login one. Grant: write.
    Example: flint host add web-01 --hostname 10.0.0.5 --user deploy --group prod
  • flint host add <alias> --type rdp --hostname <host> [--port N] [--user U] [--domain D] [--password | --password-stdin | --cred <name>] [--audio local|remote|off] [--microphone]
    Add a remote desktop host (port 3389); it opens in the desktop app only. Grant: write.
    Example: flint host add win-01 --type rdp --hostname 10.0.0.9 --user admin
  • flint host edit <alias> [the add flags] [--alias <new>] [--no-tags] [--no-password] [--no-sudo-password] [--command ""] [--keep-shell] [--no-microphone]
    Change a host; only the flags given change. Grant: write.
    Example: flint host edit web-01 --tag nginx
  • flint host list [--group <path>] [--tag <tag>]
    Every host: alias, type, hostname, user, group, tags. Never a secret. Grant: read.
    Example: flint --json host list
  • flint host show <alias>
    One host, with has_password and has_sudo_password in place of the passwords. Grant: read.
    Example: flint --json host show web-01
  • flint host rm <alias>
    Remove a host. Grant: write.
    Example: flint host rm web-01
  • flint host test <alias> [--timeout <secs>] [--accept-new-host-key]
    Connect, verify the host key, log in and hang up. Grant: exec.
    Example: flint --json host test web-01
  • flint key add <name> (--file <path> | --key-stdin) [--passphrase | --passphrase-stdin]
    Import a private key into the vault. Grant: write.
    Example: flint key add deploy --file ~/.ssh/id_ed25519
  • flint key list
    Every key: name, type, fingerprint, whether it has a passphrase. Grant: read.
    Example: flint --json key list
  • flint key show <name>
    One key, with its public key. Never the private key. Grant: read.
    Example: flint --json key show deploy
  • flint key rename <name> <new-name>
    Rename a key; hosts that use it follow. Grant: write.
    Example: flint key rename deploy deploy-2026
  • flint key rm <name>
    Remove a key. Grant: write.
    Example: flint key rm deploy-2026
  • flint cred add <name> --user <user> [--key <name>] [--password | --password-stdin]
    A user, key and password shared by several hosts. Grant: write.
    Example: flint cred add ops --user ops --key deploy
  • flint cred edit <name> [--name N] [--user U] [--key K] [--password | --password-stdin | --no-password]
    Change a credential. Grant: write.
    Example: flint cred edit ops --user operator
  • flint cred list
    Every credential: name, user, key, whether it has a password. Grant: read.
    Example: flint --json cred list
  • flint cred show <name>
    One credential, with has_password in place of the password. Grant: read.
    Example: flint --json cred show ops
  • flint cred rm <name>
    Remove a credential. Grant: write.
    Example: flint cred rm ops
  • flint connect <alias> [--timeout <secs>] [--accept-new-host-key] [--no-command]
    An interactive shell, through jump hosts; for a person at a terminal, not for an agent. Grant: exec.
    Example: flint connect web-01
  • flint exec <alias> [--timeout <secs>] [--exec-timeout <secs>] [--accept-new-host-key] -- <command>
    Run one command; exits with its status. --timeout is the connect deadline, --exec-timeout the command’s (default 600 s). Grant: exec.
    Example: flint --json exec web-01 -- 'systemctl is-active nginx'
  • flint exec <alias> --sudo -- <command> [args]
    Run it as root: Flint asks the person in its window for each one (or inside a root period they gave) and types the sudo password itself. Needs Flint open. Through Flint only: the person approves each command, or a root period covers it.
    Example: flint --json exec web-01 --sudo -- systemctl restart nginx
  • flint known-host list
    The server keys Flint has recorded. Grant: read.
    Example: flint --json known-host list
  • flint known-host rm <alias|address>
    Forget a server’s recorded key. Grant: write.
    Example: flint known-host rm web-01
  • flint cp [-r | --recursive] [--force] <local path> <alias>:<path>
    Copy to the host, into <path> when it is a folder; -r for a folder. Grant: exec.
    Example: flint --json cp ./app.conf web-01:/etc/app/
  • flint cp [-r | --recursive] [--force] <alias>:<path> <local path>
    Copy from the host; an existing file here needs --force. <alias>: alone is the login folder. Grant: exec.
    Example: flint --json cp web-01:/var/log/app.log ./
  • flint cp [-r | --recursive] [--force] <alias>:<path> <alias>:<path>
    Copy from one host to another through this machine; no key or password goes to a host. The grant must reach both. Grant: exec.
    Example: flint --json cp web-01:/srv/dump.sql db-01:/tmp/
  • flint tunnel add <host> <name> --local <port> [--to <host:port>] [--open-on-connect]
    Save a local forward in a host: 127.0.0.1: here reaches <host:port> as the host sees it (default localhost:). Grant: write.
    Example: flint tunnel add db-01 postgres --local 15432 --to localhost:5432
  • flint tunnel edit <host>:<name> [--name N] [--local P] [--to D] [--open-on-connect | --no-open-on-connect]
    Change a saved tunnel. Grant: write.
    Example: flint tunnel edit db-01:postgres --local 25432
  • flint tunnel ls [<host>]
    The saved tunnels, with listen and state. Grant: read.
    Example: flint --json tunnel ls
  • flint tunnel rm <host>:<name>
    Remove a saved tunnel. Grant: write.
    Example: flint tunnel rm db-01:postgres
  • flint tunnel up <host>:<name> [--timeout <secs>] [--accept-new-host-key]
    Start a saved tunnel in Flint; it keeps running after the command returns. Needs Flint open. Grant: exec.
    Example: flint --json tunnel up db-01:postgres
  • flint tunnel down <host>:<name>
    Stop a running tunnel. Needs Flint open. Grant: exec.
    Example: flint tunnel down db-01:postgres
  • flint tunnel status [<host>:<name>]
    The running tunnels and their state. Needs Flint open. Grant: read.
    Example: flint --json tunnel status
  • flint token create --name <name> --allow read,exec[,write] [--hosts <alias,@group,...> | --all] [--ttl 15m|1h|4h|1d|7d|30d|90d]
    A token for a program nobody can be asked about (cron, launchd, CI on this machine). Flint asks the person to approve it every time; prints the token once (default --ttl 1d). Through Flint only: the person approves each token.
    Example: flint token create --name nightly --allow exec --hosts nas --ttl 30d
  • flint token list
    Every token with its status. Never its secret. Grant: read.
    Example: flint --json token list
  • flint token revoke <id|name>
    End a token at once. Grant: write.
    Example: flint token revoke nightly
  • flint agent-guide
    This guide, in Markdown (with --json: the guide, the commands and the exit codes).
    Example: flint agent-guide

With Flint open and the vault unlocked there, every command runs through Flint and needs no master password. A program Flint has not seen asks the person once in Flint’s window, which shows the program and what started it. They allow it for some time (until the vault locks at most) and choose what the grant covers:

  • read: list, show and status commands.
  • exec: connect, exec, cp, host test, tunnel up and tunnel down, on the hosts or groups they pick (cp between two hosts needs both).
  • write: commands that change the vault.

Locking the vault ends every grant. While Flint waits for the person, the command waits; it fails with 15 denied when they refuse or the grant does not cover the command, and with 16 approval_timeout when nobody answers in time.

A program nobody can be asked about (cron, launchd, CI on this machine) uses a token from flint token create, passed in the FLINT_TOKEN environment variable. With a token Flint never asks: the request runs if the token covers it, else it fails at once with denied. The person approves every token in Flint, and no grant covers token create.

flint exec <alias> --sudo -- <command> [args] runs one command as root. No grant or token covers it: Flint’s window shows the exact arguments and the person confirms each command with Touch ID, polkit or the master password. Flint runs sudo with each argument quoted as one word, never through a shell, so pass pipes on purpose: --sudo -- sh -c 'journalctl -u nginx | tail -n 50'. Flint types the host’s sudo password itself and leaves no cached sudo session.

A root period is the one exception: when the person turned on Allow sudo for a while in Settings, the root window offers 2, 5 or 15 minutes of root for your program on that one host. Inside it, --sudo on that host runs without a window, and every command shows in the person’s notice. A period never covers another host, a group, a plain exec or another program. Exit 17 not_sudoer or 18 sudo_password: tell the person.

--sudo needs Flint open with the vault unlocked; otherwise it fails with locked.

flint cp copies a file, or a folder with -r, to a host (<local> <alias>:<path>), from a host (<alias>:<path> <local>), or between two hosts (<alias>:<path> <alias>:<path>, through this machine). <alias>: alone is the login folder. An existing file is never replaced without --force. With --json it prints {host, to_host, direction, files, folders, bytes, skipped, duration_ms}.

With --json a command prints one JSON document on stdout: an object, or an array for list commands. exec prints {host, exit_code, signal, stdout, stderr, duration_ms} and exits with the remote status (255 for a signal). A Flint error prints nothing on stdout and one object on stderr, {"error":{"code":"not_found","message":"no host 'web-02'","id":"host.not_found","params":["web-02"]}}; id and params appear when the message has a stable id. So a remote exit 3 and a not_found error both exit 3: tell them apart by stdout.

No output ever holds a secret: hosts report has_password, keys has_passphrase.

0 is success. The codes are stable; scripts rely on them.

Exit Code Meaning and what to do
1 internal An unexpected failure. Report it to the person.
2 usage Bad command line: unknown command or flag, a missing argument. Fix the command; see this guide.
3 not_found No such vault, host, group, key, credential or tunnel. List them; never guess.
4 conflict Already exists, or still in use.
5 locked Nobody unlocked the vault within the approval wait, or Flint could not start. Run flint vault unlock (it waits for the person), then retry once.
6 wrong_password The master password is wrong. Only a person types it.
7 invalid A value breaks a rule (alias, port, colour, key format).
8 unsupported The vault was written by a newer Flint. Tell the person to update.
9 keychain The OS keychain refused (vault lock, vault forget, vault connect). Tell the person.
10 io The vault or a config file could not be read or written.
11 host_key A server key is unknown and could not be confirmed, or it changed. Stop and ask the person to check it; never pass --accept-new-host-key on your own.
12 auth The server accepted no login method in the vault, or a key’s passphrase is not stored (ssh.key_passphrase_needed). Tell the person: connecting once in Flint with Store passphrase in the vault ticked fixes the second.
13 network The host could not be reached, or the connection dropped: VPN, address, firewall.
14 timeout The command ran past --exec-timeout, or a server did not answer in time.
15 denied The person said no, or the grant or token does not cover this command. Never retry without asking.
16 approval_timeout Nobody answered Flint’s window within the approval wait. One retry is fair, then ask.
17 not_sudoer exec --sudo: the host’s login user may not use sudo. Tell the person.
18 sudo_password exec --sudo: sudo refused the password Flint typed, or Flint has none for that host. Tell the person.
19 permission_denied cp: the user may not read that file or write in that folder, here or on the host.
20 exists cp: the file is already there. Ask before passing --force.
21 not_a_directory cp: a path that has to be a folder is a file.
22 port_in_use tunnel up: another program holds that local port. Tell the person.
23 wrong_host_type A remote desktop host given to something only SSH does (exec, cp, host test, a tunnel).
24 refused A remote desktop server or a vault server answered and refused.

Offer the person, once, to turn this guide into a skill, or into the instructions file your tool reads, so you know Flint in later sessions. If they agree, write it in your own tool’s format and keep it short: a summary of How to work with Flint and the line “Run flint agent-guide for the commands, flags and exit codes.” Do not copy the reference into it: Flint’s updates change it, and flint agent-guide always matches the installed flint. Flint installs nothing in your tool’s folders.