Skip to content

Commit

Permalink
Split commands and output for easy copying
Browse files Browse the repository at this point in the history
  • Loading branch information
Link- committed Jul 7, 2024
1 parent ccada2b commit 1d34a42
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ USAGE:
gh-token [global options] command [command options] [arguments...]
VERSION:
2.0.0
2.0.2
COMMANDS:
generate Generate a new GitHub App installation token
Expand All @@ -90,11 +90,13 @@ GLOBAL OPTIONS:
#### Run `gh token` as a `gh` CLI extension

```shell
$ gh token generate \
gh token generate \
--key ./.keys/private-key.pem \
--app-id 1122334 \
--installation-id 5566778
```

```json
{
"token": "ghs_8Joht_______________bLCMS___M0EPOhJ",
"expires_at": "2023-09-08T18:11:34Z",
Expand All @@ -111,11 +113,13 @@ $ gh token generate \
#### Run `gh token` and pass the key as a base64 encoded string

```shell
$ gh token generate \
gh token generate \
--base64-key $(printf "%s" $APP_KEY | base64) \
--app-id 1122334 \
--installation-id 5566778
```

```json
{
"token": "ghs_8Joht_______________bLCMS___M0EPOhJ",
"expires_at": "2023-09-08T18:11:34Z",
Expand All @@ -132,12 +136,14 @@ $ gh token generate \
#### Run `gh token` with GitHub Enterprise Server

```shell
$ gh token generate \
gh token generate \
--base64-key $(printf "%s" $APP_KEY | base64) \
--app-id 1122334 \
--installation-id 5566778 \
--hostname "github.example.com"
```

```json
{
"token": "ghs_8Joht_______________bLCMS___M0EPOhJ",
"expires_at": "2023-09-08T18:11:34Z",
Expand All @@ -154,7 +160,7 @@ $ gh token generate \
#### Fetch list of installations for an app

```shell
$ gh token installations \
gh token installations \
--key ./private-key.pem \
--app-id 2233445
```
Expand Down Expand Up @@ -222,14 +228,15 @@ $ gh token installations \
#### Revoke an installation access token

```shell
$ gh token revoke \
gh token revoke \
--token "v1.bb1___168d_____________1202bb8753b133919" \
--hostname "github.example.com"
```

```text
Successfully revoked installation token
```


### Example in a workflow

<details>
Expand Down

0 comments on commit 1d34a42

Please sign in to comment.