Reference
Agent command reference
Agent flags, local settings, configuration, and persisted state.
Run femtoport help for the built-in usage summary. The installed Unix service binary is named femtoport-agent; a foreground download is named femtoport by default. On Windows the executable has an .exe extension.
Run options
| Option | Meaning |
|---|---|
--token TOKEN | Agent token for the tunnel; overrides FEMTOPORT_AGENT_TOKEN. |
--target HOST:PORT | Local fallback target; server tunnel configuration wins when present. |
--edge-url URL | Override the agent endpoint; defaults to https://agents.femtoport.com. |
--dir PATH | Directory for local agent state. |
--config FILE | Load an environment-style configuration file. |
--log-level LEVEL | debug, info, warn, or error. |
--pretty-logs | Use the interactive display on a terminal and save that preference. |
--machine-logs | Use machine-readable logs for this run. |
--no-auto-update | Disable automatic updates for this process. |
--no-supervisor | Run the worker directly. |
--disable-backends | Block all local service backends. |
--disable-backend-ssh, --disable-backend-static, --disable-backend-proxy, --disable-backend-vnc, --disable-backend-files | Block the named service backend. |
--disable-desktop | Block all agent desktop operations. |
--disable-desktop-capture | Block screen streaming and snapshots. |
--disable-desktop-stream | Block screen streaming. |
--disable-desktop-snapshot | Block snapshots and display enumeration through the desktop action API. |
--disable-desktop-input | Block pointer, key, and text input and taking desktop control. |
--disable-desktop-pointer | Block pointer movement, buttons, and scrolling. |
--disable-desktop-keyboard | Block individual key events and bulk text insertion. |
--disable-desktop-key | Block individual key events and shortcuts. |
--disable-desktop-text | Block bulk text insertion. |
--disable-desktop-clipboard | Block clipboard exchange in both directions. |
--disable-desktop-clipboard-read | Block sending host clipboard text to the viewer. |
--disable-desktop-clipboard-write | Block sending viewer clipboard text to the host. |
--disable-desktop-audio | Block native desktop system audio capture. |
--disable-desktop-files | Block native desktop file transfers. |
--version | Print the version and exit. |
The token can also be supplied in FEMTOPORT_AGENT_TOKEN; treat it as a secret. A supplied token is saved to femtoport.token if no token file exists. A later supplied token takes precedence for that process but does not overwrite an existing token file automatically.
Commands
| Command | Meaning |
|---|---|
dashboard or dash | Open the terminal dashboard. |
settings or config | Open local settings, or use the noninteractive forms below. |
provision | On Linux and macOS, write service token, target, or edge URL and attempt to restart the service. |
uninstall --yes | Remove the installed service and binary; add --purge to remove service configuration too. |
help | Show usage. |
For example, femtoport settings get lists settings. femtoport settings set auto-update off changes a setting; keys are auto-update, pretty-logs, and verbose. Values accept on or off. femtoport settings disable ssh and femtoport settings enable ssh change a local feature restriction. The backends group covers ssh, static, proxy, vnc, and files; control-socket, e2e-tls, and auto-update remain separate. The group is available through settings and FEMTOPORT_AGENT_DISABLED_FEATURES, including an env-style configuration file. The desktop names described below are also available: for example, femtoport settings disable desktop-snapshot. Enabling a child removes only that child's saved restriction; a disabled parent or another policy source can still block it.
Changes to supported feature restrictions in femtoport.json or the env-style configuration file apply to running workers without a restart. The agent checks for changes every 500 ms and closes affected operations when it observes a new restriction. For example, femtoport settings disable e2e-tls closes active end-to-end TLS connections and refuses new passthrough connections; it never sends them to a plaintext backend. femtoport settings enable e2e-tls removes that saved restriction, and permitted connections can be opened again. femtoport settings disable auto-update cancels an update check, download, or candidate self-test in progress. An update that has already crossed its replacement boundary completes its handoff and recovery checks. A certificate order already received by the certificate authority cannot be undone by disabling E2E TLS.
The automatic-update setting is separate: femtoport settings set auto-update off changes auto_update in femtoport.json and requires a worker restart. Changes to FEMTOPORT_AGENT_AUTO_UPDATE in an env-style file also require a worker restart. Launch flags and explicit environment variables, including --no-auto-update and FEMTOPORT_AGENT_DISABLED_FEATURES, remain in force for that launch and its supervised workers. Removing a saved restriction cannot override them.
If femtoport.json or the configured env-style file becomes unreadable or malformed, the running agent disables its local backends, desktop operations, control socket, E2E TLS, and updater until it can read valid settings again. Removing a femtoport.json that the running worker has seen with restrictions has the same effect. A femtoport.json absent at a fresh process start is treated as the default; use launch flags or explicit environment restrictions when a restriction must remain in force even if the file is missing at startup.
Setting "disabled_features": null in a valid femtoport.json intentionally clears that file's saved restriction list. Restrictions from launch flags, environment variables, other policy files, and the server still apply. Deleting a restricted settings file or leaving it malformed instead triggers the fail-closed behavior above.
On Linux and macOS, femtoport-agent provision accepts --token, --target, --edge-url and --no-restart. Supply at least one of the first three. It chooses the service configuration location based on the current user and platform; run it in the same system or user context as the installation. A successful configuration write can still be followed by a failed service restart, in which case the command prints a manual restart hint.
Local state and precedence
The state directory is selected by --dir, then FEMTOPORT_AGENT_DIR, otherwise the executable's directory. femtoport.json stores shareable local settings; femtoport.token stores the secret token separately. femtoport-routers.json is a router-directory cache. Protect the token file and any service agent.env containing a token.
Flags and explicit environment settings take precedence over values loaded from femtoport.json. Disabled features from the environment and local settings are combined. The settings command refuses to overwrite a femtoport.json file that lacks its managed_by: "femtoport-agent" marker. Server configuration controls the runtime backend; local feature restrictions can disable capabilities.
Desktop capability restrictions
Agent desktop operations are allowed locally by default. Tunnel configuration and authentication still decide whether a remote user may reach the desktop. Each launch flag above restricts that process and its supervised workers for their lifetime; a local policy file cannot undo it. Restrictions have the following hierarchy:
desktop
capture
stream
snapshot
input
pointer
keyboard
key
text
clipboard
clipboard-read
clipboard-write
audio
files
Disabling a parent disables all of its children. For example, --disable-desktop-keyboard blocks both individual keys and bulk text, while leaving pointer input available. Clipboard exchange and desktop file transfers require a controlling viewer, so disabling input also blocks those operations. If they should remain available, disable the individual pointer, key, and text children instead. --disable-desktop-text only blocks bulk text insertion; it does not stop someone typing through ordinary key events. Similarly, a viewer allowed to stream the screen can save visible frames even if snapshots are disabled.
To change desktop permissions while the agent is running, create desktop-policy.json in the state directory. Each field is optional; an omitted field means allowed. For example:
{
"keyboard": false,
"text": true,
"snapshot": false,
"clipboard-read": false
}
Here keyboard: false also disables text, even though the child is set to true. Pointer input remains available, snapshots and host-to-viewer clipboard exchange are blocked, and the other operations retain their defaults. The allowed field names are exactly the names in the hierarchy above, with Boolean values.
The agent checks the file every 500 ms and revokes affected active operations and sessions when it observes a restriction. It accepts one JSON object of at most 64 KiB; unknown or duplicate fields, invalid types, incomplete writes, and extra data are rejected. A read or parse error disables all desktop capabilities until a valid policy is read. Once a running agent has observed the file, removing it also disables them until a valid file returns. Pending settings or token reloads wait until the policy is valid, then retry. Where supported, write a complete replacement and use the operating system's atomic file replacement operation to avoid temporarily disabling access during an edit.
If the policy file is absent when a fresh agent process starts, desktop capabilities default to allowed. This includes a fresh worker launched for an update or management restart, so such a restart after the file was removed starts from the allowed default. Use launch flags when restrictions must remain in force even if the policy file is missing. Explicitly setting a field to true only removes that field's restriction; it cannot override a disabled parent, a launch flag, another local restriction, or the server's authorization.
The FEMTOPORT_AGENT_DISABLED_FEATURES parameter and femtoport.json disabled_features list use the same names prefixed with desktop-, except that the root is simply desktop. For example, FEMTOPORT_AGENT_DISABLED_FEATURES=desktop-snapshot,desktop-clipboard-read blocks those two operations. Restrictions from these sources and the desktop policy file combine. The agent observes changes to the files while running; an unreadable or malformed settings file or duplicate disabled_features fields also disables desktop capabilities until repaired. The settings command currently writes femtoport.json in place, so a watcher may briefly observe an incomplete file and revoke active operations before the write finishes. An initially absent femtoport.json is allowed. If a settings file containing desktop restrictions is removed or becomes unreadable, the running agent disables desktop capabilities and waits for a valid replacement before reloading settings. A fresh process still treats an initially missing settings file as the default. If self-update replaces the process through its exec-fallback path, a pin previously read from femtoport.json or the env-style config may remain in force until a normal service restart; changes to desktop-policy.json remain live.
These controls apply to the agent's desktop operations, not to applications controlled through the desktop. Disabling clipboard access stops the agent's clipboard exchange; it cannot prevent a user from using an application's copy or paste commands while input is allowed. Applications can still use their own capture features if input is allowed. For a connection to an external VNC server, the agent cannot reliably separate its opaque operations, so it permits the connection only when every desktop capability is allowed. The existing vnc backend pin remains separate and disables that backend. Desktop controls do not inspect ordinary TCP forwarding, SSH, or the separate files backend.
Older agent versions do not understand the new child restrictions. An older agent rejects unknown policy fields and disables desktop access, and an unknown launch flag can prevent it from starting. Older agents also ignore unknown disabled-feature pins, so those pins alone cannot enforce the new restrictions after a downgrade. Check the agent version before relying on these controls across an update or rollback.
See agent installation for service locations and removal.