gh-org
Manage GitHub organizations
TLDR
List organizations for the authenticated user
List a certain amount of organizations (defaults to 30)
Display help
SYNOPSIS
gh-org <subcommand> [<flags>]
Available subcommands enable various operations for listing organizations, viewing organization details, and managing members. Each subcommand may have its own specific flags and arguments.
PARAMETERS
list
Lists all GitHub organizations that the authenticated user is a member of. This provides a quick overview of your organizational affiliations.
members <organization>
Manages or lists members of the specified GitHub organization. This subcommand typically requires further sub-actions (e.g., gh-org members list <org>, gh-org members add <org> <user>) to perform specific member-related tasks.
view <organization>
Displays detailed public and private information about a specific GitHub organization, including its description, URL, repository count, and other relevant metadata. Requires appropriate permissions for private organization details.
DESCRIPTION
The gh-org command provides a robust interface for interacting with GitHub organizations directly from your command line. It streamlines common organizational tasks, allowing users to list all organizations they belong to, view detailed information about specific organizations, and manage organization members. This command is an essential tool for developers and administrators who need to efficiently oversee and maintain their GitHub organization's structure, permissions, and teams without switching context to the web interface. It leverages the GitHub API to ensure up-to-date and accurate data, making it a powerful utility for scripting and automation of organizational workflows. Its design focuses on ease of use and integration with existing shell environments, making complex organizational tasks manageable with simple commands.
CAVEATS
The gh-org command relies on the GitHub CLI (gh) being installed and properly configured with an authenticated GitHub session. Operations are subject to GitHub API rate limits and require the authenticated user to have sufficient permissions within the target organization (e.g., owner privileges for member management).
AUTHENTICATION
Before using gh-org, you must authenticate your GitHub CLI session. This is typically done using the gh auth login command, which will guide you through the process of connecting your terminal to your GitHub account and granting the necessary permissions.
PERMISSIONS
All actions performed by gh-org are executed under the context of the authenticated user's permissions. For tasks such as adding or removing organization members, the user must possess organization owner privileges or specific team maintenance permissions within the target GitHub organization.
HISTORY
The functionality encapsulated by gh-org is part of the broader GitHub CLI (gh) tool, which was officially released in 2020. Its development aimed to provide a comprehensive command-line interface for GitHub, enabling developers to manage repositories, issues, pull requests, and organizations directly from their terminal. The organizational management features have evolved to mirror the capabilities of the GitHub web interface and API, continually improving to support modern development workflows and automation needs.


