gh¶
GitHub utilities.
Synopsis¶
Subcommands¶
list-repos- List repositories for a user, org, or teamopen- Open a GitHub repository in the browser
list-repos¶
List all repositories for a GitHub user or organization, optionally filtered by team.
Synopsis¶
Flags¶
| Flag | Short | Description | Default |
|---|---|---|---|
--owner |
-o |
GitHub organization or user name | (required) |
--team |
Team slug/name within the organization | ||
--visibility |
-v |
Filter by visibility (can specify multiple) | all |
--archived |
Filter by archived status | all |
|
--sort |
Sort repos by field | full_name |
|
--direction |
Sort direction | asc |
|
--url |
Print full GitHub URLs instead of repo names | false |
Visibility Options¶
all- All repositoriespublic- Public repositories onlyprivate- Private repositories onlyinternal- Internal repositories only
Archived Options¶
all- All repositoriesarchived- Only archived repositoriesnot-archived- Only active repositories
Sort Options¶
full_name- Repository namecreated- Creation dateupdated- Last update datepushed- Last push date
Examples¶
List all repos for an organization:
List repos for a specific team:
List only public repos:
List with full URLs:
List non-archived repos sorted by last push:
Notes¶
- Requires
ghCLI to be installed and authenticated - Shell completion available for organizations and teams
open¶
Open a GitHub repository in the default web browser.
Synopsis¶
Flags¶
| Flag | Short | Description | Default |
|---|---|---|---|
--remote |
-r |
Git remote name to use | origin |
Arguments¶
| Argument | Description |
|---|---|
dir |
Directory path to a git repository |
url |
GitHub URL to open directly |
Examples¶
Open current directory's repo:
Open a specific directory:
Open a URL:
Open using a different remote:
Short URL format:
Notes¶
- Auto-detects SSH and HTTPS remote URLs
- Converts SSH URLs to HTTPS for browser
- Works on macOS, Linux, and Windows