Command reference for github-rest-cli. The CLI uses nested groups:
github-rest-cli <command> <subcommand> [options]
For tokens and PAT scopes, see Authentication. For settings files and API URL, see Configuration.
github-rest-cli --help
github-rest-cli --version| Option | Description |
|---|---|
-h / --help |
Show help |
-v / --version |
Show package version |
| Group | Purpose |
|---|---|
repo |
Get, list, create, and delete repositories |
dependabot |
Enable or disable Dependabot security updates |
environment |
Create deployment environments |
github-rest-cli repo --help
github-rest-cli dependabot --help
github-rest-cli environment --help| CLI command | HTTP / path | GitHub docs |
|---|---|---|
repo get |
GET /repos/{owner}/{repo} |
Get a repository |
repo list |
GET /user/repos |
List repositories for the authenticated user |
repo create (user) |
POST /user/repos |
Create a repository for the authenticated user |
repo create (org) |
POST /orgs/{org}/repos |
Create an organization repository |
repo delete |
DELETE /repos/{owner}/{repo} |
Delete a repository |
dependabot enable |
Dependabot security updates | Enable Dependabot security updates |
dependabot disable |
Dependabot security updates | Disable Dependabot security updates |
environment create |
PUT /repos/{owner}/{repo}/environments/{environment_name} |
Create or update an environment |
Fetch details for one repository.
API: GET /repos/{owner}/{repo} — Get a repository
github-rest-cli repo get --name my-repo
github-rest-cli repo get --name my-repo --org my-org
github-rest-cli repo get --name my-repo --format json| Flag | Required | Default | Description |
|---|---|---|---|
-n / --name |
Yes | — | Repository name |
-o / --org |
No | authenticated user | Organization owner |
-f / --format |
No | table |
Output format: table or json |
Table mode shows a key/value detail view (Field | Value) with curated fields: name, full_name, owner, description, visibility, default_branch, language, topics, html_url, created_at, updated_at, pushed_at, fork, archived, disabled.
JSON mode returns the full raw GitHub repository object from the API.
List repositories for the authenticated user.
API: GET /user/repos — List repositories for the authenticated user
--per-page and --page map to GitHub's per_page and page query parameters. --all follows Link-header pagination.
github-rest-cli repo list
github-rest-cli repo list --per-page 50 --sort pushed
github-rest-cli repo list --page 2 --per-page 30
github-rest-cli repo list --all --format json
github-rest-cli repo list --role owner --format json| Flag | Required | Default | Description |
|---|---|---|---|
--per-page |
No | 20 |
Results per page (per_page, max 100) |
-p / --page |
No | 1 |
Page number to fetch (ignored with --all) |
--all |
No | off | Fetch every page by following Link headers |
-s / --sort |
No | pushed |
Sort field (e.g. pushed, updated, created) |
-r / --role |
No | unset | Filter by affiliation/role |
-f / --format |
No | table |
Output format: table or json |
--format only changes presentation. Table and JSON use the same repository set and the same summary fields: name, owner, url, visibility. With --all, that set is the concatenated result of every page.
Create a repository. Visibility defaults to public when none of the visibility flags is passed.
API:
- User:
POST /user/repos— Create a repository for the authenticated user - Organization:
POST /orgs/{org}/repos— Create an organization repository
github-rest-cli repo create --name my-new-repo
github-rest-cli repo create --name my-new-repo --private
github-rest-cli repo create --name my-new-repo --public
github-rest-cli repo create --name my-new-repo --internal
github-rest-cli repo create --name my-new-repo --org my-org
github-rest-cli repo create --name my-new-repo --empty| Flag | Required | Default | Description |
|---|---|---|---|
-n / --name |
Yes | — | Repository name |
-o / --org |
No | authenticated user | Create under an organization |
--public |
No | default when omitted | Public repository |
--private |
No | — | Private repository |
--internal |
No | — | Internal repository (org) |
-e / --empty |
No | off | Create without an initial commit / README |
--public, --private, and --internal are mutually exclusive.
Delete a repository. Prompts for confirmation unless --yes is passed.
API: DELETE /repos/{owner}/{repo} — Delete a repository
github-rest-cli repo delete --name my-repo
github-rest-cli repo delete --name my-repo --org my-org
github-rest-cli repo delete --name my-repo --yes| Flag | Required | Default | Description |
|---|---|---|---|
-n / --name |
Yes | — | Repository name |
-o / --org |
No | authenticated user | Organization owner |
-y / --yes |
No | off | Skip confirmation prompt |
Enable or disable Dependabot security updates for a repository.
API:
- Enable — Enable Dependabot security updates
- Disable — Disable Dependabot security updates
github-rest-cli dependabot enable --name my-repo
github-rest-cli dependabot disable --name my-repo
github-rest-cli dependabot enable --name my-repo --org my-org| Flag | Required | Default | Description |
|---|---|---|---|
-n / --name |
Yes | — | Repository name |
-o / --org |
No | authenticated user | Organization owner |
Create a deployment environment on a repository.
API: PUT /repos/{owner}/{repo}/environments/{environment_name} — Create or update an environment
github-rest-cli environment create --name my-repo --env production
github-rest-cli environment create --name my-repo --env staging --org my-org| Flag | Required | Default | Description |
|---|---|---|---|
-n / --name |
Yes | — | Repository name |
-e / --env |
Yes | — | Environment name |
-o / --org |
No | authenticated user | Organization owner |
repo get and repo list support:
table(default) — PrettyTable displayjson— JSON string suitable for piping or scripting
For repo get, table is a curated key/value detail view; JSON is the full API payload.
For repo list, table and JSON both use the summary fields name, owner, url, visibility.
github-rest-cli repo list --format json
github-rest-cli repo get --name my-repo --format tableThese GitHub REST endpoints are not exposed by the CLI today, but are candidates for future commands:
| Capability | GitHub docs |
|---|---|
| Create from template | Create a repository using a template |
| Update repository | Update a repository |
| List org repositories | List organization repositories |
| List environments | List environments |
| Get environment | Get an environment |
| Delete environment | Delete an environment |