Agent CLI

The agent is one binary, devgate, with the commands ngrok’s agent has. Flags take their value as --flag value or --flag=value.

Commands

CommandWhat it does
devgate http <port|address>Put a local HTTP service on a public URL. See agent endpoints for its flags.
devgate tcp <port>, devgate tls <port>A TCP service, or TLS passed through to a service with its own certificate: TCP and TLS.
devgate start <name>…, --allEndpoints from the config file.
devgateThe reserved endpoints pinned to this device; devgate select chooses them.
devgate config add-authtoken <token>Save your authtoken; devgate config check validates the config file.
devgate service install|start|stop|status|uninstallRun the agent as a system service.
devgate updateUpdate the agent to the latest version — see below.
devgate diagnoseCheck DNS, TLS, the tunnel server and your authtoken: diagnose.
devgate --versionPrint the agent’s version.

Any run takes --config <path> for another config file, and --log, --log-format and --log-level for its logs.

The terminal view

In a terminal the agent shows its endpoints, the connection counters and every request as it happens. Only the lines that change are redrawn, so you can select and copy a URL while the request log moves under it.

KeyWhat it does
Ctrl+SShare: the endpoint’s URL as a QR code, for a phone to scan. With several online, choose one with ↑↓ and Enter. Esc or Ctrl+S again goes back.
Ctrl+UUpdate and restart on the new version; shown only when one is out.
Ctrl+CStop the agent and take its endpoints offline.

The QR code is drawn black on white whatever your terminal’s colours, with a margin around it so a camera finds its edge. In a window of about 85×47 every module gets a cell of its own, which scans in any terminal. A smaller window, down to about 45×27, gets a code half the height, which leans on how the terminal draws block characters: if a camera struggles with it, the agent says how many more rows or columns bring the full-size code. Below that it says so and shows the URL as text.

Updating the agent

$ devgate update

The same as Ctrl+U, for scripts and servers: it downloads the latest release, checks it against the published SHA256SUMS and replaces the binary in place. It exits 0 when the agent is up to date or was updated, and 1 when it could not update. Agents already running keep their version until they restart — devgate service restart for the service.

  • Homebrew — brew upgrade devgate; devgate update says so.
  • Apt — sudo apt update && sudo apt upgrade devgate; devgate update says so, even under sudo.
  • Microsoft Store — the Store updates it (Library → Get updates); the agent never replaces itself there.
  • A binary in a directory you can’t write, such as one installed with sudo, needs sudo devgate update.

Questions people actually ask

How do I open my tunnel on a phone?

Press Ctrl+S in the terminal the agent runs in: it shows the endpoint’s URL as a QR code to scan. With several endpoints online, pick one with the arrow keys and Enter. Esc, or Ctrl+S again, goes back to the request log.

How do I update the agent from a script?

Run devgate update. It downloads the latest release, checks it against the published SHA256SUMS and replaces the binary in place; it exits 0 when the agent is up to date or was updated. Homebrew installs update with brew upgrade devgate, apt installs with sudo apt upgrade devgate, and the Microsoft Store build is updated by the Store.