From f65cf9510a5c4337b21369af8c12c0183b2ab095 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Sat, 16 May 2026 22:51:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BF=9C=E7=A8=8B=20VSCode?= =?UTF-8?q?=20=E8=BF=9E=E6=8E=A5=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sh/open-ruten-remote-vscode.sh | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 sh/open-ruten-remote-vscode.sh diff --git a/sh/open-ruten-remote-vscode.sh b/sh/open-ruten-remote-vscode.sh new file mode 100755 index 0000000..ce1d461 --- /dev/null +++ b/sh/open-ruten-remote-vscode.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Open Ruten Remote VSCode +# @raycast.mode silent + +# Optional parameters: +# @raycast.icon 🖥️ +# @raycast.packageName @kevisual/raycast + +# Documentation: +# @raycast.description SSH to Ruten host, fuzzy select a project with fzf, then open it in VSCode Remote +# @raycast.author abearxiong +# @raycast.authorURL https://raycast.com/abearxiong + +FZF_BIN="fzf" +RUTEN_HOST=ruten-dev + +if [[ -z "$RUTEN_HOST" ]]; then + osascript -e 'display alert "Ruten Host 为空" message "请先运行 Set Ruten Host 脚本设置远程地址"' + exit 1 +fi + +CMD="ssh '$RUTEN_HOST' 'find /workspace/projects /workspace/docker -maxdepth 1 -type d 2>/dev/null' | $FZF_BIN --prompt='Ruten Remote > ' | xargs -I{} open 'vscode://vscode-remote/ssh-remote+${RUTEN_HOST}{}'" + +osascript <