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
45 changes: 0 additions & 45 deletions CHANGELOG.md

This file was deleted.

7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,9 @@ Publishing to PyPI is triggered by creating a GitHub Release. The workflow is [`
1. Ensure `main` is green (CI) and docs are up to date ([CLI guide](docs/cli.md), [configuration](docs/configuration.md)).
2. Agree the SemVer bump (breaking CLI changes usually mean a major or an intentional minor while still Beta).
3. Update `version` in [`pyproject.toml`](pyproject.toml).
4. Move `[Unreleased]` notes in [`CHANGELOG.md`](CHANGELOG.md) into a new version section with today’s date.
5. Open a PR for the version bump + changelog, merge to `main`.
6. Create a GitHub Release for the new tag (for example `v2.0.0`) whose target is the merge commit on `main`.
7. Confirm the **Python Publish Release** workflow succeeds on [PyPI](https://pypi.org/project/github-rest-cli/).
4. Open a PR for the version bump, merge to `main`.
5. Create a GitHub Release for the new tag (for example `v2.0.0`) whose target is the merge commit on `main`. Put the release notes in the GitHub Release description (drawn from merged PRs as needed).
6. Confirm the **Python Publish Release** workflow succeeds on [PyPI](https://pypi.org/project/github-rest-cli/).

Do not tag a release until the version in `pyproject.toml` matches the tag.

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Python CI](https://github.com/lbrealdev/github-rest-cli/actions/workflows/python-ci.yml/badge.svg)](https://github.com/lbrealdev/github-rest-cli/actions/workflows/python-ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

A Python CLI for common [GitHub REST API](https://docs.github.com/en/rest) operations—list and inspect repositories, create or delete them, manage Dependabot security settings, and create deployment environments.
A Python CLI for common [GitHub REST API](https://docs.github.com/en/rest) operations—list and inspect repositories, create, update, or delete them, manage Dependabot security settings, and create deployment environments.

## Installation

Expand Down Expand Up @@ -39,6 +39,10 @@ github-rest-cli --help
github-rest-cli repo list
github-rest-cli repo get --name my-repo
github-rest-cli repo create --name my-new-repo --private
github-rest-cli repo create --name my-app --template owner/template-repo
github-rest-cli repo update --name my-repo --description "Updated"
github-rest-cli repo update --name my-repo --new-name renamed-repo
github-rest-cli repo update --name my-repo --as-template
```

## Commands
Expand Down
55 changes: 49 additions & 6 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ github-rest-cli --version

| Group | Purpose |
| --- | --- |
| `repo` | Get, list, create, and delete repositories |
| `repo` | Get, list, create, update, and delete repositories |
| `dependabot` | Enable or disable Dependabot security updates |
| `environment` | Create deployment environments |

Expand All @@ -42,6 +42,8 @@ github-rest-cli environment --help
| `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 create` (template) | `POST /repos/{template_owner}/{template_repo}/generate` | [Create a repository using a template](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#create-a-repository-using-a-template) |
| `repo update` | `PATCH /repos/{owner}/{repo}` | [Update a repository](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#update-a-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) |
Expand All @@ -67,7 +69,7 @@ github-rest-cli repo get --name my-repo --format json
| `-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`.
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`, `is_template`.

JSON mode returns the full raw GitHub repository object from the API.

Expand Down Expand Up @@ -102,10 +104,13 @@ github-rest-cli repo list --role owner --format json

Create a repository. Visibility defaults to **public** when none of the visibility flags is passed.

With `--template OWNER/REPO`, the CLI uses the template generate endpoint instead of the normal create APIs. `--template` cannot be combined with `--empty`. Template create supports `--public` / `--private` only (not `--internal`).

**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)
- Template: `POST /repos/{template_owner}/{template_repo}/generate` — [Create a repository using a template](https://docs.github.com/en/rest/repos/repos?apiVersion=2026-03-10#create-a-repository-using-a-template)

```shell
github-rest-cli repo create --name my-new-repo
Expand All @@ -114,6 +119,9 @@ 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
github-rest-cli repo create --name my-app --template owner/template-repo
github-rest-cli repo create --name my-app --template owner/template-repo --private --include-all-branches
github-rest-cli repo create --name my-app --template owner/template-repo --org my-org
```

| Flag | Required | Default | Description |
Expand All @@ -122,10 +130,47 @@ github-rest-cli repo create --name my-new-repo --empty
| `-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) |
| `--internal` | No | — | Internal repository (org; not supported with `--template`) |
| `-e` / `--empty` | No | off | Create without an initial commit / README |
| `--template` | No | unset | Template repository as `OWNER/REPO` |
| `--include-all-branches` | No | off | Include all branches from the template (requires `--template`) |

`--public`, `--private`, and `--internal` are mutually exclusive. `--template` and `--empty` cannot be used together.

### `repo update`

`--public`, `--private`, and `--internal` are mutually exclusive.
Update settings on an existing repository. Pass at least one change option.

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

```shell
github-rest-cli repo update --name my-repo --description "Updated description"
github-rest-cli repo update --name my-repo --new-name renamed-repo
github-rest-cli repo update --name my-repo --private
github-rest-cli repo update --name my-repo --homepage https://example.com --default-branch main
github-rest-cli repo update --name my-repo --org my-org --archived
github-rest-cli repo update --name my-repo --unarchived
github-rest-cli repo update --name my-repo --as-template
github-rest-cli repo update --name my-repo --no-template
```

| Flag | Required | Default | Description |
| --- | --- | --- | --- |
| `-n` / `--name` | Yes | — | Current repository name |
| `-o` / `--org` | No | authenticated user | Organization owner |
| `--new-name` | No | unset | Rename the repository |
| `--description` | No | unset | Short description |
| `--homepage` | No | unset | Homepage URL |
| `--public` | No | unset | Make the repository public |
| `--private` | No | unset | Make the repository private |
| `--internal` | No | unset | Make the repository internal |
| `--default-branch` | No | unset | Default branch name |
| `--archived` | No | unset | Archive the repository |
| `--unarchived` | No | unset | Unarchive the repository |
| `--as-template` | No | unset | Mark the repository as a template |
| `--no-template` | No | unset | Unmark the repository as a template |

`--public`, `--private`, and `--internal` are mutually exclusive. `--archived` and `--unarchived` are mutually exclusive. `--as-template` and `--no-template` are mutually exclusive.

### `repo delete`

Expand Down Expand Up @@ -207,8 +252,6 @@ These GitHub REST endpoints are not exposed by the CLI today, but are candidates

| 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) |
Expand Down
Loading