Sealos-native tunnel CLI

把本地服务发布到公网,也让本机直接访问集群内服务。

Sealtun 面向 Sealos/Kubernetes:开发预览用 expose,集群联调用 connect,认证、域名、审计、诊断和 Dashboard 都在同一套命令里。

npx skills add https://github.com/gitlayzer/sealtun
localhost -> public URL local machine -> cluster Service HTTPS / SSH / TCP Auth / rate limit / audit Dashboard / doctor / resources AI Skill ready

What Sealtun does

一句话:Sealtun 连接本地、集群和公网。

要给别人访问本地服务,用 expose;要从本机调集群内 Service、ClusterIP 或 Pod IP,用 connect;要治理入口,再加认证、临时链接、审计、诊断和资源查看。

Public entrances

三类入口,按场景选择。

Web 走 HTTPS,SSH 和数据库走 TCP,集群内服务访问走 connect。边界清楚,命令也短。

01

HTTPS 预览

本地 Web、回调、预览环境,一条命令得到公网 HTTPS URL。

sealtun expose 3000
02

公网 SSH

本地 sshd 变成公网 host 和 port,适合临时远程调试。

sealtun expose 22 --protocol ssh
03

通用 TCP

Postgres、Redis、MQTT 等非 HTTP 服务走四层 TCP。

sealtun expose 5432 --protocol tcp

v0.0.25 capabilities

常用能力压成四件事。

Expose

把本地端口发到公网

HTTPS、SSH、TCP 都能发布;HTTPS 还能绑定域名、加认证、开限流和审计。

expose 3000 expose 22 --protocol ssh domain add --wait
Connect

从本机访问集群内服务

Linux 上执行 connect 后,本机工具可直接访问 Service FQDN、ClusterIP 和 Pod IP。

Operate

看状态,找问题,安全修复

Dashboard、watch、resources、events、logs 和 doctor 覆盖日常排障。

Declare

把隧道写成 YAML

template、apply、diff、export 和 TTL 让团队配置可复用。

Codex Skill

不用先学 Sealtun,让 AI 先学会。

装上 Skill 后,直接告诉 AI 你要暴露哪个端口、访问哪个集群服务、绑定什么域名或加什么认证,它会按 Sealtun 的命令流程执行。

npx skills add https://github.com/gitlayzer/sealtun
01安装 Skill,让 AI 知道 Sealtun 的 CLI、YAML 和安全边界。
02用自然语言描述端口、协议、域名和访问规则。
03涉及 expose、apply、domain、cleanup 等状态变更时先确认。
04让 AI 处理命令细节、诊断输出和后续配置整理。

Install and operate

三步开始:登录、暴露或连接、再用 Dashboard 排障。

CLI 给人用,Skill 给 AI 用,sealtun.yaml 给团队复用。安装后先 login,再按场景选择 expose、connect 或 apply。

npx skills add https://github.com/gitlayzer/sealtun

# Then ask your AI agent:
# Expose localhost:3000, add Basic Auth,
# connect to a cluster Service, then export sealtun.yaml.
npm install -g sealtun
npx sealtun@latest --version
npx sealtun@latest login

sealtun login gzg --profile demo
sealtun profile use demo

sealtun init
sealtun init --protocol auto --json
sealtun init --apply

sealtun expose 3000
sealtun expose 22 --protocol ssh
sealtun expose 5432 --protocol tcp

sealtun connect --check
sudo sealtun connect
sealtun expose 3000 --domain app.example.com

sealtun domain plan <tunnel-id> app.example.com
sealtun domain add <tunnel-id> app.example.com --wait
sealtun domain verify <tunnel-id> --wait --timeout 5m
sealtun domain doctor <tunnel-id>
sealtun connect --check
sealtun connect --check --json

# Linux only. Runs in the foreground and cleans up on Ctrl-C.
sudo sealtun connect

curl http://my-service.default.svc.cluster.local:8080
curl http://10.96.0.12:8080   # Service ClusterIP
curl http://10.244.0.22:3000  # Pod IP

sealtun connect status
sudo sealtun disconnect
sealtun discover --json --limit 20
sealtun dashboard --open

sealtun resources <tunnel-id> --json
sealtun metrics <tunnel-id> --json
sealtun events <tunnel-id> --json

# Dashboard write dialogs preview the equivalent CLI command.
export SEALTUN_DASHBOARD_PASSWORD='change-me'
sealtun dashboard --addr 0.0.0.0 --allow-remote \
  --basic-auth-user admin \
  --basic-auth-password-env SEALTUN_DASHBOARD_PASSWORD
sealtun watch
sealtun watch <tunnel-id>
sealtun watch <tunnel-id> --json

sealtun doctor <tunnel-id>
sealtun doctor --fix --dry-run
sealtun doctor --fix

sealtun resources <tunnel-id>
sealtun cleanup <tunnel-id>
sealtun template https --name web --port 3000
sealtun template postgres --name db
sealtun export --all -o sealtun.yaml
sealtun export --all --include-secret-placeholders

sealtun apply -f sealtun.yaml --dry-run
sealtun diff -f sealtun.yaml
sealtun apply -f sealtun.yaml

# ttl in sealtun.yaml lets the daemon clean expired tunnels.

Open source and Sealos native

一句话:Sealtun 让本地、集群和公网互相可达,而且可治理。

查看源码