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