用途:tunnels 用于隧道生命周期管理,将本地端口通过安全 URL 公开,从而对外分享预览、报告和服务。
主要能力:创建隧道(aiter tunnel create --localPort 3000 --label "Preview" --expiresIn 3600),可关联项目(--projectId)、设置标签(--label)与过期秒数(--expiresIn,默认 3600 秒即 1 小时);列出活动隧道(aiter tunnel list);关闭指定隧道(aiter tunnel close --id tunnel-abc123);关闭全部隧道(aiter tunnel close-all)。创建成功返回 id、url、localPort、label、expiresAt、status 等字段。
使用方式:常见模式是文件服务器加隧道。先启动文件服务器(aiter server start --projectId project-123),获取文件本地 URL(aiter server url --projectId project-123 --filePath report.html),提取端口后创建隧道,再把公开 URL 通过消息或通知分享(aiter message send、aiter notify send)。
限制:最多 3 个并发隧道;默认过期 1 小时,最长 24 小时(86400 秒);到期自动关闭。隧道 URL 公开可访问,任何拿到 URL 的人都能访问内容;文件服务器令牌包含在本地 URL 中但不包含在隧道 URL 中;不要在没有额外认证的情况下隧道暴露数据库、管理面板等敏感服务;敏感内容应设置较短过期时间,并在接收方确认后立即关闭。建议始终设置过期时间、使用描述性标签、分享完成后主动关闭、创建前先查看列表,并在 .aiter/memory/journal.md 记录创建以便审计。
适用场景:对外分享 HTML 报告、预览页面、本地服务等。其他细节暂未提供。