Skip to main content

gh-toolkit

categorization cli-tool github llm portfolio-management python repository-management shell repository-health-checking topic-tagging

PyPI version Python 3.12+

GitHub repository portfolio management and presentation toolkit with LLM-powered categorization and beautiful site generation

A comprehensive command-line tool for managing GitHub repository portfolios at scale. Perfect for academics, educators, and developers who need to organize, categorize, and showcase their GitHub repositories professionally.

✨ Features

  • 📋 Repository Management - List, filter, and extract comprehensive repository data
  • 🤖 LLM-Powered Categorization - Intelligent repository classification using Claude AI
  • 📝 Description Generation - AI-powered repository description creation
  • 🏷️ Automated Topic Tagging - Smart topic suggestions with custom tag preferences
  • 🔖 Topic Badges - Generate shields.io badges from repository topics
  • 🩺 Repository Health Checking - Comprehensive quality audits with best practices compliance
  • 🎨 Portfolio Site Generation - Beautiful, responsive HTML portfolios with 4 themes
  • 📄 Landing Page Generation - Convert README.md to stunning HTML or Jekyll pages
  • 📧 Invitation Management - Bulk accept/leave repository collaborations
  • 🏢 Organization READMEs - Generate and push org profile READMEs directly to GitHub
  • 🎯 Academic Workflow - Perfect alternative to GitHub Classroom
  • 🖥️ Interactive TUI - Full-featured terminal UI for visual repository management
  • ⚡ Modern CLI - Built with typer and rich for beautiful terminal experience

gh-toolkit vs GitHub CLI (gh)

gh-toolkit complements the official GitHub CLI (gh) rather than replacing it.

Use gh for Use gh-toolkit for
Pull requests & issues Portfolio site generation
GitHub Actions workflows Bulk repository operations
Releases & gists AI-powered categorization
Codespaces & projects Repository health auditing
Single-repo operations Cross-org portfolio management
Raw API access Academic/educator workflows

They work great together:

# Daily work with gh
gh pr create --fill && gh run watch

# Portfolio presentation with gh-toolkit
gh-toolkit repo extract my-repos.txt --output data.json
gh-toolkit site generate data.json --theme resume

See docs/gh-cli-comparison.md for a detailed feature comparison.

Working with local clones instead? gh-toolkit manages your repos on GitHub. For the checkouts on your disk, two focused tools pair well with it: gita for multi-repo status and batch git commands across many clones, and git-reclaim — a tiny, zero-dependency git reclaim subcommand that frees disk space (purge regenerable caches, git gc) and flags clones that are safe to delete because the remote already has everything.

Want one verb set across all of them? gx is a thin dispatcher for gh, gh-toolkit, gita, and git-reclaim.

🚀 Quick Start

Installation

pip install gh-toolkit

Authentication

Most commands need a GitHub token. gh-toolkit resolves one from the first available source, so if you already use the gh CLI there's nothing to set up:

  1. The --token flag (visible in shell history/process lists — prefer the others)
  2. The GITHUB_TOKEN environment variable
  3. A token key in the config file (see below)
  4. The gh CLI's stored token (gh auth token)

Configuration file (optional)

Put repeated defaults in gh-toolkit.toml (project-local, takes precedence) or ~/.config/gh-toolkit/config.toml:

token = "ghp_..."        # optional — env var or gh CLI usually better

Basic Usage

# List repositories
gh-toolkit repo list username

# Extract repository data with LLM categorization
gh-toolkit repo extract repos.txt --anthropic-key=sk-...

# Generate beautiful portfolio site
gh-toolkit site generate repos_data.json --theme educational

# Convert README to landing page
gh-toolkit page generate README.md --output index.html

# Check repository health and best practices
gh-toolkit repo health username/repo --rules academic

# Check credentials, config, and optional tools
gh-toolkit doctor

