Command line
functual is the command you run on your own computer to reach your agents’ machines. It can list your agents,
open a shell, start Remote Desktop or VNC, and forward any port. It needs no VPN and no open inbound ports on the
machine. It uses the API, signed in as you or with an organization API key.
On machines that run Agent Functual, functual is already installed: it is the same program. The download below is
for laptops and workstations. It installs no service and changes nothing else.
Install
Section titled “Install”curl -fsSLO https://pkgs.functual.com/cli/latest/functual-linux-amd64.tar.gz # or functual-linux-arm64.tar.gztar -xzf functual-linux-amd64.tar.gzsudo install functual /usr/local/bin/ # or any folder on your PATH, e.g. ~/.local/binfunctual versionWindows
Section titled “Windows”In PowerShell:
Invoke-WebRequest https://pkgs.functual.com/cli/latest/functual-windows-x64.zip -OutFile functual.zipExpand-Archive functual.zip -DestinationPath "$env:LOCALAPPDATA\Functual"& "$env:LOCALAPPDATA\Functual\functual.exe" versionAdd %LOCALAPPDATA%\Functual to your PATH to run it as functual. functual.exe is signed by Functual, LLC.
A download for macOS is coming. On a Mac that runs Agent Functual, functual is already in /usr/local/bin.
Check the download
Section titled “Check the download”Every release has a SHA256SUMS file, signed with the same key as Functual’s Linux package repositories:
curl -fsSLO https://pkgs.functual.com/cli/latest/SHA256SUMScurl -fsSLO https://pkgs.functual.com/cli/latest/SHA256SUMS.asccurl -fsSL https://pkgs.functual.com/functual.asc | gpg --importgpg --verify SHA256SUMS.asc SHA256SUMSsha256sum --ignore-missing -c SHA256SUMSOn Windows, compare (Get-FileHash functual.zip).Hash with the functual-windows-x64.zip line in SHA256SUMS.
cli/latest/ always holds the newest release. A specific version stays at cli/<version>/, for example
https://pkgs.functual.com/cli/0.1.14/functual-linux-amd64.tar.gz. Use that form to pin a version in scripts.
Sign in
Section titled “Sign in”functual loginIt prints a link and a short code, and opens your browser if this computer has one. Open the link on any device, sign in to my.functual.com as usual, check that the code matches, pick the organization and approve. This also works in an SSH session or on a machine without a browser. Only approve a sign-in you started yourself: if someone sends you a code, deny it.
The CLI then acts as you, with your access in that organization. Everything it does appears in the Activity log under your name, “via CLI on <computer>”. If you leave the organization, the CLI stops working at once. The sign-in ends after 30 days without use. Profile → Signed-in computers at my.functual.com lists your computers and signs them out. Only owners and admins can use Agent Functual today.
The sign-in is saved for your user only, in ~/.config/functual/ on Linux, ~/Library/Application Support/functual/
on macOS and %APPDATA%\functual\ on Windows.
| Command | What it does |
|---|---|
functual whoami |
Shows who is signed in, the computer, the organization and the rate limit |
functual logout |
Signs this computer out |
With an API key (automation)
Section titled “With an API key (automation)”For CI, scheduled jobs and other automation that no person runs, use an organization API key instead. Create one in Agents → Settings → API keys. To connect to machines, the key needs connect access; listing agents only needs read. Then:
functual login --api-keyIt asks for the key without showing it, checks it, and saves it the same way. Keys are never passed as an argument, which other users could see in the process list. In a script, pipe the key in instead:
printf '%s\n' "$KEY" | functual login --api-keyfunctual logout only deletes a saved key; revoke it in the console to stop it working.
List agents
Section titled “List agents”functual agents # all agents except removed onesfunctual agents web # search by label, hostname or IDfunctual agents --status online # online, offline, active or revokedfunctual agents --json # the API's rows as JSON, for scriptsNAME HOSTNAME STATUS SYSTEM VERSION LAST SEEN IDWeb 1 web1 online ubuntu 24.04 amd64 0.1.14 now ccf033bc-6be9-4ab7-9918-6b2ffb3bfffdNAS nas offline debian 12 arm64 0.1.14 2 h ago 1f0e4c2a-…Choosing an agent
Section titled “Choosing an agent”Wherever a command takes <agent>, give its ID, label or hostname. Case doesn’t matter. A name must match
exactly one agent. If it matches several, or only partly, functual lists the candidates and stops, so it never
guesses which machine to open:
functual: no agent is called "web". Did you mean: ccf033bc-6be9-4ab7-9918-6b2ffb3bfffd Web 1 (web1, online)Connect
Section titled “Connect”Each command opens a remote access session on the agent. The agent picks it up at its next check-in (every 30 seconds), so connecting takes up to 30 seconds. The session closes when you disconnect. It also ends after its idle time with no traffic, at its maximum length, or when someone closes it in the console.
functual ssh admin@web1 # a shellfunctual ssh -l admin "Web 1" # the same, with -lfunctual ssh admin@web1 -- df -h / # run a command; its exit code is functual'sfunctual ssh -o ForwardAgent=yes admin@web1 # pass options to ssh (repeatable)functual ssh runs your own OpenSSH client (ssh, which macOS, Linux and Windows 10 and later include). You log in
to the machine’s own sshd with your usual account and key or password. The machine’s host key is checked end to
end, under the name functual-<first 8 characters of the agent ID> in your known_hosts. The connection to
Functual’s proxy uses a throwaway key that functual makes for each session and never saves.
Remote Desktop
Section titled “Remote Desktop”functual rdp "Windows VM"It forwards port 3389 to 127.0.0.1:3389 on your computer and opens your Remote Desktop app. That’s mstsc on
Windows, Windows App or Microsoft Remote Desktop on macOS, and FreeRDP or Remmina on Linux. Use --no-open to only
print the address, and --local <port> to pick the local port.
VNC and macOS Screen Sharing
Section titled “VNC and macOS Screen Sharing”functual vnc MacbookIt forwards port 5900 to 127.0.0.1:5901 and opens Screen Sharing on macOS, or vncviewer on Linux. Windows has no
built-in VNC viewer, so functual prints the address for yours (TigerVNC or RealVNC, for example). Port 5901 is
used because a Mac sharing its own screen already listens on 5900.
Any port
Section titled “Any port”functual forward web1 5432 # PostgreSQL on 127.0.0.1:5432functual forward --local 8443 web1 443 # the machine's web console on https://127.0.0.1:8443The port stays reachable on 127.0.0.1 until you press Ctrl-C. Several connections can share it, for example a
database client and a migration script. Ports below 1024 are moved up by 10000 locally (22 becomes 10022), so no
admin rights are needed. If the usual local port is taken, functual uses a free one and prints it.
The ports you can reach depend on your plan. Traffic to ports that aren’t usually encrypted (plain HTTP, VNC) is readable on the proxy; use them for what you would send over the internet anyway.
Scripting
Section titled “Scripting”- As you: a script you run yourself uses your
functual login, so its actions are recorded under your name. - API key: set
FUNCTUAL_API_KEYinstead of signing in, for example from your CI’s secret store. It takes precedence over a saved sign-in. - Output: progress messages go to stderr. stdout carries only the result: the table, the
--jsonrows, or the remote command’s output. - Exit codes:
functual sshexits with the remote command’s code.- Every other command exits
0on success,1on an error, with the reason on stderr, and2for wrong arguments.
- Rate limits: every command makes a few API calls. Free plans allow 60 a minute per key; see Rate limits.
A Python example that runs a command on every online agent:
import json, subprocess
agents = json.loads(subprocess.run(["functual", "agents", "--status", "online", "--json"], capture_output=True, text=True, check=True).stdout)for agent in agents: run = subprocess.run(["functual", "ssh", f"admin@{agent['id']}", "--", "uptime"], capture_output=True, text=True) print(agent["label"] or agent["hostname"], run.returncode, run.stdout.strip())Sessions run one after another here, because each counts as a connection toward your plan. On Free, that’s one at a time.
For anything the command line doesn’t do, call the API directly.