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 api
for advanced admin tasksgh repo/org
for repo/org managementgh auth
for authentication across your GHES instance
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow , and SEO strategies at Wizbrand.
Do you want to learn Quantum Computing?
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at WIZBRAND