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
tunnet runStart the agent (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 relay
tunnet sendP2P file transfer over the mesh
tunnet sshIdentity-based SSH to a peer
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 policyCoordinator firewall policy
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.