Skip to main content

A CLI tool to add topics to a GitHub repository

Project description

Add GitHub Topics

A CLI tool to add topics (tags) to a GitHub repository using the GitHub API.

Features

  • Add a topic to any GitHub repository you have access to.
  • Automatically fetches existing topics to avoid overwriting them.
  • Defaults to current repository information if run within a git repo.
  • Supports .env file for secure token management.
  • Installable via pip and usable as a command-line tool.

Installation

You can install the package locally for development:

pip install .

Or install it directly from GitHub:

pip install git+https://github.com/ishandutta2007/add-github-topics.git

Setup

Create a .env file in your current directory and add your GitHub Personal Access Token:

ADMIN_TOKEN=your_github_token_here

Usage

After installation, you can use the add-github-topic command:

add-github-topic <topic> [options]

Arguments

  • topic: (Mandatory) The topic you want to add.

Options

  • --token: GitHub Access Token. If not provided, it uses ADMIN_TOKEN from .env.
  • --username: GitHub username. If not provided, it attempts to detect it from the current git configuration.
  • --reponame: GitHub repository name. If not provided, it uses the current folder name.

Example

add-github-topic python --username ishandutta2007 --reponame add-github-topics

If run inside a repository and .env is set up:

add-github-topic script

Development

To install dependencies for development:

pip install -e .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

add_github_topics-0.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

add_github_topics-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file add_github_topics-0.1.0.tar.gz.

File metadata

  • Download URL: add_github_topics-0.1.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for add_github_topics-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ce4940ec7f3c0101faf6ea39843ad48f32408d04ed4323e4572f04c8b033ddc9
MD5 2fdff7a62d7f949bd3d9f950c9dbf2a0
BLAKE2b-256 731eee9d9c5aec2d883552024a880c384f21587bc3ffc431700dd6835af92421

See more details on using hashes here.

File details

Details for the file add_github_topics-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for add_github_topics-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 996543d859d068e0f528091af561ca3d51c8371d0b5a7f5870d84e0cc47d6d33
MD5 71577e3740b1bfcb21a0c24b28827e7b
BLAKE2b-256 311b90962c3919633af184a65e928ca6921249429240f43d3180aa33dd74ac10

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page