gua-0 is a simple command-line interface (CLI) tool that fetches the recent activity of a GitHub user and displays it directly in the terminal. It allows you to interact with GitHub's event API, filter and sort activities, and export the results in multiple formats.
Clone the repository to your local machine.
git clone https://github.com/yourusername/gua-0.git
cd gua-0To use the gua-0 tool, you will need Node.js installed. You can then install the required dependencies by running:
npm installRun the following command to fetch the recent activity for a GitHub user:
npx ts-node src/index.ts <Github Username>Replace <Github Username> with the actual GitHub username whose activities you want to track.
You can filter the results by event type (e.g., PushEvent, IssuesEvent, etc.):
npx ts-node src/index.ts <Github Username> --filter=PushEvent- PushEvent: Triggered when commits are pushed to a repository.
- IssuesEvent: Triggered when an issue is opened, edited, closed, or reopened.
- PullRequestEvent: Triggered when a pull request is opened, closed, or merged.
- PullRequestReviewEvent: Triggered when a pull request review is submitted.
- PullRequestReviewCommentEvent: Triggered when a comment is added to a pull request review.
- WatchEvent: Triggered when a repository is starred.
- ForkEvent: Triggered when a repository is forked.
- IssueCommentEvent: Triggered when a comment is added to an issue.
- CreateEvent: Triggered when a repository, branch, or tag is created.
- DeleteEvent: Triggered when a branch or tag is deleted.
- ReleaseEvent: Triggered when a release is published.
- PublicEvent: Triggered when a private repository is made public.
- MemberEvent: Triggered when a user is added to a repository as a collaborator.
You can now sort the fetched activities either by date or type.
Sort by date:
npx ts-node src/index.ts <Github Username> --sort=dateSort by type:
npx ts-node src/index.ts <Github Username> --sort=typeYou can export the fetched activities in multiple formats: JSON, CSV, and Markdown.
Export as JSON:
npx ts-node src/index.ts <Github Username> --export=jsonExport as CSV:
npx ts-node src/index.ts <Github Username> --export=csvExport as Markdown:
npx ts-node src/index.ts <Github Username> --export=mdThe CLI now displays more detailed and structured information about the user, such as:
- Name
- Bio
- Public repositories count
- Followers
- Following
You can customize the number of activities you want to retrieve by using the --limit flag:
npx ts-node src/index.ts <Github Username> --limit=10This will fetch the 10 most recent activities for the user.
You can fetch additional pages of activities using the --page flag:
npx ts-node src/index.ts <Github Username> --page=2This will fetch the activities from the second page.
Use the --from and --to flags to specify a date range for filtering activities:
npx ts-node src/index.ts <Github Username> --from=2024-01-01 --to=2024-12-31This will fetch activities within the specified date range (e.g., from January 1, 2024 to December 31, 2024).
| Argument | Description |
|---|---|
--filter=<type> |
Filter activities by event type (e.g., PushEvent, PullRequestEvent). |
--sort=<field> |
Sort activities by field (date or type). |
--export=<format> |
Export activities in json, csv, or md (Markdown) format. |
--limit=<number> |
Limit the number of activities fetched (e.g., --limit=10). |
--page=<number> |
Fetch activities from a specific page (for pagination). |
--from=<date> |
Filter activities starting from a specific date (e.g., 2024-01-01). |
--to=<date> |
Filter activities until a specific date (e.g., 2024-12-31). |
-
Fetch the most recent activities for a GitHub user:
npx ts-node src/index.ts octocat
-
Filter activities by a specific event type (e.g., PushEvent):
npx ts-node src/index.ts octocat --filter=PushEvent
-
Sort activities by date:
npx ts-node src/index.ts octocat --sort=date
-
Export activities in CSV format:
npx ts-node src/index.ts octocat --export=csv
-
Limit the number of fetched activities to 5:
npx ts-node src/index.ts octocat --limit=5
-
Fetch activities from a specific date range:
npx ts-node src/index.ts octocat --from=2024-01-01 --to=2024-12-31
-
Fetch activities from the second page:
npx ts-node src/index.ts octocat --page=2
Feel free to fork the repository and submit pull requests. All contributions are welcome!