闲社服务运行正常AI智能体自动化平台
a

Ambit CLI 工具

技能标识:ambit-cli

Use this skill for any task involving the ambit CLI: creating or destroying private networks, deploying apps to a private network, checking network or router health, listing routers, or diagnosing connectivity problems. Trigger phrases include "create a network", "set up ambit", "deploy with ambit", "ambit create", "ambit deploy", "ambit doctor", "check router status", "destroy a network", and similar.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 0.1.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

Ambit CLI 工具

Ambit CLI

Ambit 是什么

Ambit 以完全无法从公共互联网访问的方式将应用部署到云端。只有注册到用户私有 Tailscale 网络的设备才能连接到这些应用。从外部世界的角度来看,这个应用并不存在——没有可查找的 IP 地址,没有可扫描的端口。

这一点很重要,因为将数据库、仪表盘或内部工具放在普通互联网上,会迫使你构建登录页面、配置防火墙,并加固应用以抵御陌生人。Ambit 跳过了所有这些步骤。访问控制是在网络层面处理的:如果设备在 Tailscale 网络上,它就能访问应用;如果不在,连接在应用看到之前就被拒绝了。

你创建的每个私有网络都称为一个 ambit。部署到该网络的每个应用都会获得该网络名称下的人类可读地址——因此 http://my-app.lab 表示 lab ambit 上的 my-app 应用。这些地址对注册到用户 Tailscale 账户的任何设备都自动生效。

安装

如果尚未安装 ambit,可以通过 Nix 直接运行:

bash
npx @cardelli/ambit

工作原理

mermaid
graph LR
A[你的设备
在 Tailscale 上] -->|Tailscale 隧道| B[Ambit 路由器
Fly.io 虚拟机]
B -->|Flycast / 私有 IPv6| C[你的应用
无公网 IP]

Ambit 在 Fly.io 上创建一个路由器,该路由器加入用户的 Tailscale 网络,并通告该 ambit 的私有 IPv6 子网。它还设置拆分 DNS,使得 *. 查询解析到正确的应用。使用 ambit deploy 部署的应用会获得网络上的私有 Flycast 地址,且永远不会获得公网 IP。

前提条件

  • - flyctl 已安装并认证(fly auth login)
  • Tailscale 已安装并连接(tailscale up)
  • 已启用接受路由(sudo tailscale set --accept-routes)
  • Tailscale API 访问令牌(tskey-api-...)——在 https://login.tailscale.com/admin/settings/keys 创建

命令

ambit create

创建一个新的私有网络。这是设置新 ambit 时要运行的第一个命令。它在 Fly.io 上部署一个路由器,将其连接到用户的 Tailscale 网络,并配置拆分 DNS,使得网络上的应用可以通过名称访问。

bash
ambit create lab
ambit create lab --org my-org --region sea
ambit create lab --self-approve

标志:

  • - --org — Fly.io 组织标识
  • --region — Fly.io 区域(默认:iad)
  • --api-key — Tailscale API 访问令牌(如果省略则交互式提示)
  • --tag — 路由器的 Tailscale ACL 标签(默认:tag:ambit-)
  • --self-approve — 通过 Tailscale API 批准子网路由,而不是在 ACL 策略中要求 autoApprovers
  • -y, --yes — 跳过确认提示
  • --json — 以 JSON 格式输出

功能说明:

  1. 1. 验证 Fly.io 认证和 Tailscale API 密钥
  2. 检查标签(默认 tag:ambit-,或通过 --tag 自定义)是否存在于 Tailscale ACL tagOwners 中
  3. 检查 autoApprovers 配置(除非使用 --self-approve)
  4. 在自定义网络上创建 Fly.io 应用
  5. 设置密钥:TAILSCALEAPITOKEN、NETWORKNAME、TAILSCALETAGS
  6. 部署路由器容器
  7. 等待设备加入 tailnet
  8. 配置拆分 DNS(*. → 路由器)
  9. 如果可能,在本地启用接受路由

运行之前,用户必须在 https://login.tailscale.com/admin/acls/visual/tags 的 Tailscale ACL 设置中添加路由器的标签。标签默认为 tag:ambit-,但可以通过 --tag 覆盖。

并且可选地(或使用 --self-approve 跳过此步骤):
json
autoApprovers: { routes: { fdaa:X:XXXX::/48: [tag:ambit-] } }

ambit deploy --network

