Skip to content

My Node CLI is a command-line tool that interacts with GitHub repositories, allowing users to track commit status, view repository activity, contributors, and issues. It uses `commander`, `chalk`, `inquirer`, `ora`, `fs`, and `octokit` to provide a seamless user experience.

Notifications You must be signed in to change notification settings

vennisabarfi/github_cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Github CLI

Description

My Github CLI is a command-line interface (CLI) tool designed to interact with GitHub repositories. The tool allows users to:

  1. Track the commit status on a specified branch.
  2. View repository activity.
  3. View the number of contributors and their number of commits.
  4. List repository issues.

Features

  • 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.

Prerequisites

  • Node.js
  • npm (Node Package Manager)
  • GitHub account
  • GitHub personal access token

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/my-node-cli.git
    cd my-node-cli
  2. Install the dependencies:

    npm install
  3. Create a .env file in the root directory and add your GitHub personal access token:

    github_TOKEN=your_personal_access_token

Usage

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

Example

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.

Dependencies

  • 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.

Error Handling

  • 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.

Future Improvements

  • Add more GitHub API functionalities.
  • Improve the user interface and experience.
  • Add more robust error handling and validations.
  • Implement pagination for results.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

  • 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.

About

My Node CLI is a command-line tool that interacts with GitHub repositories, allowing users to track commit status, view repository activity, contributors, and issues. It uses `commander`, `chalk`, `inquirer`, `ora`, `fs`, and `octokit` to provide a seamless user experience.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published