AgentSkillsCN

open

在浏览器中打开 GitHub 同步仓库页面

SKILL.md
--- frontmatter
name: open
description: Open GitHub sync repository page in browser

Open GitHub Repository

Open your Claude Code sync repository page in the default browser.

Usage

code
/claude-github-sync:open

Configuration Reference

ItemPathDescription
Config file~/.claude/sync-config.jsonSync configuration (repo URL, setup method)
Git remote~/.claude/.git/configPrimary check - git origin remote URL

Instructions

bash
cd ~/.claude

# Get remote URL
REPO_URL=$(git remote get-url origin 2>/dev/null)

if [ -z "$REPO_URL" ]; then
    echo "❌ Not configured"
    echo ""
    echo "Run: /claude-github-sync:setup"
    exit 1
fi

# Convert SSH URL to HTTPS if needed
# git@github.com:user/repo.git -> https://github.com/user/repo
# https://github.com/user/repo.git -> https://github.com/user/repo
HTTPS_URL=$(echo "$REPO_URL" | sed -E 's|git@github.com:|https://github.com/|' | sed 's|\.git$||')

echo "🌐 Opening: $HTTPS_URL"

# Open in default browser (macOS/Linux/WSL)
if command -v open &>/dev/null; then
    open "$HTTPS_URL"
elif command -v xdg-open &>/dev/null; then
    xdg-open "$HTTPS_URL"
elif command -v wslview &>/dev/null; then
    wslview "$HTTPS_URL"
else
    echo ""
    echo "Could not detect browser. Open manually:"
    echo "  $HTTPS_URL"
fi