Skip to content

Latest commit

Β 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Add GitHub Topics Banner

πŸš€ Add GitHub Topics CLI 🏷️

Automate your GitHub repository tagging process with a single command!

PyPI version Python versions License: MIT GitHub stars GitHub followers


🌟 Overview

add-github-topics is a powerful and lightweight Python CLI tool designed to help developers and maintainers programmatically manage their GitHub repository topics. Whether you are managing a single project or automating a large-scale migration, this tool simplifies the process of adding descriptive tags to your repositories.

Topics are essential for SEO on GitHub, making your projects more discoverable to the community! πŸ”

✨ Key Features

  • βœ… Smart Appending: Fetches existing topics first to avoid accidental overwrites.
  • βœ… Zero Config Defaults: Automatically detects username and repository name from your local git environment.
  • βœ… Secure Token Handling: Supports .env files for managing your GitHub Personal Access Token (PAT).
  • βœ… Global CLI: Once installed, use it from any directory in your terminal.
  • βœ… Cross-Platform: Works seamlessly on Windows, macOS, and Linux.

πŸš€ Quick Start

1. Installation πŸ“¦

Install the tool directly from PyPI:

pip install add-github-topics

2. Configuration βš™οΈ

Set your GitHub token in any of the following ways (in order of priority):

  1. CLI Argument:

    add-github-topic python --token ghp_your_token_here
  2. Environment Variable:

    • Bash / Zsh:
      export GITHUB_TOKEN=ghp_your_token_here
    • PowerShell:
      $env:GITHUB_TOKEN = "ghp_your_token_here"
  3. .env File: Create a .env file in your repository or home directory:

    GITHUB_TOKEN=ghp_your_token_here

    (Also supports GH_TOKEN and legacy ADMIN_TOKEN)

  4. GitHub CLI (gh): If you already have GitHub CLI installed and logged in (gh auth login), the CLI will automatically fallback to gh auth token with zero manual configuration!

3. Basic Usage πŸ› οΈ

Run the command from within any git repository:

add-github-topic python

πŸ“– Detailed Usage Guide

add-github-topic <topic> [options]

Options Explained

Option Shortcut Description Default
topics - One or more topics to add (space- or comma-separated). -
--token -t Your GitHub Personal Access Token. GITHUB_TOKEN, GH_TOKEN, ADMIN_TOKEN (environment / .env), or gh auth token
--username, --owner -u Your GitHub username / organization. Auto-detected from git remote origin
--reponame, --repo -r Target repository name. Auto-detected from git remote origin
--list -l List all current topics for the repository. false
--remove -d Remove the specified topic(s) instead of adding. false

Examples πŸ“

Add a single topic:

add-github-topic python

Add multiple topics in one go:

add-github-topic automation cli-tool devops
# or comma-separated
add-github-topic python,fastapi,docker

List current topics:

add-github-topic --list

Remove topics:

add-github-topic --remove cli-tool

Target a specific repository and user/org:

add-github-topic machine-learning --username ishandutta2007 --reponame awesome-ml-project

πŸ› οΈ Development & Contributions

Contributions are welcome! If you'd like to improve this tool:

  1. Clone the repo: git clone https://github.com/ishandutta2007/add-github-topics.git
  2. Install in editable mode: pip install -e .
  3. Submit a Pull Request!

πŸ› οΈ Publish to PYPI

git tag v0.2.0 && git push origin v0.2.0

πŸ“ˆ Star History


Made with ❀️ by Ishan Dutta

About

add GitHub Topics 🌟 Star if you like it! 🌟

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages