FreeGuard CLI Commands Reference
FreeGuard CLI hutoa seti kamili ya amri za kusimamia muunganisho wako wa VPN, usajili, na usanidi kutoka terminal. Kila amri inasaidia matokeo ya `--json` kwa ajili ya scripting na ujumuishaji wa AI agent.

FreeGuard CLI Commands Reference

FreeGuard CLI hutoa seti kamili ya amri za kusimamia muunganisho wako wa VPN, usajili, na usanidi kutoka terminal. Kila amri inasaidia matokeo ya --json kwa ajili ya scripting na ujumuishaji wa AI agent.

Global Flags

Bendera hizi hufanya kazi na amri yoyote:

Flag Description
--json Toa matokeo katika format ya JSON (inayofaa kwa agent)
--quiet, -q Silent mode, toa matokeo pekee
--verbose, -v Matokeo ya kina yenye taarifa za debug
--no-color Zima matokeo ya rangi
--lang <code> Lugha ya interface (auto, en, zh, ja, etc.)
--config <path> Tumia faili mahususi ya usanidi

Connection

freeguard connect

Unganisha kwenye server ya VPN. Bila hoja, huchagua kiotomatiki node yenye kasi zaidi inayopatikana.

# Auto-connect to the best server
freeguard connect

# Connect to a specific node by ID
freeguard connect us-new-01

# Connect to the best server in a country
freeguard connect --country JP

# Use a specific protocol
freeguard connect --protocol anytls

# Enable TUN mode (requires sudo/admin)
freeguard connect --tun

Human-readable output:

✓ Connected to United States - New York (us-new-01)
  Protocol: anytls | Latency: 42ms
  Proxy: 127.0.0.1:7890 (HTTP/SOCKS5)

JSON output:

freeguard connect --json
{"status": "connected", "node": "us-new-01", "protocol": "anytls", "latency_ms": 42}

Flags:

Flag Description
--country <code> Unganisha kwenye node bora katika nchi hii (ISO 3166-1 alpha-2)
--protocol <name> Protocol inayopendekezwa (anytls, hysteria2, vless, etc.)
--tun Tumia TUN mode kwa VPN ya mfumo mzima (inahitaji ruhusa za juu)

freeguard disconnect

Tenganisha kutoka kwa server ya sasa ya VPN.

freeguard disconnect
✓ Disconnected
freeguard disconnect --json
{"status": "disconnected"}

freeguard status

Onyesha hali ya sasa ya muunganisho na takwimu za trafiki.

freeguard status
FreeGuard VPN Status
────────────────────
Status:     ● Connected
Node:       United States - New York (us-new-01)
Protocol:   anytls
Latency:    42ms
Upload:     1.2 MB/s
Download:   15.8 MB/s
Duration:   2h 15m
Mode:       System Proxy (HTTP/SOCKS5)
freeguard status --json
{
  "connected": true,
  "node": {"id": "us-new-01", "name": "United States - New York", "country": "US"},
  "protocol": "anytls",
  "latency_ms": 42,
  "traffic": {"upload_bps": 1258291, "download_bps": 16569754},
  "duration_seconds": 8100,
  "mode": "system_proxy",
  "proxy_port": {"mixed": 7890}
}

Authentication

freeguard login

Thibitisha utambulisho na FreeGuard. Inasaidia uthibitishaji kwa email (hakuna akaunti inahitajika) au kuingia kwa akaunti ya FreeGuard.

Email login (recommended):

# Step 1: Request verification code
freeguard login --email [email protected] --send-code

# Step 2: Enter the code
freeguard login --email [email protected] --code 123456
✓ Logged in successfully!
✓ Found 1 active subscription (Pro Plan, expires 2026-12-01)

Account login (opens browser):

freeguard login --account

Flags:

Flag Description
--email <address> Ingia kwa uthibitishaji wa email
--send-code Tuma msimbo wa uthibitishaji kwenye email
--code <digits> Wasilisha msimbo wa uthibitishaji wa tarakimu 6
--account Ingia kwa akaunti ya FreeGuard kupitia browser OAuth

freeguard logout

Futa kitambulisho kilichohifadhiwa na ukate muunganisho kama uko umeunganishwa kwa sasa.

freeguard logout
✓ Logged out. Credentials cleared.

Subscription

freeguard subscribe list

Tazama mipango ya subscription inayopatikana na hali ya sasa ya subscription yako.

freeguard subscribe list
Your Subscription
─────────────────
Plan:       Pro
Status:     Active
Expires:    2026-12-01
Traffic:    450 GB / Unlimited

Available Plans
───────────────
Plan        Monthly   Quarterly   Annual
Basic       $4.99     $12.99      $39.99
Pro         $9.99     $24.99      $79.99
freeguard subscribe list --json
{
  "current": {"plan": "pro", "status": "active", "expires": "2026-12-01"},
  "plans": [
    {"name": "basic", "prices": {"monthly": 4.99, "quarterly": 12.99, "annual": 39.99}},
    {"name": "pro", "prices": {"monthly": 9.99, "quarterly": 24.99, "annual": 79.99}}
  ]
}

freeguard subscribe create

Unda subscription mpya. Hufungua browser yako ili kukamilisha malipo kupitia Stripe au cryptocurrency.

# Interactive plan selection
freeguard subscribe create

# Specify plan directly
freeguard subscribe create --plan pro --email [email protected]

Flags:

Flag Description
--plan <name> Mpango wa subscription (basic, pro)
--email <address> Email kwa ajili ya kuwasilisha subscription

Configuration

freeguard config get

Soma thamani ya usanidi.

freeguard config get proxy.port
7890
freeguard config get proxy.port --json
{"key": "proxy.port", "value": 7890}

freeguard config set

Badilisha thamani ya usanidi.

freeguard config set proxy.port 8080
✓ proxy.port set to 8080

Vifunguo vya kawaida vya usanidi:

Key Default Description
proxy.port 7890 Port ya Proxy ya HTTP/SOCKS5
proxy.mode rule Hali ya Proxy: rule, global, direct
core.api_port 9090 Port ya Mihomo API
core.pinned_version (empty) Funga mihomo kwenye version mahususi
dns.provider auto Mtoa huduma wa DNS
update.auto_check true Kagua masasisho wakati wa kuanza

freeguard config edit

Fungua faili ya usanidi katika editor yako ya kawaida.

freeguard config edit

Diagnostics

freeguard doctor

Endesha ukaguzi wa kina wa mazingira ili kutambua matatizo.

freeguard doctor
FreeGuard Environment Check
───────────────────────────
✓ OS:              macOS 15.2 (arm64)
✓ CLI version:     v1.0.0
✓ Core version:    mihomo v1.19.21
✓ Config dir:      ~/.freeguard/
✓ Credentials:     Logged in (email: u***@example.com)
✓ Subscription:    Active (expires 2026-12-01)
✓ Network:         Internet reachable
✓ DNS:             Working (8.8.8.8)
✗ TUN permission:  Not available (run with sudo for TUN mode)
✓ Port 7890:       Available
✓ GeoIP database:  Up to date (2026-03-15)

Result: 10/11 checks passed. TUN mode requires elevated privileges.
freeguard doctor --json
{
  "checks": [
    {"name": "os", "status": "pass", "detail": "macOS 15.2 (arm64)"},
    {"name": "cli_version", "status": "pass", "detail": "v1.0.0"},
    {"name": "tun_permission", "status": "fail", "detail": "Not available (run with sudo)"}
  ],
  "passed": 10,
  "total": 11
}

freeguard version

Onyesha taarifa za version kwa CLI na core engine.

freeguard version
FreeGuard CLI v1.0.0
Core: mihomo v1.19.21
OS: darwin/arm64
freeguard version --json
{"cli": "1.0.0", "core": "1.19.21", "os": "darwin", "arch": "arm64"}

Advanced (Phase 2+)

Amri zifuatazo zimepangwa kwa matoleo ya baadaye.

freeguard node list

Orodhesha nodes za VPN zinazopatikana kwa kuchuja na kupanga.

freeguard node list
freeguard node list --country US --sort latency

Flags:

Flag Description
--country <code> Chuja kwa code ya nchi
--protocol <name> Chuja kwa protocol
--sort <field> Panga kwa speed, latency, au load

freeguard node test

Pima latency na kasi ya nodes.

freeguard node test us-new-01
freeguard node test --all

freeguard monitor

Onyesha ufuatiliaji wa trafiki wa wakati halisi kwenye terminal yako.

freeguard monitor
↑ 0.8 MB/s  ↓ 12.3 MB/s  Connections: 47

freeguard core

Dhibiti injini msingi ya mihomo.

# Angalia hali ya core
freeguard core status

# Sasisha hadi toleo la hivi karibuni la core
freeguard core update

# Anzisha upya injini ya core
freeguard core restart

freeguard shell

Ingiza hali ya maingiliano ya REPL kwa kuendesha amri nyingi katika kikao.

freeguard shell

freeguard dashboard

Fungua dashibodi ya TUI yenye grafu za trafiki za wakati halisi, orodha ya nodi, na maelezo ya muunganisho.

freeguard dashboard

Imesasishwa mara ya mwisho: Machi 2026