{"id":31039151,"url":"https://github.com/urpagin/gh-topicgen","last_synced_at":"2026-04-16T19:36:19.063Z","repository":{"id":310266735,"uuid":"1039275353","full_name":"Urpagin/gh-topicgen","owner":"Urpagin","description":"AI-generates (OpenAI) GitHub repo topics for you!","archived":false,"fork":false,"pushed_at":"2025-08-17T01:15:31.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-06T04:36:19.731Z","etag":null,"topics":["ai","auto-tagging","cli","command-line-tool","generative-ai","github","github-topics","keyword-extraction","llm","machine-learning","natural-language-processing","openai","openai-api","python","python-package","semantic-analysis","tagging","text-classification","topic-generation","topic-modeling"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Urpagin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2025-08-16T21:22:38.000Z","updated_at":"2025-08-17T01:15:34.000Z","dependencies_parsed_at":"2025-08-16T23:27:04.240Z","dependency_job_id":"53a1321e-396f-4f25-bbf2-1172b55a02c7","html_url":"https://github.com/Urpagin/gh-topicgen","commit_stats":null,"previous_names":["urpagin/gh-topicgen"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Urpagin/gh-topicgen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urpagin%2Fgh-topicgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urpagin%2Fgh-topicgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urpagin%2Fgh-topicgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urpagin%2Fgh-topicgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Urpagin","download_url":"https://codeload.github.com/Urpagin/gh-topicgen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urpagin%2Fgh-topicgen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275076529,"owners_count":25401315,"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","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ai","auto-tagging","cli","command-line-tool","generative-ai","github","github-topics","keyword-extraction","llm","machine-learning","natural-language-processing","openai","openai-api","python","python-package","semantic-analysis","tagging","text-classification","topic-generation","topic-modeling"],"created_at":"2025-09-14T07:48:39.179Z","updated_at":"2025-10-24T13:47:54.727Z","avatar_url":"https://github.com/Urpagin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gh-topicgen\n\nAutomatically fills in all GitHub repository topics to the max using AI to guess which topics are the best.\n\n\u003e [!NOTE]\n\u003e Still rough around the edges, untested \u0026 lacks features.\n\n## Why? 🧠\n\nI found myself wanting to fill each of my repos’ topics as much as I could, but it came at the cost of slowly and\nsequentially thinking about what keywords to choose. So of course I will take hours of my time to shave off a few\nseconds of creative thought.\n\n## Brief 📦\n\nA Python program that uses GitHub and OpenAI’s APIs, wiring them together to make an AI model generate a list of\ntopics (the tags/keywords you see on the repository page) based on the repo’s metadata:\ni.e., title, description, existing tags, programming languages, and of course the contents of the legendary `README.md`\nfile.\n\n## Behavior ⚙️\n\nFinal topics are ordered as: existing topics first, then AI-generated ones.\nIf you already have 5 topics, those five remain; the app only appends new topics until it reaches the maximum (`GithubConn.MAX_TOPIC_COUNT`). You can change this limit programmatically if you prefer to cap the list at N topics.\n\n\n## Quickstart 🚀\n\n\u003e [!TIP]\n\u003e As we’ll be working with dotfiles (files beginning with a `.`), your file manager may not show them by default.\n\u003e For a better experience, enable “show hidden files”.\n\n1. **Clone the repository and enter it.**\n\n   ```bash\n   git clone https://github.com/Urpagin/gh-topicgen.git\n   cd gh-topicgen\n   ```\n\n2. **Before running, populate the two API tokens you’ll need.**\n   Copy the `.env.example` file to `.env` and follow the instructions inside.\n\n   ```bash\n   cp .env.example .env\n   ```\n\n3.A **\\[Linux/macOS] Create a Python virtual environment and activate it (optional).**\n\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate\n```\n\n3.B **\\[Windows] Create a Python virtual environment and activate it (optional).**\n\n```bash\npy -m venv .venv\n.\\.venv\\Scripts\\activate\n```\n\n4. **Install the app (editable mode).**\n\n   ```bash\n   pip install -e .\n   ```\n\n5. **Run it to generate relevant topics for a repository.**\n\n\u003e [!CAUTION]\n\u003e For a first run, narrow changes to a single repository to try things out.\n\u003e Use `--regex`/`-r`, e.g. `ghtopicgen -v public -r 'Urpagin/slpcli'` to affect only the\n\u003e [Urpagin/slpcli](https://github.com/Urpagin/slpcli) repository.\n\u003e More info in the [Usage section](#usage).\n\n   ```bash\n   ghtopicgen --visibility public --regex 'YourUserName/YourRepoTitle'\n   ```\n\n\u003e [!TIP]\n\u003e If calling `ghtopicgen` doesn’t work, try:\n\u003e `python3 -m gh_topicgen \u003cyour arguments\u003e`\n\nTo quickly get the hang of the app, skim the [Examples section](#examples--uses).\n\n## Usage 🛠️\n\n```text\n$ python -m gh_topicgen -h\nusage: ghtopicgen [-h] [--gh-token GH_TOKEN] [--openai-token OPENAI_TOKEN] [--model MODEL] [--prompt PROMPT] [--regex REGEX] [--ignore-case]\n                  [--env-file PATH] [--no-input] [--take-my-money] --visibility {public,private,all}\n\nManage tokens/config.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --gh-token GH_TOKEN, -g GH_TOKEN\n                        GitHub token (overrides env; aka GH_TOKEN)\n  --openai-token OPENAI_TOKEN, -o OPENAI_TOKEN\n                        OpenAI token (overrides env; aka OPENAI_API_KEY)\n  --model MODEL, -m MODEL\n                        Which OpenAI model to use (https://platform.openai.com/docs/models)\n  --prompt PROMPT, -p PROMPT\n                        Path to AI system prompt file.\n  --regex REGEX, -r REGEX\n                        Regex for repo names (matches against full_name, e.g., 'Urpagin/slpcli').\n  --ignore-case, -i     Case-insensitive regex.\n  --env-file PATH, -e PATH\n                        Path to .env to load first (default: auto-detect)\n  --no-input            Do not prompt; fail if tokens are missing\n  --take-my-money       Special model spec: GPT-5 Thinking with high effort. If set, any --model value is ignored.\n  --visibility {public,private,all}, -v {public,private,all}\n                        What type of repositories to use.\n```\n\n## Examples / Uses 💡\n\nUsed to generate this repo’s topics:\n\n```bash\nghtopicgen -v public -m gpt-5 -r 'Urpagin/gh-topicgen'\n```\n\nGenerate the topics of **all** your repos (private + public) using the best model currently:\n\n```bash\nghtopicgen -v all --take-my-money\n```\n\nGenerate the topics of **all** your repos using the fastest and cheapest model (default model):\n\n```bash\nghtopicgen -v all -m gpt-5-nano\n```\n\n## AI Instructions 🤖\n\nThe system prompt given to the model is stored in `system_prompt.txt`.\nFeel free to tweak it as you wish.\n\n## Compatibility 🧪\n\nMade with compatibility in mind, avoiding highly modern 3.11/3.12-only features.\n\nCompatible with **Python ≥ 3.9**.\n\n```bash\n$ vermin --no-tips src/gh_topicgen/*\nMinimum required versions: 3.9\nIncompatible versions:     2\n```\n\n## Acknowledgements 🙏\n\n* [The PyGithub library](https://github.com/pygithub/pygithub) — interacting with the GitHub REST API\n* [The official OpenAI Python library](https://github.com/openai/openai-python) — interacting with the OpenAI REST API\n\n## License 📄\n\nEvery file in the repository falls under the MIT License.\n\nMIT © 2025 Urpagin.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furpagin%2Fgh-topicgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furpagin%2Fgh-topicgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furpagin%2Fgh-topicgen/lists"}