# github-key-rotator

> The GitHub Key Rotator (gkr) is a CLI tool to automate the process of rotating GitHub / GitHub Enterprise SSH keys.

Latest version **1.10.2** (published 2020-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install github-key-rotator
pnpm add github-key-rotator
yarn add github-key-rotator
bun add github-key-rotator
```

Provides the command `gkr`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.10.2 |
| Published | 2020-08-28 |
| First published | 2020-02-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 5 |
| Unpacked size | 10.7 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | kirintw |
| Maintainers | kirintwn |

## Links

- npm: https://www.npmjs.com/package/github-key-rotator
- Repository: https://github.com/kirintwn/github-key-rotator
- Issues: https://github.com/kirintwn/github-key-rotator/issues
- npm.io page: https://npm.io/package/github-key-rotator

## Dependencies (5)

- [axios](https://npm.io/package/axios.md) ^0.20.0
- [yargs](https://npm.io/package/yargs.md) ^15.4.1
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.4
- [common-tags](https://npm.io/package/common-tags.md) ^1.8.0
- [source-map-support](https://npm.io/package/source-map-support.md) ^0.5.19

## Recent versions

- 1.10.2 (latest) — 2020-08-28
- 1.10.1 — 2020-08-16
- 1.10.0 — 2020-06-26
- 1.9.0 — 2020-06-10
- 1.8.0 — 2020-05-27
- 1.7.0 — 2020-05-20
- 1.6.0 — 2020-04-28
- 1.5.0 — 2020-03-30
- 1.4.0 — 2020-02-21
- 1.3.0 — 2020-02-17
- 1.2.0 — 2020-02-04
- 1.1.1 — 2020-02-04
- 1.1.0 — 2020-02-04

## README

# GitHub Key Rotator

The GitHub Key Rotator (gkr) is a CLI tool to automate the process of rotating GitHub / GitHub Enterprise SSH keys.

## Quick start

- Make sure your computer has:

  - `node`: `>=12.0.0`
  - `npm`: `>=6.0.0`
  - `ssh-agent`, `ssh-keygen` & `ssh-add`

- [Create a GitHub personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line)

  - please do check the `admin:public_key` permision for the token

- Install the CLI:

  ```
  npm install -g github-key-rotator
  ```

- Generate the key with CLI

  ```sh
  gkr -e YOUR_EMAIL -t YOUR_GITHUB_ACCESS_TOKEN
  # more usage please see gkr --help
  ```

- Config your `~/.ssh/config` to have:

  ```sh
  ######Add this section only if you are on MacOS######
  Host *
    AddKeysToAgent yes
    UseKeychain yes
  #####################################################

  Host github.com                  # or your GitHub Enterprise Domain
    Hostname github.com            # or your GitHub Enterprise Domain
    IdentityFile ~/.ssh/github     # same as the arg of `--file -f` you pass to the CLI, default is `~/.ssh/github`
    IdentitiesOnly yes
  ```

## Development scripts

- `npm test`: run tests (currently only run linting)
- `npm run lint`: run lint & typecheck
- `npm run build`: build the cli for local
- `npm start`: dev with [`ts-node`](https://github.com/TypeStrong/ts-node)

---
_Source: https://npm.io/package/github-key-rotator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
