In GitHub Enterprise, โcommandsโ typically means GitHub CLI (gh) commands and admin-level REST/GraphQL API calls that administrators use to manage organizations, repositories, users, and enterprise settings.
Hereโs a categorized list of the most used GitHub Enterprise admin commands:
๐น Authentication & Setup
gh auth loginโ authenticate with GitHub Enterprise Server (GHES)gh config set -h HOSTNAME git_protocol sshโ configure protocols (ssh/https) for your GHES instance
๐น Organization Management
gh org listโ list organizations you belong togh org view <org>โ view organization detailsgh api /orgs/<org>/membersโ list organization membersgh api --method PUT /orgs/<org>/memberships/<username>โ invite or update member rolesgh api /orgs/<org>/outside_collaboratorsโ manage outside collaborators
๐น Repository Management
gh repo create <org>/<repo> --private --confirmโ create a new repo inside an organizationgh repo view <org>/<repo>โ view repo detailsgh repo delete <org>/<repo>โ delete a repo (with confirmation)gh api /repos/<org>/<repo>/collaboratorsโ list collaboratorsgh api --method PUT /repos/<org>/<repo>/collaborators/<username>โ add collaborator with role
๐น User Management
gh api /users/<username>โ view user infogh api /enterprises/<enterprise>/adminsโ list enterprise adminsgh api --method PUT /orgs/<org>/memberships/<username>โ assign/remove rolesgh api --method DELETE /orgs/<org>/memberships/<username>โ remove a user
๐น Teams & Access Control
gh api /orgs/<org>/teamsโ list teams in orggh api /orgs/<org>/teams/<team_slug>โ view team detailsgh api --method PUT /orgs/<org>/teams/<team_slug>/memberships/<username>โ add user to teamgh api --method DELETE /orgs/<org>/teams/<team_slug>/memberships/<username>โ remove user from team
๐น Enterprise & Security
gh api /enterprises/<enterprise>โ view enterprise detailsgh api /enterprises/<enterprise>/settings/audit-logโ access audit logsgh api /enterprises/<enterprise>/actions/permissionsโ manage Actions permissionsgh api /orgs/<org>/dependabot/secretsโ manage Dependabot secretsgh api /orgs/<org>/actions/secretsโ manage GitHub Actions secrets
๐น Example: Enterprise Audit & Compliance
# List all enterprise users
gh api /enterprises/MY-ENTERPRISE/admin/users
# Fetch enterprise audit log
gh api /enterprises/MY-ENTERPRISE/audit-log --paginate
Code language: PHP (php)
๐ These commands are used through GitHub CLI (gh) or via API calls. As an Enterprise Admin, youโll mostly rely on:
gh apifor advanced admin tasksgh repo/orgfor repo/org managementgh authfor authentication across your GHES instance
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services โ all in one place.
Explore Hospitals