Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
feat(remote): guide remote access setup
cyhf10fe07fb231
diff --git a/README.md b/README.mdindex f97215a4b..f12bd0325 100644--- a/README.md+++ b/README.md@@ -58,6 +58,12 @@ curl -fsSL https://raw.githubusercontent.com/cyhhao/vibe-remote/master/install.sThat's it. Browser opens -> Follow the wizard -> Done.+Need to open the Web UI from another device or a remote server? Run:++```bash+vibe remote+```+<details><summary><b>Windows?</b></summary>@@ -332,15 +338,17 @@ vibe stop && uv tool uninstall vibe-remote && rm -rf ~/.vibe_remote- **WeChat Setup Guide** — Follow the in-app wizard (`vibe` → choose WeChat)- **Lark Setup Guide** — Follow the in-app wizard (`vibe` → choose Lark)-## Remote Server Tip (SSH)+## Remote Web UI Access-If you run Vibe Remote on a remote server, keep the Web UI bound to `127.0.0.1:5123` and access it via SSH port forwarding:+If you want to open the local Web UI from another device, or you run Vibe Remote on a remote server, use the guided remote-access setup:```bash-ssh -NL 5123:localhost:5123 user@server-ip+vibe remote```-See: **[CLI Reference](docs/CLI.md)** (search for "Remote Web UI Access")+It guides you through avibe.bot sign-in, personal domain setup, pairing, and starting the secure tunnel.++See: **[CLI Reference](docs/CLI.md)**.---diff --git a/README_ZH.md b/README_ZH.mdindex c906db377..9f97f92fe 100644--- a/README_ZH.md+++ b/README_ZH.md@@ -58,6 +58,12 @@ curl -fsSL https://raw.githubusercontent.com/cyhhao/vibe-remote/master/install.s完事。浏览器打开 -> 跟着向导走 -> 搞定。+如果你希望从另一台设备或远端服务器打开 Web UI,运行:++```bash+vibe remote+```+<details><summary><b>Windows?</b></summary>@@ -332,15 +338,17 @@ vibe stop && uv tool uninstall vibe-remote && rm -rf ~/.vibe_remote- **微信配置指南** — 运行 `vibe` 后在向导中选择微信即可- **飞书配置指南** — 运行 `vibe` 后在向导中选择飞书即可-## 远端服务器提示(SSH)+## 远程访问 Web UI-如果你把 Vibe Remote 部署在远端服务器上,请保持 Web UI 只监听在 `127.0.0.1:5123`,并通过 SSH 端口转发在本机访问:+如果你希望从另一台设备打开本机 Web UI,或者把 Vibe Remote 部署在远端服务器上,请使用引导式远程访问配置:```bash-ssh -NL 5123:localhost:5123 user@server-ip+vibe remote```-详见:**[CLI 参考手册](docs/CLI_ZH.md)**(搜索"远端服务器访问 Web UI")+它会引导你登录 avibe.bot、领取个人域名、完成配对,并启动安全 tunnel。++详见:**[CLI 参考手册](docs/CLI_ZH.md)**。---diff --git a/docs/CLI.md b/docs/CLI.mdindex 504b8a65f..3b2ee7cb4 100644--- a/docs/CLI.md+++ b/docs/CLI.md@@ -5,60 +5,24 @@```bashvibe # Start Vibe Remote (opens web UI)vibe status # Check service status+vibe remote # Guided Vibe Cloud remote-access setupvibe screenshot # Capture a local desktop screenshotvibe stop # Stop all services```## Commands-## Remote Web UI Access (SSH Port Forwarding)+## Remote Web UI AccessBy default, the Web UI binds to `127.0.0.1:5123` on the machine where Vibe Remote is running.-If you deploy Vibe Remote on a remote server, **do not expose the UI port to the public internet**.-Instead, use SSH local port forwarding so the UI is only reachable from your own computer.--### 1) Start Vibe Remote on the server--SSH into your server and start Vibe Remote:--```bash-vibe-```--The server-side UI is still only reachable on the server itself:--- `http://127.0.0.1:5123`--### 2) Forward the UI port to your local machine--On your **local machine** (your laptop/desktop), run:+If you want to open the Web UI from another device, or you installed Vibe Remote on a remote server, use the guided remote-access setup:```bash-ssh -NL 5123:localhost:5123 user@server-ip+vibe remote```-Then open:--- `http://127.0.0.1:5123`--### Tips--- If `5123` is already in use on your local machine, pick another local port:--```bash-ssh -NL 15123:localhost:5123 user@server-ip-```--and open `http://127.0.0.1:15123`.--- If your SSH server runs on a non-standard port:--```bash-ssh -p 2222 -NL 5123:localhost:5123 user@server-ip-```--- `-N` means "do not run a remote command"; the SSH session is used only for tunneling.+The command walks you through signing in at `https://avibe.bot`, creating a remote-access bot, claiming your personal domain, pasting the one-time pairing key, and starting the secure tunnel.### `vibe`@@ -118,6 +82,36 @@ vibe doctor- Agent CLI availability (Claude Code, OpenCode, Codex)- Runtime environment+### `vibe remote`++Start the guided Vibe Cloud remote-access setup.++```bash+vibe remote+```++**Flow:**+- The CLI explains what remote access does before asking for anything.+- Open `https://avibe.bot`, sign up or log in, create a new remote-access bot, claim your personal domain, and copy the one-time pairing key.+- Press Enter in the CLI, paste the pairing key, and Vibe Remote saves the config and starts the managed tunnel automatically.+- On success, the CLI prints your remote URL and the next commands for checking or stopping the tunnel. When you open the URL, sign in with the same avibe.bot account.++If you already have a pairing key and want to skip the guided copy, use:++```bash+vibe remote pair vrp_abc123+```++Useful follow-up commands:++```bash+vibe remote status+vibe remote start+vibe remote stop+```++Use `--json` on these subcommands for machine-readable output.+### `vibe screenshot`Capture the local desktop as a PNG file.diff --git a/docs/CLI_ZH.md b/docs/CLI_ZH.mdindex 9af5d7c30..0994e6d48 100644--- a/docs/CLI_ZH.md+++ b/docs/CLI_ZH.md@@ -5,60 +5,24 @@```bashvibe # 启动 Vibe Remote(打开 Web UI)vibe status # 查看服务状态+vibe remote # 引导式配置 Vibe Cloud 远程访问vibe screenshot # 截取本机桌面截图vibe stop # 停止所有服务```## 命令详解-## 远端服务器访问 Web UI(SSH 端口转发)+## 远程访问 Web UI默认情况下,Web UI 只监听在运行 Vibe Remote 的那台机器的 `127.0.0.1:5123`。-如果你把 Vibe Remote 部署在远端服务器上,**不建议把 UI 端口直接暴露到公网**。-推荐使用 SSH 本地端口转发,把远端的 UI 端口安全地映射到你自己的电脑上访问。--### 1)在服务器上启动 Vibe Remote--先 SSH 登录到服务器并启动:--```bash-vibe-```--此时 UI 仍然只能在服务器本机访问:--- `http://127.0.0.1:5123`--### 2)把 UI 端口转发到本机--在你自己的电脑(本地)执行:+如果你希望从另一台设备打开 Web UI,或者把 Vibe Remote 安装在远端服务器上,请使用引导式远程访问配置:```bash-ssh -NL 5123:localhost:5123 user@server-ip+vibe remote```-然后在本机浏览器打开:--- `http://127.0.0.1:5123`--### 小贴士--- 如果你本机的 `5123` 端口已被占用,可以换一个本地端口:--```bash-ssh -NL 15123:localhost:5123 user@server-ip-```--然后打开 `http://127.0.0.1:15123`。--- 如果服务器 SSH 端口不是 22:--```bash-ssh -p 2222 -NL 5123:localhost:5123 user@server-ip-```--- `-N` 表示不在远端执行命令,这条 SSH 连接只用于建立隧道。+这个命令会引导你登录 `https://avibe.bot`、创建 remote-access bot、领取个人专属域名、粘贴一次性 pairing key,并自动启动安全 tunnel。### `vibe`@@ -118,6 +82,36 @@ vibe doctor- Agent CLI 可用性(Claude Code、OpenCode、Codex)- 运行时环境+### `vibe remote`++启动 Vibe Cloud 远程访问的引导式配置流程。++```bash+vibe remote+```++**流程:**+- CLI 会先解释远程访问的作用,不会一上来就要求输入配对码。+- 打开 `https://avibe.bot`,注册或登录,创建新的 remote-access bot,领取自己的个人域名,然后复制一次性 pairing key。+- 回到 CLI 按 Enter,粘贴 pairing key,Vibe Remote 会自动保存配置并启动托管 tunnel。+- 启动成功后,CLI 会展示远程访问链接,并给出查看状态、重新启动、停止远程访问的后续命令。打开链接时,请使用同一个 avibe.bot 账号登录。++如果你已经拿到 pairing key,也可以用直接配对命令:++```bash+vibe remote pair vrp_abc123+```++常用后续命令:++```bash+vibe remote status+vibe remote start+vibe remote stop+```++这些子命令都支持 `--json` 输出,便于脚本调用。+### `vibe screenshot`截取本机桌面并保存为 PNG 文件。diff --git a/docs/COMMANDS.md b/docs/COMMANDS.mdindex 01d1ac2e0..a4180b6be 100644--- a/docs/COMMANDS.md+++ b/docs/COMMANDS.md@@ -522,6 +522,7 @@ The `vibe` executable controls the local service and async automation features.| `vibe restart` | Stop then start again || `vibe status` | Print runtime status JSON || `vibe doctor` | Run diagnostics |+| `vibe remote` | Guided Vibe Cloud remote Web UI setup || `vibe screenshot` | Capture a local desktop screenshot || `vibe version` | Show installed version || `vibe check-update` | Check for new version |@@ -594,6 +595,31 @@ vibe doctor- checks backend CLI availability- checks runtime environment+### `vibe remote`++```bash+vibe remote+```++- starts the guided Vibe Cloud remote-access setup+- explains what remote access does before asking for a pairing key+- guides the user to open `https://avibe.bot`, create a remote-access bot, claim a personal domain, and copy the one-time pairing key+- saves remote-access credentials and starts the secure tunnel after pairing++Useful follow-up commands:++```bash+vibe remote status+vibe remote start+vibe remote stop+```++If you already have a pairing key:++```bash+vibe remote pair vrp_abc123+```+### `vibe screenshot````bashdiff --git a/docs/COMMANDS_ZH.md b/docs/COMMANDS_ZH.mdindex b7ed03340..17eebd7c2 100644--- a/docs/COMMANDS_ZH.md+++ b/docs/COMMANDS_ZH.md@@ -501,6 +501,7 @@ bind vr-a3x9k2| `vibe restart` | 停止后重新启动 || `vibe status` | 输出运行状态 JSON || `vibe doctor` | 运行诊断 |+| `vibe remote` | 引导式配置 Vibe Cloud 远程 Web UI || `vibe screenshot` | 截取本机桌面截图 || `vibe version` | 查看当前版本 || `vibe check-update` | 检查是否有新版本 |@@ -573,6 +574,31 @@ vibe doctor- 检查 backend CLI 是否可用- 检查运行环境+### `vibe remote`++```bash+vibe remote+```++- 启动 Vibe Cloud 远程访问的引导式配置+- 先解释远程访问的作用,再请求 pairing key+- 引导用户打开 `https://avibe.bot`,创建 remote-access bot,领取个人域名,并复制一次性 pairing key+- 配对后保存远程访问凭证,并启动安全 tunnel++常用后续命令:++```bash+vibe remote status+vibe remote start+vibe remote stop+```++如果你已经拿到 pairing key:++```bash+vibe remote pair vrp_abc123+```+### `vibe screenshot````bashdiff --git a/install.sh b/install.shindex ee6a4da5b..202974893 100755--- a/install.sh+++ b/install.sh@@ -342,18 +342,21 @@ print_next_steps() {echo ""echo -e "${BLUE}Next steps:${NC}"if is_vibe_immediately_available; then- echo " 1. Run 'vibe' to start the setup wizard"- echo " 2. Configure your Slack app tokens in the web UI"- echo " 3. Enable channels and start chatting with AI agents"+ echo " 1. Run 'vibe' to open the setup wizard"+ echo " 2. Choose your chat platform and agent backend"+ echo " 3. Enable a channel or DM and send your first task"+ echo " 4. Optional: run 'vibe remote' to open the Web UI from another device"elseecho " 1. Run 'export PATH=\"${vibe_dir}:\$PATH\"' in your shell"- echo " 2. Run 'vibe' to start the setup wizard"- echo " 3. Configure your Slack app tokens in the web UI"- echo " 4. Enable channels and start chatting with AI agents"+ echo " 2. Run 'vibe' to open the setup wizard"+ echo " 3. Choose your chat platform and agent backend"+ echo " 4. Enable a channel or DM and send your first task"+ echo " 5. Optional: run 'vibe remote' to open the Web UI from another device"fiecho ""echo -e "${BLUE}Quick commands:${NC}"echo " vibe - Start Vibe Remote (service + web UI)"+ echo " vibe remote - Set up remote Web UI access"echo " vibe status - Check service status"echo " vibe stop - Stop all services"echo " vibe doctor - Run diagnostics"diff --git a/tests/test_cli_setup_status.py b/tests/test_cli_setup_status.pyindex 2bea59cea..6c9610a23 100644--- a/tests/test_cli_setup_status.py+++ b/tests/test_cli_setup_status.py@@ -14,7 +14,7 @@ def _config_with_setup_state(*, ready: bool) -> SimpleNamespace:)-def test_cmd_vibe_marks_setup_when_no_enabled_platform_has_credentials() -> None:+def test_cmd_vibe_marks_setup_when_no_enabled_platform_has_credentials(capsys) -> None:config = _config_with_setup_state(ready=False)with (@@ -30,6 +30,9 @@ def test_cmd_vibe_marks_setup_when_no_enabled_platform_has_credentials() -> Nonecli.cmd_vibe()write_status.assert_called_once_with("setup", "missing platform credentials")+ output = capsys.readouterr().out+ assert "Run: vibe remote" in output+ assert "SSH port forwarding" not in outputdef test_cmd_vibe_marks_starting_when_non_slack_platform_is_configured() -> None:diff --git a/tests/test_install_script.py b/tests/test_install_script.pyindex 873befadc..ab57dd65c 100644--- a/tests/test_install_script.py+++ b/tests/test_install_script.py@@ -83,7 +83,8 @@ def test_install_script_keeps_vibe_available_on_current_path(tmp_path):version_result = _vibe_version(env)assert install_result.returncode == 0, install_result.stdout + install_result.stderr- assert "Run 'vibe' to start the setup wizard" in install_result.stdout+ assert "Run 'vibe' to open the setup wizard" in install_result.stdout+ assert "vibe remote - Set up remote Web UI access" in install_result.stdoutassert "export PATH=" not in install_result.stdoutassert version_result.returncode == 0, version_result.stdout + version_result.stderrassert "vibe-remote 9.9.9" in version_result.stdoutdiff --git a/tests/test_vibe_cli.py b/tests/test_vibe_cli.pyindex eeee06bd4..11c2dbacc 100644--- a/tests/test_vibe_cli.py+++ b/tests/test_vibe_cli.py@@ -5,11 +5,13 @@ import signalimport shleximport sysfrom pathlib import Path+from types import SimpleNamespacefrom unittest.mock import patchfrom config import pathsfrom vibe import runtimefrom vibe import cli+from vibe import remote_accessdef test_default_config_written(tmp_path, monkeypatch):@@ -182,6 +184,179 @@ def test_restart_parser_accepts_delay_seconds():assert args.delay_seconds == 60+def test_remote_parser_accepts_pairing_command():+ parser = cli.build_parser()+ args = parser.parse_args(["remote", "pair", "vrp_test", "--device-name", "Mac Studio"])++ assert args.command == "remote"+ assert args.remote_command == "pair"+ assert args.pairing_key == "vrp_test"+ assert args.device_name == "Mac Studio"+++def test_remote_parser_allows_guided_setup_without_subcommand():+ parser = cli.build_parser()+ args = parser.parse_args(["remote"])++ assert args.command == "remote"+ assert args.remote_command is None+++def test_remote_parser_accepts_status_json():+ parser = cli.build_parser()+ args = parser.parse_args(["remote", "status", "--json"])++ assert args.command == "remote"+ assert args.remote_command == "status"+ assert args.json is True+++def test_cmd_remote_pair_prompts_and_reports_success(monkeypatch, capsys):+ captured = {}++ monkeypatch.setattr(cli.getpass, "getpass", lambda prompt: "vrp_prompt")++ def fake_pair(pairing_key: str, backend_url: str, device_name: str):+ captured.update(+ {+ "pairing_key": pairing_key,+ "backend_url": backend_url,+ "device_name": device_name,+ }+ )+ return {+ "ok": True,+ "public_url": "https://alex.avibe.bot",+ "running": True,+ "start": {"ok": True},+ }++ monkeypatch.setattr(remote_access, "pair", fake_pair)++ result = cli.cmd_remote_pair(+ SimpleNamespace(+ pairing_key=None,+ backend_url="https://backend.test",+ device_name="Mac Studio",+ json=False,+ )+ )++ assert result == 0+ assert captured == {+ "pairing_key": "vrp_prompt",+ "backend_url": "https://backend.test",+ "device_name": "Mac Studio",+ }+ output = capsys.readouterr().out+ assert "Remote access is ready" in output+ assert "https://alex.avibe.bot" in output+ assert "vibe remote status" in output+++def test_cmd_remote_setup_explains_before_prompting_for_key(monkeypatch, capsys):+ events = []++ monkeypatch.setattr(remote_access, "status", lambda: {"ok": True, "paired": False})+ monkeypatch.setattr("builtins.input", lambda prompt: events.append(("ready", prompt)) or "")+ monkeypatch.setattr(cli.getpass, "getpass", lambda prompt: events.append(("key", prompt)) or "vrp_prompt")++ def fake_pair(pairing_key: str, backend_url: str, device_name: str):+ events.append(("pair", pairing_key, backend_url, device_name))+ return {+ "ok": True,+ "public_url": "https://alex.avibe.bot",+ "running": True,+ "start": {"ok": True},+ }++ monkeypatch.setattr(remote_access, "pair", fake_pair)++ result = cli.cmd_remote_setup(SimpleNamespace(remote_command=None))++ assert result == 0+ assert events == [+ ("ready", "Press Enter when you have copied the pairing key, or Ctrl+C to cancel."),+ ("key", "Paste pairing key (input hidden): "),+ ("pair", "vrp_prompt", "https://avibe.bot", "Vibe Remote"),+ ]+ output = capsys.readouterr().out+ assert "Open https://avibe.bot" in output+ assert "Create a new remote-access bot" in output+ assert "Copy the one-time pairing key" in output+ assert output.index("Open https://avibe.bot") < output.index("Pairing this device")+++def test_cmd_remote_setup_shows_existing_pairing_without_prompt(monkeypatch, capsys):+ events = []++ monkeypatch.setattr(+ remote_access,+ "status",+ lambda: {+ "ok": True,+ "paired": True,+ "running": True,+ "public_url": "https://alex.avibe.bot",+ },+ )+ monkeypatch.setattr("builtins.input", lambda prompt: events.append(("ready", prompt)) or "")+ monkeypatch.setattr(cli.getpass, "getpass", lambda prompt: events.append(("key", prompt)) or "vrp_prompt")+ monkeypatch.setattr(remote_access, "pair", lambda *args, **kwargs: events.append(("pair", args, kwargs)))++ result = cli.cmd_remote_setup(SimpleNamespace(remote_command=None))++ assert result == 0+ assert events == []+ output = capsys.readouterr().out+ assert "Remote access is already configured." in output+ assert "https://alex.avibe.bot" in output+ assert "vibe remote pair" in output+++def test_cmd_remote_pair_maps_invalid_key_to_user_action(monkeypatch, capsys):+ monkeypatch.setattr(+ remote_access,+ "pair",+ lambda *args, **kwargs: {"ok": False, "error": "invalid_pairing_key", "status": 400},+ )++ result = cli.cmd_remote_pair(+ SimpleNamespace(+ pairing_key="vrp_bad",+ backend_url="https://backend.test",+ device_name="Mac Studio",+ json=False,+ )+ )++ assert result == 1+ error_output = capsys.readouterr().err+ assert "Pairing key is invalid or expired." in error_output+ assert "https://avibe.bot" in error_output+ assert "vibe remote" in error_output+++def test_cmd_remote_pair_missing_key_fails_without_request(monkeypatch, capsys):+ pair_calls = []++ monkeypatch.setattr(cli.getpass, "getpass", lambda prompt: "")+ monkeypatch.setattr(remote_access, "pair", lambda *args, **kwargs: pair_calls.append(args))++ result = cli.cmd_remote_pair(+ SimpleNamespace(+ pairing_key=None,+ backend_url="https://backend.test",+ device_name="Mac Studio",+ json=False,+ )+ )++ assert result == 1+ assert pair_calls == []+ assert "missing pairing key" in capsys.readouterr().err++@pytest.mark.parametrize("raw_value", ["nan", "inf", "-inf"])def test_restart_parser_rejects_non_finite_delay_seconds(raw_value):parser = cli.build_parser()diff --git a/ui/src/components/RemoteAccess.tsx b/ui/src/components/RemoteAccess.tsxindex 6847d26d5..89ae90b8e 100644--- a/ui/src/components/RemoteAccess.tsx+++ b/ui/src/components/RemoteAccess.tsx@@ -154,6 +154,17 @@ export const RemoteAccess: React.FC = () => {</a></div>+ {showPairingForm && (+ <div className="rounded-xl border border-cyan-200 bg-cyan-50 p-4 text-sm text-cyan-950">+ <div className="font-semibold">{t('remoteAccess.flowTitle')}</div>+ <ol className="mt-2 list-decimal space-y-1 pl-5">+ <li>{t('remoteAccess.flowStep1')}</li>+ <li>{t('remoteAccess.flowStep2')}</li>+ <li>{t('remoteAccess.flowStep3')}</li>+ </ol>+ </div>+ )}+{showPairingForm ? (<><label className="block space-y-2">@@ -211,15 +222,6 @@ export const RemoteAccess: React.FC = () => {</div>)}- <div className="rounded-xl border border-cyan-200 bg-cyan-50 p-4 text-sm text-cyan-950">- <div className="font-semibold">{t('remoteAccess.flowTitle')}</div>- <ol className="mt-2 list-decimal space-y-1 pl-5">- <li>{t('remoteAccess.flowStep1')}</li>- <li>{t('remoteAccess.flowStep2')}</li>- <li>{t('remoteAccess.flowStep3')}</li>- </ol>- </div>-{legacyNestedHostname && (<div className="rounded-xl border border-amber-200 bg-amber-50 p-4 text-sm text-amber-950"><div className="flex items-start gap-3">diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.jsonindex 49c6429a4..1661d3f20 100644--- a/ui/src/i18n/en.json+++ b/ui/src/i18n/en.json@@ -48,19 +48,19 @@"remoteAccess": {"badge": "Vibe Cloud provider","title": "Remote Access",- "subtitle": "Expose this local admin UI at your Vibe Cloud hostname. Vibe Cloud handles OAuth; traffic goes directly through Cloudflare Tunnel to this machine.",+ "subtitle": "Open this local Web UI from another device through a private avibe.bot URL. Your code and agents still run on this machine.","connectTitle": "Connect to Vibe Cloud",- "connectDesc": "Open avibe.bot, sign up or sign in, create your Vibe Bot instance, then paste the one-time Pairing Key here.",+ "connectDesc": "First create a remote-access bot at avibe.bot and copy its one-time pairing key. Then paste it here to pair this device.","configuredTitle": "Vibe Cloud is configured",- "configuredDesc": "This machine has saved the remote-access credentials. The Pairing Key is a one-time code and is not stored; after restart, Vibe Remote uses the saved connection credentials.",+ "configuredDesc": "This machine has saved the remote-access credentials. The pairing key was one-time use; after restart, Vibe Remote uses the saved connection credentials.","configuredBadge": "Connected to Vibe Cloud",- "configuredHelp": "Use re-pair only when switching account, switching instance, or regenerating the Tunnel.",+ "configuredHelp": "Use re-pair only when switching account, changing domain, or regenerating remote access.","legacyHostnameTitle": "This remote address needs to be replaced",- "legacyHostnameDesc": "Older instances used *.remote.avibe.bot. That is a nested hostname and may fail TLS on Cloudflare Universal SSL. Create a new Vibe Bot in avibe.bot, then re-pair here to receive a *.avibe.bot address.",+ "legacyHostnameDesc": "Older instances used *.remote.avibe.bot. That is a nested hostname and may fail TLS on Cloudflare Universal SSL. Create a new remote-access bot at avibe.bot, then re-pair here to receive a *.avibe.bot address.","vibeCloudService": "Vibe Cloud service","backendUrl": "Vibe Cloud URL","pairingKey": "Pairing key",- "pairingKeyHelp": "The Pairing Key is shown once and usually starts with vrp_. After redemption, Vibe Remote stores connection credentials, not this one-time key.",+ "pairingKeyHelp": "The pairing key is shown once and usually starts with vrp_. After redemption, Vibe Remote stores connection credentials, not this one-time key.","pair": "Pair and start","pairing": "Pairing...","repair": "Re-pair",@@ -68,24 +68,24 @@"startSuccess": "Remote access started","stopSuccess": "Remote access stopped","statusTitle": "Runtime status",- "statusDesc": "Connector and public URL status.",+ "statusDesc": "Remote URL and runtime status.","paired": "Pairing",- "connector": "Connector",- "flowTitle": "How it works",- "flowStep1": "Open avibe.bot and sign up or sign in.",- "flowStep2": "Create a Vibe Bot instance in the console and copy its one-time Pairing Key.",- "flowStep3": "Return here to pair. Vibe Remote then saves connection credentials and starts the connector.",+ "connector": "Remote access",+ "flowTitle": "Setup steps",+ "flowStep1": "Open avibe.bot, sign up or sign in, create a remote-access bot, and claim your personal domain.",+ "flowStep2": "Copy the one-time pairing key shown in the avibe.bot console.",+ "flowStep3": "Paste the key here. Vibe Remote saves the connection credentials and starts remote access.","actionNeeded": "Action needed","ready": "Ready","stateNeedsAttention": "Needs attention"},"errors": {"remote_access_unknown": "The operation did not finish. Refresh the status and try again; if it still fails, check the remote access runtime logs.",- "invalid_pairing_key": "The Pairing Key is invalid or expired. Generate a new Pairing Key in avibe.bot and try again.",- "missing_pairing_key": "Paste the Pairing Key first.",+ "invalid_pairing_key": "This pairing key is invalid or expired. Create a new key at avibe.bot, then paste it here.",+ "missing_pairing_key": "Paste the pairing key first.","pairing_request_failed": "Could not connect to avibe.bot. Check the network connection and make sure the Vibe Cloud URL is correct.",- "backend_http_error": "avibe.bot rejected this request. Try again later, or generate a new Pairing Key.",- "invalid_pairing_response": "avibe.bot returned incomplete pairing data. Refresh the page, generate a new Pairing Key, and try again.",+ "backend_http_error": "avibe.bot rejected this request. Try again later, or create a new pairing key.",+ "invalid_pairing_response": "avibe.bot returned incomplete pairing data. Refresh the page, create a new pairing key, and try again.","remote_access_disabled": "Remote access is not enabled yet. Pair this device first.","missing_tunnel_token": "Pairing data is incomplete because the Tunnel credential is missing. Pair this device again.","cloudflared_install_failed": "Connector installation failed. Check network access and local write permissions, then try again.",diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.jsonindex 5685962c1..c256da32d 100644--- a/ui/src/i18n/zh.json+++ b/ui/src/i18n/zh.json@@ -48,19 +48,19 @@"remoteAccess": {"badge": "Vibe Cloud Provider","title": "远程访问",- "subtitle": "把本地管理后台发布到 Vibe Cloud 分配的访问地址。Vibe Cloud 只负责 OAuth 授权,业务流量通过 Cloudflare Tunnel 直达本机。",+ "subtitle": "通过私有 avibe.bot 地址,从另一台设备打开这个本机 Web UI。你的代码和 Agent 仍然运行在这台机器上。","connectTitle": "连接 Vibe Cloud",- "connectDesc": "先前往 avibe.bot 注册或登录,创建你的 Vibe Bot 实例,然后把一次性的 Pairing Key 粘贴到这里。",+ "connectDesc": "先在 avibe.bot 创建 remote-access bot,并复制一次性 pairing key;然后粘贴到这里完成本机配对。","configuredTitle": "Vibe Cloud 已配置",- "configuredDesc": "本机已经保存了远程访问凭证。Pairing Key 是一次性兑换码,不会长期保存;重启后会使用已保存的连接凭证自动恢复。",+ "configuredDesc": "本机已经保存了远程访问凭证。Pairing key 是一次性兑换码,不会长期保存;重启后会使用已保存的连接凭证自动恢复。","configuredBadge": "已连接到 Vibe Cloud",- "configuredHelp": "如果要换账号、换实例或重新生成 Tunnel,再点击重新配对。",+ "configuredHelp": "只有在切换账号、更换域名或重新生成远程访问时,才需要重新配对。","legacyHostnameTitle": "这个远程地址需要更换",- "legacyHostnameDesc": "旧实例使用的是 *.remote.avibe.bot,这属于多级子域名,Cloudflare 免费通用证书可能无法覆盖。请在 avibe.bot 重新创建 Vibe Bot,然后回到这里重新配对,拿到新的 *.avibe.bot 地址。",+ "legacyHostnameDesc": "旧实例使用的是 *.remote.avibe.bot,这属于多级子域名,Cloudflare 免费通用证书可能无法覆盖。请在 avibe.bot 重新创建 remote-access bot,然后回到这里重新配对,拿到新的 *.avibe.bot 地址。","vibeCloudService": "Vibe Cloud 服务","backendUrl": "Vibe Cloud 地址",- "pairingKey": "Pairing Key",- "pairingKeyHelp": "Pairing Key 只会显示一次,通常以 vrp_ 开头。兑换成功后本地保存的是连接凭证,不是这个一次性 Key。",+ "pairingKey": "Pairing key",+ "pairingKeyHelp": "Pairing key 只会显示一次,通常以 vrp_ 开头。兑换成功后本地保存的是连接凭证,不是这个一次性 key。","pair": "配对并启动","pairing": "配对中...","repair": "重新配对",@@ -68,24 +68,24 @@"startSuccess": "远程访问已启动","stopSuccess": "远程访问已停止","statusTitle": "运行状态",- "statusDesc": "查看连接器和公网访问地址状态。",+ "statusDesc": "查看远程访问地址和运行状态。","paired": "配对状态",- "connector": "连接器",- "flowTitle": "使用流程",- "flowStep1": "打开 avibe.bot,注册或登录你的账号。",- "flowStep2": "在控制台创建 Vibe Bot 实例,复制一次性的 Pairing Key。",- "flowStep3": "回到这里完成配对。之后 Vibe Remote 会自动保存连接凭证并启动连接器。",+ "connector": "远程访问",+ "flowTitle": "配置步骤",+ "flowStep1": "打开 avibe.bot,注册或登录,创建 remote-access bot,并领取个人域名。",+ "flowStep2": "复制 avibe.bot 控制台里显示的一次性 pairing key。",+ "flowStep3": "把 key 粘贴到这里。Vibe Remote 会保存连接凭证并启动远程访问。","actionNeeded": "需要处理","ready": "已就绪","stateNeedsAttention": "需要检查"},"errors": {"remote_access_unknown": "操作没有完成。请刷新状态后再试一次;如果仍然失败,请查看远程访问运行日志。",- "invalid_pairing_key": "Pairing Key 无效或已过期。请回到 avibe.bot 重新生成一个新的 Pairing Key。",- "missing_pairing_key": "请先粘贴 Pairing Key。",+ "invalid_pairing_key": "这个 pairing key 无效或已过期。请回到 avibe.bot 重新生成一个 key,然后粘贴到这里。",+ "missing_pairing_key": "请先粘贴 pairing key。","pairing_request_failed": "无法连接到 avibe.bot。请检查网络连接,或确认 Vibe Cloud 地址填写正确。",- "backend_http_error": "avibe.bot 暂时拒绝了这次请求。请稍后重试,或重新生成 Pairing Key。",- "invalid_pairing_response": "avibe.bot 返回的信息不完整。请刷新页面后重新生成 Pairing Key 再试。",+ "backend_http_error": "avibe.bot 暂时拒绝了这次请求。请稍后重试,或重新生成 pairing key。",+ "invalid_pairing_response": "avibe.bot 返回的信息不完整。请刷新页面后重新生成 pairing key 再试。","remote_access_disabled": "远程访问还没有启用。请先完成配对。","missing_tunnel_token": "配对信息不完整,缺少 Tunnel 凭证。请重新配对。","cloudflared_install_failed": "连接器安装失败。请检查当前机器的网络连接和写入权限后重试。",diff --git a/vibe/cli.py b/vibe/cli.pyindex c020803ef..1b1070f4f 100644--- a/vibe/cli.py+++ b/vibe/cli.py@@ -1,4 +1,5 @@import argparse+import getpassimport jsonimport loggingimport math@@ -240,6 +241,42 @@ def _watch_examples_text() -> str:)+def _remote_examples_text() -> str:+ return dedent(+ """\+ Examples:+ vibe remote+ vibe remote status+ vibe remote start+ vibe remote stop+ vibe remote pair vrp_abc123+ """+ )+++def _remote_pair_examples_text() -> str:+ return dedent(+ """\+ Guidance:+ This is the direct pairing command for users who already have a pairing key.+ For the guided setup flow, run `vibe remote`.+ If you omit the pairing key, the CLI prompts for it without echoing it to the terminal.+ Pairing saves the remote-access config and then starts the managed tunnel automatically.+ The pairing key is one-time use; create a fresh key from the Vibe Cloud console if it fails.++ Examples:+ vibe remote+ vibe remote pair vrp_abc123+ vibe remote pair --device-name "Mac Studio"+ vibe remote pair --backend-url https://avibe.bot+ """+ )+++def _print_json(payload: dict) -> None:+ print(json.dumps(payload, indent=2))++def _watch_add_examples_text() -> str:return dedent("""\@@ -1801,12 +1838,9 @@ def cmd_vibe():print("Web UI:")print(f" {ui_url}")print("")- port = int(config.ui.setup_port)- print("If you are running Vibe Remote on a remote server, use SSH port forwarding on your local machine:")- print(f" ssh -NL {port}:localhost:{port} user@server-ip")- print("")- print("Then open in your local browser:")- print(f" http://127.0.0.1:{port}")+ print("Want to open this Web UI from another device or a remote server?")+ print(" Run: vibe remote")+ print(" Vibe Remote will guide you through creating a private avibe.bot URL.")print("")# If running over SSH, avoid trying to open a browser on the server.@@ -1868,6 +1902,266 @@ def cmd_status():return 0+def _remote_access_result_status(result: dict) -> str:+ if not result.get("ok"):+ return "error"+ if result.get("running"):+ return "running"+ if result.get("paired"):+ return "paired"+ if result.get("enabled"):+ return "enabled"+ return "not paired"+++def _print_remote_status(result: dict) -> None:+ print("Remote access:")+ print(f" Status: {_remote_access_result_status(result)}")+ public_url = result.get("public_url")+ if public_url:+ print(f" URL: {public_url}")+ if result.get("paired") is not None:+ print(f" Paired: {'yes' if result.get('paired') else 'no'}")+ if result.get("enabled") is not None:+ print(f" Enabled: {'yes' if result.get('enabled') else 'no'}")+ if result.get("running") is not None:+ print(f" Tunnel: {'running' if result.get('running') else 'stopped'}")+ if result.get("binary_found") is not None:+ print(f" cloudflared: {'found' if result.get('binary_found') else 'not found'}")+ if result.get("error"):+ print(f" Error: {result.get('error')}")+ if result.get("detail"):+ print(f" Detail: {result.get('detail')}")+++def _read_pairing_key_from_args(args) -> str:+ pairing_key = (getattr(args, "pairing_key", None) or "").strip()+ if pairing_key:+ return pairing_key+ try:+ return getpass.getpass("Paste pairing key (input hidden): ").strip()+ except (EOFError, KeyboardInterrupt):+ return ""+++def _print_remote_setup_intro() -> None:+ print("Vibe Cloud remote access")+ print("")+ print("This connects your local Vibe Remote Web UI to a private avibe.bot URL.")+ print("Your agent and code still run on this machine; the remote URL only opens the local Web UI through a managed secure tunnel.")+ print("")+ print("Step 1: Get your pairing key")+ print(" 1. Open https://avibe.bot")+ print(" 2. Sign up or log in")+ print(" 3. Create a new remote-access bot")+ print(" 4. Claim your personal domain")+ print(" 5. Copy the one-time pairing key")+ print("")+++def _wait_for_pairing_key_ready() -> bool:+ try:+ input("Press Enter when you have copied the pairing key, or Ctrl+C to cancel.")+ return True+ except (EOFError, KeyboardInterrupt):+ print("")+ return False+++def _print_remote_pair_start() -> None:+ print("")+ print("Step 2: Pair this device")+++def _print_remote_pair_failure(result: dict) -> None:+ error_code = str(result.get("error") or "unknown_error")+ if error_code in {"invalid_pairing_key", "pairing_key_expired", "pairing_key_used"}:+ print("Pairing key is invalid or expired.", file=sys.stderr)+ print("Create a new pairing key at https://avibe.bot, then run:", file=sys.stderr)+ print(" vibe remote", file=sys.stderr)+ return+ if error_code in {"pairing_request_failed", "backend_http_error"}:+ print("Could not reach Vibe Cloud.", file=sys.stderr)+ print("Check your network connection, then run:", file=sys.stderr)+ print(" vibe remote", file=sys.stderr)+ if result.get("detail"):+ print(f"Detail: {result['detail']}", file=sys.stderr)+ return+ if error_code == "invalid_pairing_response":+ print("Vibe Cloud returned incomplete pairing data.", file=sys.stderr)+ print("Create a fresh pairing key and run:", file=sys.stderr)+ print(" vibe remote", file=sys.stderr)+ return+ print(f"Remote access setup failed: {error_code}", file=sys.stderr)+ if result.get("detail"):+ print(f"Detail: {result['detail']}", file=sys.stderr)+ print("Run 'vibe remote' to try again.", file=sys.stderr)+++def _print_remote_start_failure(start_result: dict) -> None:+ error_code = str(start_result.get("error") or "unknown_error")+ print("Remote access is paired, but the tunnel did not start.", file=sys.stderr)+ if error_code == "cloudflared_install_failed":+ print("Vibe Remote could not install cloudflared automatically.", file=sys.stderr)+ elif error_code == "cloudflared_spawn_failed":+ print("Vibe Remote could not launch cloudflared.", file=sys.stderr)+ elif error_code == "cloudflared_exited":+ print("cloudflared exited immediately after launch.", file=sys.stderr)+ elif error_code == "remote_access_disabled":+ print("Remote access is disabled in the saved config.", file=sys.stderr)+ else:+ print(f"Reason: {error_code}", file=sys.stderr)+ if start_result.get("detail"):+ print(f"Detail: {start_result['detail']}", file=sys.stderr)+ print("After fixing the issue, run:", file=sys.stderr)+ print(" vibe remote start", file=sys.stderr)+++def _print_remote_pair_success(result: dict, start_result: dict) -> None:+ print("")+ if not start_result.get("ok"):+ print("Step 3: Pairing saved")+ _print_remote_start_failure(start_result)+ return+ print("Step 3: Remote access is ready")+ public_url = result.get("public_url")+ if public_url:+ print("Open:")+ print(f" {public_url}")+ print("")+ print("This URL opens the Web UI for this local Vibe Remote instance.")+ print("When you open it, sign in with the same avibe.bot account to continue.")+ print("Tunnel: running" if result.get("running") else "Tunnel: ready")+ print("")+ print("Useful commands:")+ print(" vibe remote status Check the remote URL and tunnel status")+ print(" vibe remote start Start the tunnel again after a reboot or stop")+ print(" vibe remote stop Stop remote access without deleting the pairing")+++def _print_remote_already_configured(result: dict) -> None:+ print("Remote access is already configured.")+ public_url = result.get("public_url")+ if public_url:+ print("")+ print("Open:")+ print(f" {public_url}")+ print("")+ print("When you open this URL, sign in with the same avibe.bot account to access this local Web UI.")+ print("")+ print(f"Tunnel: {'running' if result.get('running') else 'stopped'}")+ print("")+ print("Useful commands:")+ print(" vibe remote status Show the remote URL and tunnel status")+ print(" vibe remote start Start the tunnel again after a reboot or stop")+ print(" vibe remote stop Temporarily disable remote access")+ print("")+ print("Need to switch account or domain?")+ print(" Run: vibe remote pair")+++def _run_remote_pair(args, *, guided: bool) -> int:+ from vibe import remote_access++ if guided:+ current = remote_access.status()+ if current.get("paired"):+ _print_remote_already_configured(current)+ return 0+ _print_remote_setup_intro()+ if not _wait_for_pairing_key_ready():+ print("Remote access setup cancelled.")+ return 1+ _print_remote_pair_start()++ pairing_key = _read_pairing_key_from_args(args)+ if not pairing_key:+ payload = {"ok": False, "error": "missing_pairing_key", "hint": "Run 'vibe remote' to restart setup."}+ if getattr(args, "json", False):+ _print_json(payload)+ else:+ print("Pairing failed: missing pairing key.", file=sys.stderr)+ print("Run 'vibe remote' to restart setup.", file=sys.stderr)+ return 1++ if not getattr(args, "json", False):+ print("Pairing this device with Vibe Cloud remote access...", flush=True)+ result = remote_access.pair(+ pairing_key,+ getattr(args, "backend_url", "https://avibe.bot"),+ getattr(args, "device_name", "Vibe Remote"),+ )+ if getattr(args, "json", False):+ _print_json(result)+ return 0 if result.get("ok") else 1++ if not result.get("ok"):+ _print_remote_pair_failure(result)+ return 1++ start_result = result.get("start") if isinstance(result.get("start"), dict) else {}+ _print_remote_pair_success(result, start_result)+ return 0+++def cmd_remote_pair(args):+ return _run_remote_pair(args, guided=False)+++def cmd_remote_setup(args):+ return _run_remote_pair(args, guided=True)+++def cmd_remote_status(args):+ from vibe import remote_access++ result = remote_access.status()+ if getattr(args, "json", False):+ _print_json(result)+ else:+ _print_remote_status(result)+ return 0 if result.get("ok") else 1+++def cmd_remote_start(args):+ from vibe import remote_access++ result = remote_access.start()+ if getattr(args, "json", False):+ _print_json(result)+ else:+ if result.get("ok"):+ if result.get("started"):+ print("Remote access tunnel started.")+ elif result.get("running"):+ print("Remote access tunnel is already running.")+ else:+ print("Remote access tunnel is ready.")+ if result.get("public_url"):+ print(f"Remote URL: {result['public_url']}")+ else:+ print(f"Remote access failed to start: {result.get('error') or 'unknown_error'}", file=sys.stderr)+ if result.get("detail"):+ print(str(result["detail"]), file=sys.stderr)+ return 0 if result.get("ok") else 1+++def cmd_remote_stop(args):+ from vibe import remote_access++ result = remote_access.stop()+ if getattr(args, "json", False):+ _print_json(result)+ else:+ if result.get("ok"):+ print("Remote access tunnel stopped." if result.get("stopped") else "Remote access tunnel is already stopped.")+ else:+ print(f"Remote access failed to stop: {result.get('error') or 'unknown_error'}", file=sys.stderr)+ if result.get("detail"):+ print(str(result["detail"]), file=sys.stderr)+ return 0 if result.get("ok") else 1++def cmd_doctor():result = _doctor()@@ -2071,6 +2365,77 @@ def build_parser():subparsers.add_parser("version", help="Show version")subparsers.add_parser("check-update", help="Check for updates")subparsers.add_parser("upgrade", help="Upgrade to latest version")+ remote_parser = subparsers.add_parser(+ "remote",+ help="Manage Vibe Cloud remote access",+ description="Start a guided Vibe Cloud remote-access setup, or manage the remote-access tunnel.",+ epilog=_remote_examples_text(),+ formatter_class=argparse.RawDescriptionHelpFormatter,+ error_help_command="vibe remote --help",+ error_hint="Run 'vibe remote' for guided setup, or use one of the remote subcommands below.",+ )+ remote_subparsers = remote_parser.add_subparsers(+ dest="remote_command",+ metavar="[command]",+ )++ remote_pair_parser = remote_subparsers.add_parser(+ "pair",+ help="Pair directly when you already have a pairing key",+ description="Redeem a Vibe Cloud pairing key, save remote-access config, and start the managed tunnel.",+ epilog=_remote_pair_examples_text(),+ formatter_class=argparse.RawDescriptionHelpFormatter,+ error_help_command="vibe remote pair --help",+ error_hint="Pass a pairing key or omit it to be prompted securely.",+ )+ remote_pair_parser.add_argument(+ "pairing_key",+ nargs="?",+ help="One-time pairing key from the Vibe Cloud console. Omit to enter it securely.",+ )+ remote_pair_parser.add_argument(+ "--backend-url",+ default="https://avibe.bot",+ help="Vibe Cloud backend URL. Default: https://avibe.bot",+ )+ remote_pair_parser.add_argument(+ "--device-name",+ default="Vibe Remote",+ help="Human-friendly name for this local device. Default: Vibe Remote",+ )+ remote_pair_parser.add_argument(+ "--json",+ action="store_true",+ help="Print the raw machine-readable pairing result.",+ )++ remote_status_parser = remote_subparsers.add_parser(+ "status",+ help="Show remote-access status",+ description="Show pairing, tunnel, and cloudflared status for Vibe Cloud remote access.",+ formatter_class=argparse.RawDescriptionHelpFormatter,+ error_help_command="vibe remote status --help",+ )+ remote_status_parser.add_argument("--json", action="store_true", help="Print the raw machine-readable status.")++ remote_start_parser = remote_subparsers.add_parser(+ "start",+ help="Start the remote-access tunnel",+ description="Start the managed cloudflared tunnel for the saved Vibe Cloud pairing.",+ formatter_class=argparse.RawDescriptionHelpFormatter,+ error_help_command="vibe remote start --help",+ )+ remote_start_parser.add_argument("--json", action="store_true", help="Print the raw machine-readable result.")++ remote_stop_parser = remote_subparsers.add_parser(+ "stop",+ help="Stop the remote-access tunnel",+ description="Stop the managed cloudflared tunnel without deleting the saved pairing.",+ formatter_class=argparse.RawDescriptionHelpFormatter,+ error_help_command="vibe remote stop --help",+ )+ remote_stop_parser.add_argument("--json", action="store_true", help="Print the raw machine-readable result.")+screenshot_parser = subparsers.add_parser("screenshot",help="Capture a local desktop screenshot",@@ -2454,6 +2819,18 @@ def main():sys.exit(cmd_check_update())if args.command == "upgrade":sys.exit(cmd_upgrade())+ if args.command == "remote":+ if args.remote_command is None:+ sys.exit(cmd_remote_setup(args))+ if args.remote_command == "pair":+ sys.exit(cmd_remote_pair(args))+ if args.remote_command == "status":+ sys.exit(cmd_remote_status(args))+ if args.remote_command == "start":+ sys.exit(cmd_remote_start(args))+ if args.remote_command == "stop":+ sys.exit(cmd_remote_stop(args))+ parser.error("remote command is invalid")if args.command == "task":if args.task_command == "add":sys.exit(cmd_task_add(args))