{"id":34246488,"url":"https://github.com/mfyuu/gh-sw","last_synced_at":"2026-04-25T07:31:45.609Z","repository":{"id":328275159,"uuid":"1114880944","full_name":"mfyuu/gh-sw","owner":"mfyuu","description":"A lightweight GitHub CLI extension that provides an interactive local branch selector for seamless switching.","archived":false,"fork":false,"pushed_at":"2025-12-12T06:07:00.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-19T14:55:51.557Z","etag":null,"topics":["cli","gh-extension","github","go"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mfyuu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-12T02:56:25.000Z","updated_at":"2025-12-12T06:07:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mfyuu/gh-sw","commit_stats":null,"previous_names":["mfyuu/gh-sw"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mfyuu/gh-sw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfyuu%2Fgh-sw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfyuu%2Fgh-sw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfyuu%2Fgh-sw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfyuu%2Fgh-sw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mfyuu","download_url":"https://codeload.github.com/mfyuu/gh-sw/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfyuu%2Fgh-sw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32254474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T04:23:17.126Z","status":"ssl_error","status_checked_at":"2026-04-25T04:21:53.360Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","gh-extension","github","go"],"created_at":"2025-12-16T07:07:32.066Z","updated_at":"2026-04-25T07:31:45.604Z","avatar_url":"https://github.com/mfyuu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"A lightweight GitHub CLI extension that provides an interactive local branch selector for seamless switching.\n\n## Overview\n\n`gh-sw` = `git branch` + `git switch`\n\nStreamlines the process of switching between local branches. It displays all local branches in an interactive selection UI, allowing you to quickly switch to any branch.\n\nBuilt with [golang/go](https://github.com/golang/go), this extension uses [charmbracelet/huh](https://github.com/charmbracelet/huh) for interactive selection.\n\n## Motivation\n\nWhen working with multiple branches, developers often need to:\n\n1. Run `git branch` to see local branches\n2. Identify the branch they want to switch to\n3. Run `git switch \u003cbranch\u003e` to switch to that branch\n\nThis extension combines these steps into a single command with an interactive interface, reducing context switching and making branch management more efficient. The arrow-key navigation makes it easy to quickly jump between different branches during development.\n\n## Installation\n\n### Prerequisites\n\n- [GitHub CLI](https://cli.github.com/) must be installed and authenticated\n\n### Install as a GitHub CLI extension\n\n```bash\ngh extensions install mfyuu/gh-sw\n```\n\n## Usage\n\n```\ngh sw --help\n\n# Output:\nInteractively switch to a local branch.\n\nUSAGE\n  gh sw [branch]\n  gh sw [flags]\n\nFLAGS\n  -a, --all           Select from all branches (local + remote)\n  -c, --create NAME   Create and switch to a new branch\n  -C, --force-create NAME\n                      Create/reset and switch to a new branch\n  -d, --detach        Detach HEAD at the commit\n  --orphan NAME       Create a new orphan branch\n  -r, --remote        Select from remote branches (+ current branch)\n  --help              Show help for command\n\nEXAMPLES\n  $ gh sw              # Interactive branch selection\n  $ gh sw feature/auth # Switch to specific branch\n  $ gh sw -            # Switch to previous branch\n  $ gh sw -a           # Select from all branches\n  $ gh sw -c feature   # Create and switch to new branch\n  $ gh sw -C feature   # Force create and switch to branch\n  $ gh sw -d           # Detach HEAD at current commit\n  $ gh sw -d main      # Detach HEAD at main\n  $ gh sw --orphan new # Create orphan branch\n  $ gh sw -r           # Select from remote branches\n```\n\n### Modes\n\n- **Interactive (`gh sw`)**: Display all local branches and select one to switch to\n- **Direct (`gh sw \u003cbranch\u003e`)**: Switch directly to the specified branch\n- **Previous (`gh sw -`)**: Switch to the previously checked out branch\n- **All (`gh sw -a`)**: Display all branches (local + remote) and select one to switch to\n- **Create (`gh sw -c \u003cname\u003e`)**: Create a new branch and switch to it\n- **Force Create (`gh sw -C \u003cname\u003e`)**: Create/reset a branch and switch to it\n- **Detach (`gh sw -d [commit]`)**: Detach HEAD at the specified commit\n- **Orphan (`gh sw --orphan \u003cname\u003e`)**: Create a new orphan branch\n- **Remote (`gh sw -r`)**: Display all remote branches and select one to switch to\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfyuu%2Fgh-sw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmfyuu%2Fgh-sw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfyuu%2Fgh-sw/lists"}