Skip to content

CLI Reference ​

The tunnet CLI is the primary interface for interacting with Tunnet from the command line. It combines agent management, network operations, and all product features in a single binary.

Global flags ​

FlagEnvDescription
--state-dir <path>TUNNET_STATE_DIRAgent state directory (default: ~/.local/state/tunnet)
--json-logsTUNNET_JSON_LOGSOutput structured JSON logs

Command overview ​

CommandDescription
tunnet enrollRegister this machine with the control plane
tunnetd / tunnet serviceStart the agent daemon (TUN + mesh)
tunnet upBring TUN/DNS/routes up (daemon must be running)
tunnet downTear down TUN/DNS/routes; keep mesh alive
tunnet serviceInstall / control the OS service
tunnet reset --yesWipe local agent state
tunnet statusAgent / network status
tunnet pingMesh RTT over QUIC
tunnet dns statusPeerDNS configuration and cache
tunnet routeSubnet / hostname / exit routes
tunnet diagFull connectivity diagnostics
tunnet netcheckQuick pass/fail connectivity check
tunnet serveExpose a local port on the mesh
tunnet tunnelExpose a local port via a public edge
tunnet-edgeSeparate binary: public tunnel edge server
tunnet-relaySeparate binary: iroh connectivity relay (mesh DERP)
tunnet sendP2P file transfer over the mesh
tunnet sshIdentity-based SSH (OpenSSH wrapper; sessions / recordings / config)
tunnet ssh-keyscanPrint or refresh mesh SSH host keys
tunnet postureCollect / evaluate device posture attributes
tunnet loginSign in to management (device auth)
tunnet logoutClear stored management tokens
tunnet validateValidate tunnet.toml
tunnet reloadHot-reload firewall / DNS / logging from tunnet.toml
tunnet createCreate a Direct (P2P) network
tunnet joinJoin a Direct network with an invite
tunnet inviteCreate an invite code
tunnet leaveLeave one Direct network
tunnet override-ipOverride a peer IP (multi-network collisions)
tunnet connectEphemeral 2-peer connection (contact id)
tunnet requestsList pending join requests
tunnet acceptAccept a join request
tunnet denyDeny a join request
tunnet kickRemove a peer from a Direct network
tunnet firewallManage the local Direct firewall
tunnet policyManaged Policy as Code - validate, apply, export, rollback
tunnet coordinator-policyDirect-mode coordinator firewall (see Direct commands)
tunnet keep-aliveKeep a Direct peer connection always open
tunnet upgrade-to-managedMigrate from Direct to Managed
tunnet updateUpgrade the agent from GitHub Releases

Released under the AGPL-3.0 License.