A CLI tool to fetch and display the size of GitHub repositories.
Project description
github-repo-size-cli
A simple CLI tool to fetch the size of a GitHub repository.
Installation
You can install the tool using pip:
pip install github-repo-size-cli
Setting up Your GitHub API Token
Step 1: Obtain Your GitHub API Token
Before using the tool, you need to set your GitHub API token. Follow these steps to generate your GitHub token:
-
Go to GitHub and log in to your account.
-
Navigate to Settings > Developer settings > Personal access tokens.
-
Click Generate new token.
-
Provide a name for the token, select the required scopes (for repository access, at least
repois needed), and then click Generate token. -
Copy the generated token. Important: You won't be able to see it again once you leave the page.
Step 2: Set the GitHub API Token in the Tool
Once you have your token, you can set it globally using the tool. Run the following command:
grs --set-token <your-github-api-token>
This will store your GitHub API token in a global file (~/.github_token), so you won't need to enter it again in the future.
Usage
Fetch Repository Size
To fetch the size of a repository, simply run:
grs https://github.com/owner/repository.git
Replace owner and repository with the actual GitHub repository details. The tool will display the repository size in a human-readable format (KB, MB, or GB).
Example output:
Size of repository owner/repo: 2.44 MB
Clone the Repository (Optional)
After fetching the repository size, you will be asked if you'd like to clone the repository:
Do you want to clone the repository 'https://github.com/owner/repository.git'? (y/n):
Type y to clone the repository or n to skip cloning.
Update Your Token (if needed)
If you need to update your GitHub API token (e.g., if it expires), run the following command:
grs --update-token
You will be prompted to enter your new token.
Contributing
Fork the Github-Repo-Size-CLI and submit pull requests for any improvements!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file github-repo-size-cli-0.2.5.tar.gz.
File metadata
- Download URL: github-repo-size-cli-0.2.5.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e35de77167e07d3cfa3cd8f2d92d65b87c8578acfeac1908e9ffcb89154d6082
|
|
| MD5 |
2cc89b20b3bf6c42209ca0c4137c3025
|
|
| BLAKE2b-256 |
47e4d59df63c7349de4b97ad3c69776b127cbeaaf0e20c4f7d34159d7aff803a
|
File details
Details for the file github_repo_size_cli-0.2.5-py3-none-any.whl.
File metadata
- Download URL: github_repo_size_cli-0.2.5-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b285b6e5d28e64758b813d8aaf55c3d0ff4b69b4ea068cb409be2cf528c57bfe
|
|
| MD5 |
0a0705c178d719e3bc56b7560b1ccf19
|
|
| BLAKE2b-256 |
c4f6034fd016da0d34df66858d36d021f2b4a3b2c4a0f3f2bd4ca8cbac890431
|