FreeGuard CLI: VPN in Your Terminal
FreeGuard CLI is a free, open-source command-line VPN client that lets you connect to VPN servers, manage your subscription, and automate your network security — all from the terminal. Whether you are a developer, sysadmin, or power user, the CLI gives you the fastest, most scriptable way to protect your internet connection.
Why Use a CLI VPN Client?
Graphical VPN apps are fine for casual use, but they fall short when you need speed, control, and automation. Here is why the CLI approach wins for technical users:
Raw Speed
The FreeGuard CLI connects in seconds. There is no GUI to load, no splash screen to wait for, and no unnecessary background processes. Launch your terminal, type one command, and you are connected.
freeguard connect
That is it. Your traffic is now encrypted and routed through the fastest available server.
Automation-Ready
Need to connect to a VPN before running a deployment script? Want to rotate servers every hour? The CLI integrates directly into shell scripts, cron jobs, and CI/CD pipelines.
#!/bin/bash
freeguard connect --server us-west
./deploy.sh
freeguard disconnect
Headless Server Support
Running a cloud instance with no desktop environment? The CLI works perfectly on headless servers. No X11, no Wayland, no problem. Install, authenticate, connect.
AI Agent Integration
This is what truly sets FreeGuard CLI apart. It is designed from the ground up to work with AI coding assistants like Claude Code, Cursor, and OpenClaw. AI agents can install, configure, and manage your VPN connection through natural conversation. No manual steps required.
Quick Install
Getting started takes less than a minute on any platform.
macOS
brew install freeguard/tap/freeguard
Linux (Ubuntu / Debian)
curl -fsSL https://cli.freeguard.com/install.sh | bash
Linux (Other Distributions)
curl -fsSL https://cli.freeguard.com/install.sh | bash
The installer detects your distribution and installs the appropriate package.
Windows
winget install FreeGuard.CLI
Verify Installation
freeguard --version
You should see the version number printed to stdout.
Your First Connection
Step 1: Log In
freeguard login
This opens your browser to authenticate. On headless servers, use email-based login:
freeguard login --method email
Step 2: Connect
freeguard connect
FreeGuard automatically selects the fastest server based on your location. To choose a specific region:
freeguard connect --server jp-tokyo
Step 3: Verify
freeguard status
This displays your connection status, current server, protocol, and uptime.
Step 4: Disconnect
freeguard disconnect
What Makes FreeGuard CLI Different
One-Command Setup
Other VPN CLIs require downloading config files, editing YAML, and managing certificates manually. FreeGuard CLI handles everything:
freeguard login && freeguard connect
Two commands. Zero config files.
Built for AI Agents
FreeGuard CLI is the first VPN client designed to be operated by AI assistants. Every command supports --json output and --no-color mode for machine parsing. AI agents on platforms like Claude Code can install and manage FreeGuard without any human intervention.
Modern Protocols
FreeGuard CLI supports Trojan, Hysteria2, and AnyTLS protocols out of the box. The client automatically selects the best protocol for your network conditions, or you can specify one manually:
freeguard connect --protocol hysteria2
Multi-Platform Parity
The same commands work identically on macOS, Linux, and Windows. Scripts you write on your Mac will run unchanged on your production servers.
Open Source
The CLI client is fully open source. You can audit the code, contribute features, or fork it for your own use.
Common Commands at a Glance
| Command | Description |
|---|---|
freeguard login |
Authenticate your account |
freeguard connect |
Connect to the fastest server |
freeguard connect --server <id> |
Connect to a specific server |
freeguard disconnect |
Disconnect from VPN |
freeguard status |
Show connection status |
freeguard servers |
List available servers |
freeguard config |
View or update settings |
freeguard logout |
Sign out |
Next Steps
- FreeGuard CLI overview — full feature list and documentation
- AI Agent Setup — let your AI assistant manage VPN for you
- Pricing — choose a plan that fits your usage
- CLI vs GUI — not sure which client to use? We compare them side by side
Last updated: March 2026