อ้างอิงคำสั่ง FreeGuard CLI
FreeGuard CLI มีชุดคำสั่งครบถ้วนสำหรับจัดการการเชื่อมต่อ VPN, การสมัครสมาชิก และการกำหนดค่าจากเทอร์มินัล ทุกคำสั่งรองรับเอาต์พุต `--json` สำหรับการสคริปต์และการผสานรวมกับ AI agent

อ้างอิงคำสั่ง FreeGuard CLI

FreeGuard CLI มีชุดคำสั่งครบถ้วนสำหรับจัดการการเชื่อมต่อ VPN, การสมัครสมาชิก และการกำหนดค่าจากเทอร์มินัล ทุกคำสั่งรองรับเอาต์พุต --json สำหรับการสคริปต์และการผสานรวมกับ AI agent

Global Flags

แฟล็กเหล่านี้ใช้งานได้กับทุกคำสั่ง:

Flag Description
--json แสดงผลในรูปแบบ JSON (เหมาะสำหรับ agent)
--quiet, -q โหมดเงียบ แสดงเฉพาะผลลัพธ์
--verbose, -v แสดงผลแบบละเอียดพร้อมข้อมูล debug
--no-color ปิดการแสดงผลแบบมีสี
--lang <code> ภาษาของอินเทอร์เฟซ (auto, en, zh, ja, etc.)
--config <path> ใช้ไฟล์กำหนดค่าที่ระบุ

Connection

freeguard connect

เชื่อมต่อกับเซิร์ฟเวอร์ VPN หากไม่ระบุอาร์กิวเมนต์ จะเลือกโหนดที่เร็วที่สุดที่มีอยู่โดยอัตโนมัติ

# 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

เอาต์พุตแบบอ่านได้สำหรับมนุษย์:

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

เอาต์พุต JSON:

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

Flags:

Flag Description
--country <code> เชื่อมต่อกับโหนดที่ดีที่สุดในประเทศนี้ (ISO 3166-1 alpha-2)
--protocol <name> โปรโตคอลที่ต้องการ (anytls, hysteria2, vless, etc.)
--tun ใช้ TUN mode สำหรับ VPN ทั้งระบบ (ต้องมีสิทธิ์ระดับสูง)

freeguard disconnect

ตัดการเชื่อมต่อจากเซิร์ฟเวอร์ VPN ปัจจุบัน

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

freeguard status

แสดงสถานะการเชื่อมต่อปัจจุบันและสถิติทราฟฟิก

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

ยืนยันตัวตนด้วย FreeGuard รองรับการยืนยันอีเมล (ไม่ต้องมีบัญชี) หรือการเข้าสู่ระบบด้วยบัญชี 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> เข้าสู่ระบบด้วยการยืนยันอีเมล
--send-code ส่งรหัสยืนยันไปยังอีเมล
--code <digits> ส่งรหัสยืนยัน 6 หลัก
--account เข้าสู่ระบบด้วยบัญชี FreeGuard ผ่าน browser OAuth

freeguard logout

ล้างข้อมูลรับรองที่บันทึกไว้และตัดการเชื่อมต่อหากกำลังเชื่อมต่ออยู่

freeguard logout
✓ Logged out. Credentials cleared.

Subscription

freeguard subscribe list

ดูแผน Subscription ที่มีให้เลือกและสถานะ Subscription ปัจจุบันของคุณ

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

สร้าง Subscription ใหม่ เปิด browser ของคุณเพื่อชำระเงินผ่าน Stripe หรือ cryptocurrency

# Interactive plan selection
freeguard subscribe create

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

Flags:

Flag Description
--plan <name> แผน Subscription (basic, pro)
--email <address> อีเมลสำหรับส่งมอบ Subscription

Configuration

freeguard config get

อ่านค่าการกำหนดค่า

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

freeguard config set

เปลี่ยนค่าการกำหนดค่า

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

คีย์การกำหนดค่าที่ใช้บ่อย:

Key Default Description
proxy.port 7890 พอร์ตของ Proxy HTTP/SOCKS5
proxy.mode rule โหมด Proxy: rule, global, direct
core.api_port 9090 พอร์ต API ของ Mihomo
core.pinned_version (empty) ล็อก mihomo ไว้ที่เวอร์ชันเฉพาะ
dns.provider auto ผู้ให้บริการ DNS
update.auto_check true ตรวจสอบการอัปเดตเมื่อเริ่มต้น

freeguard config edit

เปิดไฟล์กำหนดค่าในโปรแกรมแก้ไขเริ่มต้นของคุณ

freeguard config edit

Diagnostics

freeguard doctor

เรียกใช้การตรวจสอบสภาพแวดล้อมอย่างครอบคลุมเพื่อวิเคราะห์ปัญหา

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

แสดงข้อมูลเวอร์ชันของ CLI และ 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+)

คำสั่งต่อไปนี้มีแผนจะเพิ่มในการเผยแพร่รุ่นอนาคต

freeguard node list

แสดงรายการโหนด VPN ที่มี พร้อมการกรองและการเรียงลำดับ

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

Flags:

Flag Description
--country <code> กรองตามรหัสประเทศ
--protocol <name> กรองตาม protocol
--sort <field> เรียงตาม speed, latency, หรือ load

freeguard node test

ทดสอบ latency และความเร็วของโหนด

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

freeguard monitor

แสดงการตรวจสอบทราฟฟิกแบบเรียลไทม์ในเทอร์มินัลของคุณ

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

freeguard core

จัดการเครื่องยนต์ mihomo พื้นฐาน

# Check core status
freeguard core status

# Update to latest core version
freeguard core update

# Restart the core engine
freeguard core restart

freeguard shell

เข้าสู่โหมด REPL แบบโต้ตอบสำหรับการรันหลายคำสั่งในเซสชันเดียว

freeguard shell

freeguard dashboard

เปิดแดชบอร์ด TUI พร้อมกราฟการรับส่งข้อมูลแบบเรียลไทม์ รายการโหนด และรายละเอียดการเชื่อมต่อ

freeguard dashboard

อัปเดตล่าสุด: มีนาคม 2026