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:
- Log in to your GitHub account and go to Settings.
- In the sidebar, click on Developer settings.
- Click on Personal access tokens and then select Tokens (classic).
- Click the Generate new token button.
- Give your token a descriptive name and select the necessary scopes (such as
repo
,read:org
, anduser
). - Scroll down and click Generate token.
- Copy the generated token.
Important: Avoid selecting unnecessary scopes to prevent unauthorized access to your GitHub account.
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.
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.
logout
To log out of your GitHub account, run the following command:
ghc logout
This will remove the stored token and log you out of your GitHub account.
Commands That Require Login 🔐
These commands perform actions that modify data or require access to private repositories, so user authentication is necessary:
Repository Management
repo-list
– List public repositories for a userrepo-create
– Create a new GitHub repositoryrepo-update
– Update a GitHub repositoryrepo-delete
– Delete a GitHub repositoryrepo-star
– Star a GitHub repositoryrepo-unstar
– Unstar a GitHub repositoryrepo-fork
– Fork a GitHub repositoryrepo-traffic
– Get traffic statistics for a GitHub repository
Pull Request Management
Branch Management
branch-create
– Create a new branchbranch-delete
– Delete a branch
Issue Management
issue-create
– Create a new issue for a GitHub repositoryissue-update
– Update an existing issueissue-close
– Close an issue
Collaborator Management
add-collaborator
– Add a collaborator to a repositoryremove-collaborator
– Remove a collaborator from a repository
User Management
user-update
– Update user information (self)
Commands That Do Not Require Login 🔓
These commands are used for fetching data or interacting with public resources, and do not require authentication:
Note: If the API rate limit is exceeded, you will be prompted to login to access the data.
Repository Information
repo-clone
– Clone a GitHub repositoryrepo-info
– Get detailed information about a repositoryrepo-actions
– List GitHub Actions for a repository
Issue Information
issue-list
– List issues in a repositoryissue-info
– Get detailed information about an issue
Pull Request Information
Branch Information
branch-list
– List all branches in a repository
Collaborator Information
collaborator-list
– List collaborators for a repository
User Information
user-info
– Get information about a GitHub user