# Add topic tags to repositories
gh-toolkit repo tag username/* --dry-run

# Manage invitations (perfect for educators)
gh-toolkit invite accept --dry-run

📖 Commands

Repository Commands

# List repositories with filters
gh-toolkit repo list michael-borck --public --language Python

# Machine-readable output for piping (jq, spreadsheets, gradebooks)
gh-toolkit repo list michael-borck --json | jq '.[].name'

# Extract comprehensive data (concurrent; --resume continues an interrupted run)
gh-toolkit repo extract repos.txt \
  --anthropic-key=sk-... \
  --parallel 8 \
  --output portfolio_data.json
gh-toolkit repo extract repos.txt --resume --output portfolio_data.json

# Generate repository descriptions with AI
gh-toolkit repo describe "user/*" --dry-run
gh-toolkit repo describe user/repo --model claude-sonnet-4-6

# Add intelligent topic tags
gh-toolkit repo tag user/repo --force --anthropic-key=sk-...
gh-toolkit repo tag "user/*" --tags "edtech: Educational, tool: CLI tools"

# Generate topic badges for READMEs
gh-toolkit repo badges user/repo
gh-toolkit repo badges "user/*" --apply  # Auto-update READMEs

# Check repository health and compliance
gh-toolkit repo health user/repo --rules professional --min-score 80
gh-toolkit repo health "user/*" --json | jq '.[] | {repo: .repository, grade}'

# Audit descriptions, Australian spelling, and topics; write a backup
gh-toolkit repo audit --user --include-private --json
gh-toolkit repo audit --user --include-private \
  --output audit.json --backup gh-toolkit-backup.json

# Enforce the standard tag vocabulary during an audit
gh-toolkit repo audit --user --vocabulary tags.yaml

# Restore descriptions and topics from a backup
gh-toolkit repo restore gh-toolkit-backup.json --dry-run
gh-toolkit repo restore gh-toolkit-backup.json --yes

# Fix descriptions selected by the audit: propose, review, then apply
gh-toolkit repo describe --from-audit audit.json \
  --only missing --only truncated --only spelling --spelling en-AU \
  --dry-run --output proposals.json --backup before.json
gh-toolkit repo describe --apply-proposals proposals.json --yes

# Custom rubric: re-weight checks, set grade thresholds, mark checks required
gh-toolkit repo health user/repo --rubric example_rubric.yaml

# Post the health report back as a GitHub issue (idempotent; confirms first)
gh-toolkit repo health "org/*" --post-issue

# Roster submission report (joins health to a class roster CSV)
gh-toolkit repo roster students.csv --org cs101 --repo-pattern "lab1-{github}"

# Clone repos; --before snapshots each at the last commit before a deadline
gh-toolkit repo clone student_repos.txt --target-dir ./submissions
gh-toolkit repo clone student_repos.txt --before "2026-06-12 23:59"

Site Generation

# Generate portfolio with different themes
gh-toolkit site generate repos.json --theme educational
gh-toolkit site generate repos.json --theme resume  
gh-toolkit site generate repos.json --theme research
gh-toolkit site generate repos.json --theme portfolio

# Custom title and metadata
gh-toolkit site generate repos.json \
  --title "My Projects" \
  --description "My awesome software" \
  --metadata custom.yaml

Page Generation

# Generate standalone HTML landing page
gh-toolkit page generate README.md

# Generate Jekyll-compatible markdown
gh-toolkit page generate README.md --jekyll --output index.md

# Custom title and description
gh-toolkit page generate README.md --jekyll \
  --title "My Project" \
  --description "Amazing software project"

Organization Commands

# Generate README for an organization
gh-toolkit org readme my-org --template detailed

# Push README directly to organization's GitHub profile
gh-toolkit org readme my-org --apply

# Generate with filtering
gh-toolkit org readme my-org --max-repos 20 --min-stars 5 --apply

Portfolio Commands

# Generate cross-organization portfolio
gh-toolkit portfolio generate --discover
gh-toolkit portfolio generate --org org1 --org org2 --html portfolio.html

# Audit repositories for missing metadata
gh-toolkit portfolio audit --discover
gh-toolkit portfolio audit --user --output audit-report.json

# Fix what the audit finds: generate missing descriptions/topics in place
gh-toolkit portfolio audit --org my-org --fix --dry-run   # preview first
gh-toolkit portfolio audit --org my-org --fix --license mit

Invitation Management

# Accept all pending invitations
gh-toolkit invite accept --dry-run

# Leave repositories you're collaborating on
gh-toolkit invite leave --confirm

🖥️ Terminal UI (TUI)

gh-toolkit includes a full-featured terminal user interface for visual repository management.

Installation

# Install with TUI support
pip install gh-toolkit[tui]

Launch

gh-toolkit tui

Features

  • Browse Organizations - Navigate your GitHub organizations visually
  • Search & Filter - Press / to search repos by name or description
  • Multi-Select - Use Space to select multiple repos, Ctrl+A to select all
  • Bulk Actions - Press a to open the action modal for selected repos
  • Context-Aware - Actions apply to selected items or all visible items

Keybindings

Key Action
? Show help
a Open actions menu
/ Search/filter
Space Toggle selection
Ctrl+A Select all
Ctrl+D Deselect all
Enter View/drill down
Esc Back/cancel
s Cycle sort (in org view)
g Generate README (in org view)

Actions Menu

The TUI provides form-based action selection:

  • Generate Descriptions - AI-powered descriptions with model selection
  • Add Topics - Intelligent tagging with preferred tag support
  • Generate Badges - Create shields.io badges with style options
  • Health Check - Audit repository quality
  • Audit - Find missing metadata

All actions support dry-run mode for safe previewing.

🎨 Portfolio Themes

Educational Theme

Perfect for educators and academic portfolios

  • Purple gradient design
  • Emphasizes learning resources and tools
  • Category order: Desktop → Web → Python → Learning Resources

Resume Theme

Professional showcase for career portfolios

  • Blue corporate design
  • Highlights technical expertise
  • Category order: Web → Desktop → Python → Infrastructure

Research Theme

Academic research and scientific computing

  • Green academic design
  • Focuses on publications and analysis
  • Category order: Learning → Analysis → Python → Web

Portfolio Theme

General project showcase

  • Indigo modern design
  • Balanced category presentation
  • Category order: Web → Desktop → Python → Infrastructure

🤖 LLM Integration

gh-toolkit integrates with Anthropic's Claude for intelligent repository analysis:

  • Smart Categorization - Analyzes README, description, languages, and topics
  • Confidence Scoring - Shows certainty of AI classifications
  • Graceful Fallback - Uses rule-based classification when LLM unavailable
  • Topic Generation - Suggests relevant GitHub topics based on content
export ANTHROPIC_API_KEY=sk-ant-...
gh-toolkit repo extract repos.txt  # Uses LLM automatically

📚 Academic Use Case

Perfect alternative to GitHub Classroom:

# Students accept repository invitations
gh-toolkit invite accept

# Track submissions against a class roster (CSV with a github username column).
# Reports who set up their repo and its hygiene score — not a mark of the work.
gh-toolkit repo roster students.csv --org cs101 --repo-pattern "lab1-{github}"
gh-toolkit repo roster students.csv --org cs101 --output submissions.csv

# Snapshot every submission at the deadline (last commit before the due date),
# producing an owner/repo folder tree ready for content-assessment tools.
gh-toolkit repo clone student_repos.txt --before "2026-06-12 23:59" \
  --target-dir ./submissions

# Extract all student repositories  
gh-toolkit repo extract student_repos.txt --anthropic-key=sk-...

# Generate class portfolio site
gh-toolkit site generate student_data.json \
  --theme educational \
  --title "CS 101 Student Projects" \
  --output class_portfolio.html

The roster CSV needs a GitHub username column (github, username, handle, …); name, student_id, and an explicit repo column are optional and auto-detected. Each student's repo is resolved from an explicit repo column, the --repo-pattern (fields: {github}, {username}, {id}, {name}), or org/<username>. See example_roster.csv. This is the GitHub-side companion to content-assessment tools — it tracks whether the repo was submitted and set up well, leaving marking of the work to a human (see docs/ROADMAP.md).

🛠️ Development

Setup

git clone https://github.com/michael-borck/gh-toolkit.git
cd gh-toolkit
uv sync --group dev

Testing

# Run all tests
./scripts/test.sh

# Generate coverage report
./scripts/coverage.sh

# Run specific test suites
uv run pytest tests/unit/ -v
uv run pytest tests/integration/ -v

Architecture

src/gh_toolkit/
├── cli.py                 # Main CLI entry point
├── commands/              # Command implementations
│   ├── repo.py           # Repository management (list, extract, describe, badges, health)
│   ├── org.py            # Organization commands (readme)
│   ├── portfolio.py      # Portfolio commands (generate, audit)
│   ├── site.py           # Site generation
│   ├── tag.py            # Topic tagging
│   └── invite.py         # Invitation management
├── tui/                   # Terminal UI (optional)
│   ├── app.py            # Main TUI application
│   ├── screens/          # TUI screens (home, org, repo, help)
│   └── widgets/          # Reusable widgets (action modal, etc.)
└── core/                  # Core functionality
    ├── github_client.py   # GitHub API client
    ├── repo_extractor.py  # Data extraction
    ├── site_generator.py  # HTML generation
    ├── readme_generator.py # Organization README generation
    └── topic_tagger.py    # LLM tagging

🔧 Configuration

Environment Variables

export GITHUB_TOKEN=ghp_...          # GitHub personal access token
export ANTHROPIC_API_KEY=sk-ant-...  # Anthropic API key (optional)

GitHub Token Scopes

  • repo - Access repositories
  • read:org - Read organization membership
  • write:org - Accept organization invitations

📊 Example Workflow

# 1. Extract repository data
gh-toolkit repo extract my_repos.txt \
  --anthropic-key=$ANTHROPIC_API_KEY \
  --output extracted_data.json

# 2. Add topic tags
gh-toolkit repo tag my_repos.txt \
  --anthropic-key=$ANTHROPIC_API_KEY \
  --force

# 3. Generate portfolio site
gh-toolkit site generate extracted_data.json \
  --theme portfolio \
  --title "My Software Portfolio" \
  --output index.html

# 4. Deploy to GitHub Pages
# Upload index.html to your GitHub Pages repository

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments


⭐ Star this repository if gh-toolkit helps you manage your GitHub portfolio!

Metadata

Release files for gh-toolkit 0.29.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gh-toolkit 0.29.0
File Size Uploaded Provenance Actions
gh_toolkit-0.29.0.tar.gz 341.7 kB Without provenance Details for gh_toolkit-0.29.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gh-toolkit 0.29.0
File Interpreter ABI Platform Actions
gh_toolkit-0.29.0-py3-none-any.whl Python 3 none any Details for gh_toolkit-0.29.0-py3-none-any.whl

Total release size: 515.8 kB

Release files / gh_toolkit-0.29.0.tar.gz

Download URL gh_toolkit-0.29.0.tar.gz
Size 341.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6f0d6f6cc5447f31329333cc357fbf2ba7e4ca0de9694f738925640e536b02fe
BLAKE2b-256 checksum
How to use checksums
c0b5503b0cfdf84bf4831a358aec6fa9066c0019d377cbab50459283b29e2533
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release files / gh_toolkit-0.29.0-py3-none-any.whl

Download URL gh_toolkit-0.29.0-py3-none-any.whl
Size 174.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
005cb3ad271151a41e7604c2db6959146fee39ca89b144cb4439d77ee90d64e6
BLAKE2b-256 checksum
How to use checksums
481a1448741c297c0e066a1d45dd3fb66bfed0751c12e55d7c2cdf2e7311c685
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Security for gh-toolkit 0.29.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.29.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page