CLI 参考
Server Core 运维 CLI 默认输出 JSON,适合人与自动化。命令前缀固定为 airlock --data-dir ... --token-file ...。
01全局选项
数据目录--data-dir <path>路由与状态存储;服务器上为 /var/lib/airlock。
控制令牌--token-file <path>0600 token 文件,用于 Unix 套接字认证。
超时--timeout 5s控制请求超时,默认数秒。
02状态与健康
路由健康routes health <alias>在路由预算内验证上游。
全部路由routes list列出脱敏摘要,不包含 Secret。
03路由生命周期
创建routes create <http|ssh|llm> --file <spec>SSH 路由默认停用;创建输出一次性本地凭据。
启停routes enable|disable <alias>停用保留配置。
删除routes delete <alias>删除路由与相关 Secret。
轮换routes rotate-credential <alias>立即作废旧本地凭据并输出新凭据。
紧急全停routes stop-all --yes禁用全部路由。
03路由生命周期
创建routes create <http|ssh|llm> --file <spec>SSH 路由默认停用;创建输出一次性本地凭据。
内容映射routes replacements list|set <alias> --file <spec>查看或整体替换 LLM 路由的字段映射。
启停routes enable|disable <alias>停用保留配置。
删除routes delete <alias>删除路由与相关 Secret。
轮换routes rotate-credential <alias>立即作废旧本地凭据并输出新凭据。
紧急全停routes stop-all --yes禁用全部路由。
04SSH 与代理
Host Key 探测ssh probe --address host:22 [--egress Auto]认证前停止,返回 host_key。
代理出口proxy set|clear --file <path>HTTP CONNECT / HTTPS CONNECT / SOCKS5 / SOCKS5H。
Tokentoken generate --output <path>生成 control 或 Web UI token(0600)。
05JSON 输出示例
airlock ... status{
"running": true,
"http_listen": "127.0.0.1:4768",
"ssh_listen": "127.0.0.1:4770",
"routes": [{ "alias": "releases", "enabled": true, "kind": "HTTP" }]
}
任何失败都会返回非零退出码并输出 JSON 错误;供脚本判断的稳定字段以 ok/error 顶层键为准(以实际命令输出为准)。
CLI reference
The Server Core operations CLI emits JSON by default for humans and automation. Commands share the prefix airlock --data-dir ... --token-file ....
01Global options
Data directory--data-dir <path>Route and state storage; /var/lib/airlock on servers.
Control token--token-file <path>0600 token file for Unix-socket authentication.
Timeout--timeout 5sControl request timeout.
02Status and health
Service statusstatusCore, listeners, and sanitized route summaries.
Route healthroutes health <alias>Verify the upstream within the route budget.
List routesroutes listSanitized summaries, no secrets.
03Route lifecycle
Createroutes create <http|ssh|llm> --file <spec>SSH routes start disabled; creation prints the one-time local credential.
Enable/disableroutes enable|disable <alias>Disable retains configuration.
Deleteroutes delete <alias>Removes the route and its secrets.
Rotateroutes rotate-credential <alias>Invalidates the old local credential and prints a new one.
Emergency stoproutes stop-all --yesDisables every route.
03Route lifecycle
Createroutes create <http|ssh|llm> --file <spec>SSH routes start disabled; creation prints the one-time local credential.
Content mappingroutes replacements list|set <alias> --file <spec>Inspect or replace the LLM route field mapping in one operation.
Enable/disableroutes enable|disable <alias>Disable retains configuration.
Deleteroutes delete <alias>Removes the route and its secrets.
Rotateroutes rotate-credential <alias>Invalidates the old local credential and prints a new one.
Emergency stoproutes stop-all --yesDisables every route.
04SSH and proxy
Host-key probessh probe --address host:22 [--egress Auto]Stops before authentication; returns host_key.
Proxy egressproxy set|clear --file <path>HTTP CONNECT / HTTPS CONNECT / SOCKS5 / SOCKS5H.
Tokentoken generate --output <path>Creates a control or Web UI token (0600).
05JSON output example
airlock ... status{
"running": true,
"http_listen": "127.0.0.1:4768",
"ssh_listen": "127.0.0.1:4770",
"routes": [{ "alias": "releases", "enabled": true, "kind": "HTTP" }]
}
Failures return a non-zero exit code with JSON output; rely on the command's documented stable fields for scripting.
CLI リファレンス
Server Core 運用 CLI は既定で JSON を出力します。共通プレフィックス:airlock --data-dir ... --token-file ...。
01グローバルオプション
データディレクトリ--data-dir <path>ルートと状態の保存先。サーバーでは /var/lib/airlock。
コントロールトークン--token-file <path>Unix ソケット認証用の 0600 トークンファイル。
タイムアウト--timeout 5sコントロールリクエストのタイムアウト。
02状態とヘルス
サービス状態statusコア、リスナー、サニタイズ済みルート要約。
ルートヘルスroutes health <alias>ルート予算内で上流を検証。
一覧routes listSecret を含まないサニタイズ要約。
03ルートライフサイクル
作成routes create <http|ssh|llm> --file <spec>SSH ルートは既定で無効。作成時にローカル認証情報が一度だけ出力。
有効化/無効化routes enable|disable <alias>無効化は設定を保持。
削除routes delete <alias>ルートと Secret を削除。
ローテーションroutes rotate-credential <alias>旧ローカル認証情報を即時無効化し新認証情報を出力。
緊急全停止routes stop-all --yes全ルートを無効化。
03ルートライフサイクル
作成routes create <http|ssh|llm> --file <spec>SSH ルートは既定で無効。作成時にローカル認証情報が一度だけ出力。
コンテンツマッピングroutes replacements list|set <alias> --file <spec>LLM ルートのフィールドマッピングを確認・一括置換します。
有効化/無効化routes enable|disable <alias>無効化は設定を保持。
削除routes delete <alias>ルートと Secret を削除。
ローテーションroutes rotate-credential <alias>旧ローカル認証情報を即時無効化し新認証情報を出力。
緊急全停止routes stop-all --yes全ルートを無効化。
04SSH とプロキシ
Host Key プローブssh probe --address host:22 [--egress Auto]認証前に停止し host_key を返す。
プロキシ出口proxy set|clear --file <path>HTTP CONNECT / HTTPS CONNECT / SOCKS5 / SOCKS5H。
トークンtoken generate --output <path>control または Web UI トークンを生成(0600)。
05JSON 出力例
airlock ... status{
"running": true,
"http_listen": "127.0.0.1:4768",
"ssh_listen": "127.0.0.1:4770",
"routes": [{ "alias": "releases", "enabled": true, "kind": "HTTP" }]
}
失敗時は非ゼロ終了コードと JSON エラーを返します。