My Github CLI is a command-line interface (CLI) tool designed to interact with GitHub repositories. The tool allows users to:
- Track the commit status on a specified branch.
- View repository activity.
- View the number of contributors and their number of commits.
- List repository issues.
- Track Commit Status: Get the latest commit details of a specific branch.
- View Repository Activity: Monitor activities in the repository.
- View Number of Contributors and Commits: Get a list of contributors and their contributions.
- List Repository Issues: Retrieve and list issues from the repository.
- Node.js
- npm (Node Package Manager)
- GitHub account
- GitHub personal access token
-
Clone the repository:
git clone https://github.com/yourusername/my-node-cli.git cd my-node-cli
-
Install the dependencies:
npm install
-
Create a
.env
file in the root directory and add your GitHub personal access token:github_TOKEN=your_personal_access_token
Run the CLI tool using the following command:
node index.js
You will be prompted to enter the following details:
- GitHub username
- GitHub repository name
- Branch name
You will then be prompted to choose one of the following options:
- Track Commit Status
- View Repository Activity
- View Number of Contributors and Number of Commits
- List Repository Issues
node index.js
? Enter your GitHub username: yourusername
? Enter the GitHub repo name: yourrepo
? Enter the branch name: main
? Choose an option: Track Commit Status
The tool will execute the selected option and display the results. You will also be given the option to save the results to a file.
- commander - A command-line interface framework.
- chalk - Terminal string styling done right.
- inquirer - A collection of common interactive command-line user interfaces.
- ora - Elegant terminal spinner.
- fs - File system module.
- octokit - GitHub API client for JavaScript.
- The tool will attempt to load the
.env
file for the GitHub token. If it fails, an error message will be displayed. - Each GitHub API request is wrapped in a
try-catch
block to handle potential errors. If an error occurs during the request, an error message will be displayed with the error information.
- Add more GitHub API functionalities.
- Improve the user interface and experience.
- Add more robust error handling and validations.
- Implement pagination for results.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.
- Thanks to the octokit team for providing a robust GitHub API client.
- Thanks to the developers of commander, chalk, inquirer, and ora for their excellent libraries.