A cli for @octokit/rest.
NOTE: This a WIP side-project. If you want to see this project do something it doesn't feel free to contribute! Currently the descriptions could use some work.
Features:
🚀 Run any octokit endpoint from the CLI
🚀 Automatically detect certain args in CI (owner, repo, issue_number)
You can either install octokit-cli to your project:
npm i --save-dev octokit-cli
# or
yarn add -D octokit-cliOr globally on your computer:
npm i -g octokit-cliMost commands require authentication to work. To authenticate create a personal-access-token then set GH_TOKEN to the token.
Locally you can add your GH_TOKEN to a file at the root of your project named .env.
GH_TOKEN=YOUR_PERSONAL_ACCESS_TOKENNow when you run octokit-cli you do not have to include your GH_TOKEN.
octokit-cli is a thin wrapper around @octokit/rest so it has a very similar API.
To get help for every command just add the --help flag.
Create a status on a PR:
octokit repos create-status --owner hipstersmoothie --repo octokit-cli --state error --sha b3859f9e787145c904aee28668e20960b8407e2 --context "My Status"Create a comment on a PR:
octokit issues create-comment --body "My Comment" --owner hipstersmoothie --repo octokit-cli --issue_number 26Fuzzy find an emoji:
Using fzf
octokit emojis get | fzfWhen run from a continuos integration (CI) environment, octokit-cli will detect the owner, repo, and issue_number and set these as defaults when running a command.
For example, if you ran the following command from a PR in your CI it would automatically include owner, repo, and issue_number. If ran locally these arguments would be required.
octokit issues create-comment --body "My Comment"If you want a feature or can fix a bug, submit a PR!
If you think a particular endpoint can be formatted better for the CLI, add a formatter in src/formatters.
First install the dependencies:
yarnyarn start- Build the CLI and watch for changesyarn build- Create a build of the CLI
