https://github.com/hyperjumptech/export-github-clones-views
A CLI to export the stats of clones and views of repositories
https://github.com/hyperjumptech/export-github-clones-views
Last synced: 12 months ago
JSON representation
A CLI to export the stats of clones and views of repositories
- Host: GitHub
- URL: https://github.com/hyperjumptech/export-github-clones-views
- Owner: hyperjumptech
- License: apache-2.0
- Created: 2020-12-03T15:32:45.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-08T08:29:28.000Z (over 5 years ago)
- Last Synced: 2025-04-24T05:26:20.782Z (about 1 year ago)
- Language: TypeScript
- Size: 95.7 KB
- Stars: 4
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCTS.md
Awesome Lists containing this project
README
# export-github-clones-views
[](https://oclif.io)
[](https://npmjs.org/package/@hyperjumptech/export-github-clones-views)
[](https://github.com/hyperjumptech/export-github-clones-views/blob/master/package.json)
# About
This is a CLI to fetch the daily number of **clones** and **views** of one or many github repositories to which you have push access. You can run this script regularly to track the traffic of clones and views of your repositories in a long term since the data shown in a Github repository website cannot be exported and only shows up to few days back.
# Prerequisite
1. Create a Personal Access Token in your [Github settings](https://github.com/settings/tokens). Make sure you select the **repo** scope.
2. Optionally run a mongodb server to store the data.
# Install
```sh-session
$ npm install -g @hyperjumptech/export-github-clones-views
```
# Usage
To simply print the data to console, run the following
```sh-session
$ export-github-clones-views -u -p user/reponame1 organization/reponame2 ...
```
To store the data to mongodb, provide the mongodb uri,
```sh-session
$ export-github-clones-views -u -p -m user/reponame1 organization/reponame2 ...
```
Notes:
1. You can add any number of repositories as the argument of the command.
2. The repository needs to include both the username/organization and the repository name, e.g., `hyperjumptech/export-github-clones-views`.
3. Example of `MONGODB_URI`: `mongodb+srv://username:password@mongodb.net/database-name`.
4. Use the Personal Access Token you generated as `GITHUB_PASSWORD`
5. You can use environment variables instead of command line arguments. Check out the help of the command line.
# Articles
- Bahasa Indonesia: [Ketika Jumlah Git Clone Menjadi KPI](https://medium.com/hyperjump-tech/melacak-jumlah-git-clone-per-hari-di-github-1c187eaf90bb).
- English: [How to track the traffic of views and clones of Github Repository](https://nico.fyi/articles/track-github-clones-views-traffic)