Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Clarified `repo get` vs `repo list` table/JSON field behavior in the CLI guide.
- Documented `repo list` pagination flags (`--per-page`, `--page`, `--all`).
- Linked each CLI command to its GitHub REST API docs in the [CLI guide](docs/cli.md), plus a Related APIs section for endpoints not wrapped yet.

## [2.0.0] - 2026-07-21

Expand Down
46 changes: 46 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,27 @@ github-rest-cli dependabot --help
github-rest-cli environment --help
```

## Implemented commands and GitHub APIs

| CLI command | HTTP / path | GitHub docs |
| --- | --- | --- |
| `repo get` | `GET /repos/{owner}/{repo}` | [Get a repository](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#get-a-repository) |
| `repo list` | `GET /user/repos` | [List repositories for the authenticated user](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#list-repositories-for-the-authenticated-user) |
| `repo create` (user) | `POST /user/repos` | [Create a repository for the authenticated user](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#create-a-repository-for-the-authenticated-user) |
| `repo create` (org) | `POST /orgs/{org}/repos` | [Create an organization repository](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#create-an-organization-repository) |
| `repo delete` | `DELETE /repos/{owner}/{repo}` | [Delete a repository](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#delete-a-repository) |
| `dependabot enable` | Dependabot security updates | [Enable Dependabot security updates](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#enable-dependabot-security-updates) |
| `dependabot disable` | Dependabot security updates | [Disable Dependabot security updates](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#disable-dependabot-security-updates) |
| `environment create` | `PUT /repos/{owner}/{repo}/environments/{environment_name}` | [Create or update an environment](https://docs.github.com/en/rest/deployments/environments?apiVersion=2026-03-10#create-or-update-an-environment) |

## `repo`

### `repo get`

Fetch details for one repository.

**API:** `GET /repos/{owner}/{repo}` — [Get a repository](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#get-a-repository)

```shell
github-rest-cli repo get --name my-repo
github-rest-cli repo get --name my-repo --org my-org
Expand All @@ -60,6 +75,10 @@ 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](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#list-repositories-for-the-authenticated-user)

`--page` maps to GitHub's `per_page` query parameter (results per page, max 100). See also [Using pagination in the REST API](https://docs.github.com/en/rest/using-the-rest-api/using-pagination-in-the-rest-api?apiVersion=2026-03-10).

```shell
github-rest-cli repo list
github-rest-cli repo list --per-page 50 --sort pushed
Expand All @@ -83,6 +102,11 @@ github-rest-cli repo list --role owner --format json

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](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#create-a-repository-for-the-authenticated-user)
- Organization: `POST /orgs/{org}/repos` — [Create an organization repository](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#create-an-organization-repository)

```shell
github-rest-cli repo create --name my-new-repo
github-rest-cli repo create --name my-new-repo --private
Expand All @@ -107,6 +131,8 @@ github-rest-cli repo create --name my-new-repo --empty

Delete a repository. Prompts for confirmation unless `--yes` is passed.

**API:** `DELETE /repos/{owner}/{repo}` — [Delete a repository](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#delete-a-repository)

```shell
github-rest-cli repo delete --name my-repo
github-rest-cli repo delete --name my-repo --org my-org
Expand All @@ -125,6 +151,11 @@ github-rest-cli repo delete --name my-repo --yes

Enable or disable Dependabot security updates for a repository.

**API:**

- Enable — [Enable Dependabot security updates](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#enable-dependabot-security-updates)
- Disable — [Disable Dependabot security updates](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#disable-dependabot-security-updates)

```shell
github-rest-cli dependabot enable --name my-repo
github-rest-cli dependabot disable --name my-repo
Expand All @@ -142,6 +173,8 @@ github-rest-cli dependabot enable --name my-repo --org my-org

Create a deployment environment on a repository.

**API:** `PUT /repos/{owner}/{repo}/environments/{environment_name}` — [Create or update an environment](https://docs.github.com/en/rest/deployments/environments?apiVersion=2026-03-10#create-or-update-an-environment)

```shell
github-rest-cli environment create --name my-repo --env production
github-rest-cli environment create --name my-repo --env staging --org my-org
Expand All @@ -167,3 +200,16 @@ For `repo list`, table and JSON both use the summary fields `name`, `owner`, `ur
github-rest-cli repo list --format json
github-rest-cli repo get --name my-repo --format table
```

## Related APIs (not wrapped yet)

These 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](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#create-a-repository-using-a-template) |
| Update repository | [Update a repository](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#update-a-repository) |
| List org repositories | [List organization repositories](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#list-organization-repositories) |
| List environments | [List environments](https://docs.github.com/en/rest/deployments/environments?apiVersion=2026-03-10#list-environments) |
| Get environment | [Get an environment](https://docs.github.com/en/rest/deployments/environments?apiVersion=2026-03-10#get-an-environment) |
| Delete environment | [Delete an environment](https://docs.github.com/en/rest/deployments/environments?apiVersion=2026-03-10#delete-an-environment) |