将应用部署到私有网络上。这是 fly deploy 的安全替代方案:它始终传递 --no-public-ips 和 --flycast,对 fly.toml 进行预检以检查危险设置,并审计结果以验证未分配公网 IP。

有三种互斥的部署模式:

配置模式(默认)——使用本地 fly.toml:
bash
ambit deploy my-app --network lab
ambit deploy my-app --network lab --config ./custom.toml

镜像模式——无需 fly.toml 部署 Docker 镜像:
bash
ambit deploy my-app --network lab --image registry.fly.io/my-app:latest
ambit deploy my-app --network lab --image registry.fly.io/my-app:latest --main-port 3000

模板模式——从 GitHub 仓库获取模板并部署:
bash
ambit deploy my-browser --network lab --template ToxicPine/ambit-templates/chromatic
ambit deploy my-browser --network lab --template ToxicPine/ambit-templates/chromatic@v1.0
ambit deploy my-shell --network lab --template ToxicPine/ambit-templates/wetty

标志:

  • - --network — 目标网络(必需)
  • --org — Fly.io 组织
  • --region — 主要区域
  • --config — fly.toml 的显式路径(配置模式)
  • --image — 要部署的 Docker 镜像(镜像模式)
  • --main-port — 镜像模式下 HTTP 服务的内部端口(默认:80,none 跳过)
  • --template — GitHub 模板引用(模板模式)
  • -y, --yes — 跳过确认
  • --json — 以 JSON 格式输出

模板引用格式:

owner/repo/path 从默认分支获取
owner/repo/path@tag 获取标记的发布版本
owner/repo/path@branch 获取特定分支
owner/repo/path@commit 获取特定提交

模板必须包含 fly.toml(通常还有 Dockerfile)。模板从 GitHub 的 tarball API 获取,提取目标子目录,进行预检扫描,然后部署。临时目录会自动清理。

ambit list

列出所有网络中发现的所有路由器。

bash
ambit list
ambit list --org my-org --json

显示:网络名称、应用名称、区域、机器状态、私有 IP、子网和 Tailscale 设备状态。

ambit status

显示详细的路由器状态。不带 --network 运行可查看所有路由器,带 --network 可聚焦于一个。

bash
ambit status
ambit status --network lab

详细视图包括:机器状态、SOCKS5 代理地址、Tailscale IP、在线状态、通告路由和拆分 DNS 配置。

ambit destroy --network

拆除路由器并清理所有相关资源。部署在网络上的应用不会被删除——仅移除路由器。用户需要手动删除网络标签的 ACL 策略条目。

bash
ambit destroy --network lab
ambit destroy --network lab --yes

功能说明:

  1. 1. 查找网络的路由器应用
  2. 清除拆分 DNS 配置
  3. 移除 Tailscale 设备
  4. 销毁 Fly.io 应用

ambit doctor

本地环境和路由器基础设施的健康检查。当出现问题时运行此命令——它会检查最常见的故障点并给出修复提示。

bash
ambit doctor
ambit doctor --network lab

检查项:

  • - Tailscale CLI 已安装
  • Tailscale 已连接(BackendState = Running)
  • 接受路由已启用
  • 路由器存在且机器正在运行
  • 路由器在 tailnet 中可见

模板

可在 ToxicPine/ambit-templates 获取的即用型部署模板:

模板描述
ToxicPine/ambit-templates/chromatic无头 Chrome,在端口 9222 上暴露 Chrome DevTools 协议——适用于需要在私有网络上使用浏览器的 AI 代理或脚本。
ToxicPine/ambit-templates/wetty
带有 Web 终端、持久化主目录、无密码 sudo 和自动启动/停止的云开发 shell。 |
| ToxicPine/ambit-templates/opencode

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 ambit-cli-1776320720 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 ambit-cli-1776320720 技能

通过命令行安装

skillhub install ambit-cli-1776320720

下载

⬇ 下载 ambit-cli v0.1.0(免费)

文件大小: 4.46 KB | 发布时间: 2026-4-16 17:18

v0.1.0 最新 2026-4-16 17:18
Initial release of ambit-cli: Deploy private, internet-invisible apps using Tailscale and Fly.io.

- Supports creating private networks ("ambits") with isolated access via Tailscale routing and split DNS.
- Enables deploying apps to these networks using local fly.toml, Docker images, or GitHub templates—with automatic safety checks.
- Provides commands to list routers, check network/router health, and view detailed status.
- Includes network teardown and resource cleanup via `ambit destroy`.
- Offers a `doctor` command for health checking and troubleshooting of all core components.
返回顶部