No slash command · from git-plugin
Extracts GitHub repo owner/name from git remotes (HTTPS, SSH, Enterprise). Provides commands to parse URLs and format as owner/repo for gh CLI and API calls.
Ships in git-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
| Use this skill when... | Use the alternative when... |
|---|---|
Extracting owner/repo from a git remote (HTTPS or SSH URL) for gh calls | Use gh-cli-agentic once you already have the owner/repo identifier |
| Handling GitHub Enterprise host URLs alongside github.com | Use git-fork-workflow when the question is fork vs upstream identification |
Resolving the repo identifier to pass with gh -R to avoid remote-required errors | Use git-cli-agentic for raw git remote -v parsing if you need URL details |
| Detecting which repo a script is running inside before issuing API calls | Use git-coworker-check to detect concurrent agents in the same checkout |
Expert knowledge for detecting and extracting GitHub repository information from git remotes, including repository name, owner, and full identifiers.
Repository Identification
owner/repo for CLI/API usageURL Parsing
https://github.com/owner/repo.git[email protected]:owner/repo.githttps://github.enterprise.com/owner/repo.git.git suffix and extra paths# List all remotes
git remote -v
# Get origin URL
git remote get-url origin
# Get specific remote
git remote get-url upstream
# Show remote details
git remote show origin
# From HTTPS URL
git remote get-url origin | sed 's/.*\/\([^/]*\)\.git/\1/'
# From SSH URL
git remote get-url origin | sed 's/.*:\([^/]*\/[^/]*\)\.git/\1/' | cut -d'/' -f2
# From any URL (owner/repo format)
git remote get-url origin | sed 's/.*[:/]\([^/]*\/[^/]*\)\.git/\1/'
# Just repository name (no owner)
basename $(git remote get-url origin) .git
# From any URL
git remote get-url origin | sed 's/.*[:/]\([^/]*\)\/[^/]*\.git/\1/'
# Alternative with awk
git remote get-url origin | awk -F '[:/]' '{print $(NF-1)}'
# Standard format for GitHub CLI/API
git remote get-url origin | sed 's/.*[:/]\([^/]*\/[^/]*\)\.git/\1/'
# With validation
REPO=$(git remote get-url origin 2>/dev/null | sed 's/.*[:/]\([^/]*\/[^/]*\)\.git/\1/')
echo "${REPO:-Unknown}"
# Store in variable
REPO_FULL=$(git remote get-url origin | sed 's/.*[:/]\([^/]*\/[^/]*\)\.git/\1/')
echo "Repository: $REPO_FULL"
# Standard GitHub
https://github.com/owner/repo.git
# Extract: owner/repo
# Without .git suffix
https://github.com/owner/repo
# Extract: owner/repo
# GitHub Enterprise
https://github.company.com/owner/repo.git
# Extract: owner/repo
# Standard SSH
[email protected]:owner/repo.git
# Extract: owner/repo
# Custom SSH port
ssh://[email protected]:443/owner/repo.git
# Extract: owner/repo
# Enterprise SSH
[email protected]:owner/repo.git
# Extract: owner/repo
# Works for both HTTPS and SSH
parse_repo() {
local url="$1"
# Remove .git suffix
url="${url%.git}"
# Extract owner/repo
if [[ "$url" =~ github\.com[:/]([^/]+/[^/]+) ]]; then
echo "${BASH_REMATCH[1]}"
elif [[ "$url" =~ :([^/]+/[^/]+)$ ]]; then
echo "${BASH_REMATCH[1]}"
fi
}
REPO=$(parse_repo "$(git remote get-url origin)")
echo "$REPO"
# Handle both HTTPS and SSH, with or without .git
git remote get-url origin \
| sed -E 's#.*github\.com[:/]##; s#\.git$##'
# Split by : or / and get last two components
git remote get-url origin \
| awk -F'[/:]' '{print $(NF-1)"/"$NF}' \
| sed 's/\.git$//'
# Get repo identifier for gh commands
REPO=$(git remote get-url origin | sed 's/.*[:/]\([^/]*\/[^/]*\)\.git/\1/')
# Use with gh
gh repo view "$REPO"
gh issue list --repo "$REPO"
gh pr list --repo "$REPO"
# Or use current directory (gh auto-detects)
gh repo view
For API usage, multiple remotes, scripts, aliases, and integration examples, see REFERENCE.md.
| Case | Check |
|---|---|
| No remote | git remote get-url origin &>/dev/null |
| Non-GitHub | git remote get-url origin | grep -q github.com |
| Multiple remotes | Use git remote get-url upstream for fork source |
| Submodule | git -C "$(git rev-parse --show-toplevel)" remote get-url origin |
| Purpose | Command |
|---|---|
| Full identifier (owner/repo) | git remote get-url origin | sed 's/.*[:/]\([^/]*\/[^/]*\)\.git/\1/' |
| Owner only | git remote get-url origin | sed 's/.*[:/]\([^/]*\)\/[^/]*\.git/\1/' |
| Name only | basename $(git remote get-url origin) .git |
| Is GitHub? | git remote get-url origin | grep -q github.com |
| Validate in git repo | git rev-parse --git-dir &>/dev/null |
| List remotes | git remote -v |
| Set origin | git remote set-url origin [email protected]:owner/repo.git |
| Problem | Fix |
|---|---|
| Remote not found | git remote add origin [email protected]:owner/repo.git |
| Wrong remote | git remote set-url origin <correct-url> |
| Parse failure | Check raw URL: git remote get-url origin |
What SKILL.md sets; muted values are Claude Code's defaults
52 skills in this plugin
/deadbranchdeadbranch CLI for stale-branch cleanup — dry-run preview, TUI or non-interactive delete, protects main/develop/WIP. Use when asked to clean up branches, prune branches, or remove stale branches./external-pr-trustAuthorship as a precondition of merging — bot vs stranger classification, what a merge executes, the merge-guard hook. Use when bulk-merging PRs, or when a merge is denied for a non-self author./gh-cli-agenticgh CLI commands with JSON output for agents. Use when querying PRs, issues, runs, or repo metadata; inspecting PR checks; fetching failed CI logs; or mapping a github.com URL to an API call./git-api-prGitHub API PR creation without local git. Use when submitting file changes as a PR without local commits — quick fixes, typos, config updates, or bypassing local git state./git-branch-namingBranch names: type prefix (feat/, fix/, chore/), issue number, kebab-case. Use when picking a name for a new branch or setting a repo's branch-naming convention./git-branch-pr-workflowBranch management and PR workflows — git switch/restore, GitHub MCP. Use when creating branches, opening PRs, or working with feature branches.npx claudepluginhub laurigates/claude-plugins --plugin git-pluginOther plugins' skills for the same job