{"id":18640454,"url":"https://github.com/slashpai/gh-contrib","last_synced_at":"2025-11-04T20:30:26.438Z","repository":{"id":73876121,"uuid":"427084775","full_name":"slashpai/gh-contrib","owner":"slashpai","description":"To count github contributions","archived":false,"fork":false,"pushed_at":"2021-11-17T13:27:17.000Z","size":322,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-27T10:09:13.781Z","etag":null,"topics":["github-api","golang","golang-application","opensource-contributions","resume","slashpai-hack-hustle"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/slashpai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-11T17:21:15.000Z","updated_at":"2021-11-24T06:42:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"993d4f4c-a48c-44e3-95e0-4d9dbe13046a","html_url":"https://github.com/slashpai/gh-contrib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slashpai%2Fgh-contrib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slashpai%2Fgh-contrib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slashpai%2Fgh-contrib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slashpai%2Fgh-contrib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slashpai","download_url":"https://codeload.github.com/slashpai/gh-contrib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239441663,"owners_count":19639122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-api","golang","golang-application","opensource-contributions","resume","slashpai-hack-hustle"],"created_at":"2024-11-07T05:54:38.196Z","updated_at":"2025-11-04T20:30:26.403Z","avatar_url":"https://github.com/slashpai.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gh-contrib\n\nTo retrieve github contributions org wise or repo wise in a org and display in a tabular format (markdown)\n\n## Pre-requistes\n\n- Have a [gihub personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) which has permission to read repo status and user info. Takecare not to share token with anyone else since it works same as password :)\n\n  ![personal token](img/personal_token.png)\n\n## Note\n\nSince github api is [rate limited](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting) application might take longer to execute. I am yet to handle the rate limiting inside code to keep it waiting.\n\n## Features\n\n- [x] Count contributions org wise\n- [x] Count contributions repository wise in a org\n- [x] Generates file output to share\n\n## Usage\n\n### Contributions to a org\n\n```go\nUsage: gh-contrib contrib-org --token=STRING --org=STRING --author=STRING\n\nGithub contributions of a user in a org.\n\nFlags:\n  -h, --help             Show context-sensitive help.\n      --token=STRING     GitHub API token.\n      --output-file      Set to true if output file need to be generated.\n\n      --org=STRING       GitHub Org.\n      --author=STRING    Author.\n```\n\n### Contributions to a repo in an org\n\n```go\nUsage: gh-contrib contrib-repo --token=STRING --org=STRING --repo=STRING --author=STRING\n\nGithub contributions of a user to a repo of a org.\n\nFlags:\n  -h, --help             Show context-sensitive help.\n      --token=STRING     GitHub API token.\n      --output-file      Set to true if output file need to be generated.\n\n      --org=STRING       GitHub Org.\n      --repo=STRING      GitHub Repo in particular to check contributions.\n      --author=STRING    Author.\n```\n\n## Installation\n\n### Build and Install Binary\n\n```bash\ngit clone https://github.com/slashpai/gh-contrib.git\nmake build\n```\n\nExecute binary\n\n```go\n./gh-contrib help\n```\n\nor you can move it path like `/usr/local/bin` and execute simply `gh-contrib`\n\nIt should display output like below\n\n```go\nUsage: gh-contrib --token=STRING \u003ccommand\u003e\n\nCount your github contributions from command line\n\nFlags:\n  -h, --help            Show context-sensitive help.\n      --token=STRING    GitHub API token.\n      --output-file     Set to true if output file need to be generated.\n\nCommands:\n  contrib-org     Github contributions of a user in a org.\n  contrib-repo    Github contributions of a user to a repo of a org.\n\nRun \"gh-contrib \u003ccommand\u003e --help\" for more information on a command.\n```\n\n**Example Run**\n\nTo get contribution org wise\n\n```go\ngh-contrib contrib-org --token \u003ctoken\u003e --org \u003corg name\u003e --author \u003cgithub handle\u003e\n```\n\nTo get contribution repo wise in an org\n\n```go\ngh-contrib contrib-repo --token \u003ctoken\u003e --org \u003corg name\u003e --author \u003cgithub handle\u003e\n```\n\nTo generate output file, add flag --output-file to command\n\n```go\ngh-contrib contrib-org --token \u003ctoken\u003e --org \u003corg name\u003e --author \u003cgithub handle\u003e --output-file\n```\n\n### Build docker image locally\n\n```bash\nmake build-local-image\n```\n\nExecute as docker container\n\nTest running container. It should display help menu\n\n```go\ndocker run gh-contrib:v0.1.0\n```\n\nRun container to get org level contributions\n\n```go\ndocker run gh-contrib:v0.1.0 contrib-org --token \u003ctoken\u003e --org \u003corg name\u003e --author \u003cgithub handle\u003e\n```\n\nTo generate output file, add flag --output-file to command\n\n```go\ndocker run -v output_files:/opt/app gh-contrib:v0.1.0 contrib-org --token \u003ctoken\u003e --org \u003corg name\u003e --author \u003cauthor name\u003e --output-file\n```\n\nYou will require to volume path to view the file, this will be a bit different in [mac](https://timonweb.com/docker/getting-path-and-accessing-persistent-volumes-in-docker-for-mac/) but should be straight forward in linux.\n\n## Sample Output\n\n- [sample output](sample_output/sample_output_contrib-repo.md)\n\n## TODO\n\n- [ ] Add more logging info and created debugging mode\n- [ ] General Improvement \u0026 Optimisation\n- [ ] Add parallelism to code\n- [ ] Option to count contributions without specifying org\n- [ ] Add web output\n- [ ] Create executable to easily install the application\n- [ ] Handle rate-limiting which will be an issue for large org's\n\n## Contributing\n\n- Bug reports and pull requests are welcome\n\n  - Fork the project on GitHub\n  - Clone the project\n  - Add changes (and tests if applicable)\n  - Commit and push\n  - Create a pull request\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslashpai%2Fgh-contrib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslashpai%2Fgh-contrib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslashpai%2Fgh-contrib/lists"}