Skip to main content

Authentication


login

To access commands that require user authentication, you need to log in to your GitHub account using a Personal Access Token (PAT). Here's how you can do it:

Step 1: Generate a Personal Access Token (PAT)

Here it is with underline for Settings:

  1. Log in to your GitHub account and go to Settings.
  2. In the sidebar, click on Developer settings.
  3. Click on Personal access tokens and then select Tokens (classic).
  4. Click the Generate new token button.
  5. Give your token a descriptive name and select the necessary scopes (such as repo, read:org, and user).
  6. Scroll down and click Generate token.
  7. Copy the generated token.
warning

Important: Avoid selecting unnecessary scopes to prevent unauthorized access to your GitHub account.

info

Note: You can always revoke a token if you suspect it has been compromised.

Step 2: Authenticate with the Personal Access Token

Once you have your token, run the following command to authenticate with ghc:

ghc login

The CLI will prompt you to enter your PAT. Paste the token you generated in Step 1.

info

Note: While pasting the token on the terminal, right-click on the terminal.

Once authenticated, you will be able to access all the commands that require login.

ghc login

logout

To log out of your GitHub account, run the following command:

ghc logout
info

This will remove the stored token and log you out of your GitHub account.

ghc logout


Commands That Require Login 🔐

These commands perform actions that modify data or require access to private repositories, so user authentication is necessary:

Repository Management

Pull Request Management

Branch Management

Issue Management

Collaborator Management

User Management


Commands That Do Not Require Login 🔓

These commands are used for fetching data or interacting with public resources, and do not require authentication:

warning

Note: If the API rate limit is exceeded, you will be prompted to login to access the data.

Repository Information

Issue Information

Pull Request Information

  • pr-list – List pull requests for a repository
  • pr-info – Get details about a pull request

Branch Information

Collaborator Information

User Information

  • user-info – Get information about a GitHub user