FreeGuard CLI コマンドリファレンス
FreeGuard CLI は、ターミナルから VPN 接続、サブスクリプション、および設定を管理するための完全なコマンドセットを提供します。すべてのコマンドは、スクリプト作成や AI エージェント統合のために --json 出力をサポートしています。
グローバルフラグ
これらのフラグは任意のコマンドで使用できます:
| Flag | Description |
|---|---|
--json |
JSON 形式で出力(エージェント向け) |
--quiet, -q |
サイレントモード、結果のみ出力 |
--verbose, -v |
デバッグ情報を含む詳細出力 |
--no-color |
カラー出力を無効化 |
--lang <code> |
インターフェース言語(auto, en, zh, ja, など) |
--config <path> |
特定の設定ファイルを使用 |
接続
freeguard connect
VPN サーバーに接続します。引数がない場合は、利用可能な最速のノードを自動的に選択します。
# 最適なサーバーへ自動接続
freeguard connect
# ID で特定のノードに接続
freeguard connect us-new-01
# 国内で最適なサーバーに接続
freeguard connect --country JP
# 特定のプロトコルを使用
freeguard connect --protocol anytls
# TUN mode を有効化(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}
フラグ:
| Flag | Description |
|---|---|
--country <code> |
この国で最適なノードに接続(ISO 3166-1 alpha-2) |
--protocol <name> |
優先プロトコル(anytls, hysteria2, vless, など) |
--tun |
システム全体の VPN に TUN mode を使用(昇格した権限が必要) |
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}
}
認証
freeguard login
FreeGuard で認証します。メール認証(アカウント不要)または FreeGuard アカウントでのログインをサポートします。
メールログイン(推奨):
# ステップ 1: 認証コードを要求
freeguard login --email [email protected] --send-code
# ステップ 2: コードを入力
freeguard login --email [email protected] --code 123456
✓ Logged in successfully!
✓ Found 1 active subscription (Pro Plan, expires 2026-12-01)
アカウントログイン(ブラウザーを開きます):
freeguard login --account
フラグ:
| Flag | Description |
|---|---|
--email <address> |
メール認証でログイン |
--send-code |
認証コードをメールに送信 |
--code <digits> |
6 桁の認証コードを送信 |
--account |
ブラウザー OAuth を使用して FreeGuard アカウントでログイン |
freeguard logout
保存された認証情報を削除し、現在接続中であれば切断します。
freeguard logout
✓ Logged out. Credentials cleared.
サブスクリプション
freeguard subscribe list
利用可能なサブスクリプションプランと現在のサブスクリプション状態を表示します。
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
新しいサブスクリプションを作成します。Stripe または暗号通貨で支払いを完了するためにブラウザーが開きます。
# 対話形式のプラン選択
freeguard subscribe create
# プランを直接指定
freeguard subscribe create --plan pro --email [email protected]
フラグ:
| Flag | Description |
|---|---|
--plan <name> |
サブスクリプションプラン(basic, pro) |
--email <address> |
サブスクリプション送付先のメールアドレス |
設定
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 |
HTTP/SOCKS5 proxy port |
proxy.mode |
rule |
Proxy mode: rule, global, direct |
core.api_port |
9090 |
Mihomo API port |
core.pinned_version |
(empty) | mihomo を特定バージョンに固定 |
dns.provider |
auto |
DNS provider |
update.auto_check |
true |
起動時に更新を確認 |
freeguard config edit
デフォルトエディターで設定ファイルを開きます。
freeguard config edit
診断
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 とコアエンジンのバージョン情報を表示します。
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"}
高度な機能(Phase 2+)
以下のコマンドは将来のリリースで予定されています。
freeguard node list
フィルタリングと並べ替えを行いながら、利用可能な VPN ノードを一覧表示します。
freeguard node list
freeguard node list --country US --sort latency
フラグ:
| Flag | Description |
|---|---|
--country <code> |
国コードでフィルタリング |
--protocol <name> |
プロトコルでフィルタリング |
--sort <field> |
speed, latency, または load で並べ替え |
freeguard node test
ノードの latency と speed をテストします。
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
最終更新: March 2026