Skip to main content

A CLI tool using gh to rapidly locate and inspect files in remote GitHub repositories without cloning.

Project description

gh-inspector

A CLI tool using gh to rapidly locate and inspect files in remote GitHub repositories without cloning.

Prerequisites

  • GitHub CLI (gh): Install from cli.github.com
  • Python 3.10+: Required for running the tool
  • uv (optional): For faster dependency management

Installation

  1. Clone the repository:

    git clone https://github.com/acabelloj/gh-inspector.git
    cd gh-inspector
    
  2. Install dependencies:

    Using uv (recommended):

    # Create a virtual environment
    uv venv -p 3.14 --prompt gh-inspector
    
     # Activate the virtual environment
    source .venv/bin/activate
    
    # Sync dependencies
    uv sync
    

    Or using pip:

    # Create a virtual environment
    python -m venv .venv
    source .venv/bin/activate
    
    # Install the package
    pip install -e .
    
  3. Authenticate with GitHub CLI (if not already done):

    gh auth login
    

Shell Completion (Optional)

Enable tab completion for commands and options:

For Bash:

gh-inspector --install-completion bash
# Or with uv:
uv run gh-inspector --install-completion bash

For Zsh:

gh-inspector --install-completion zsh
# Or with uv:
uv run gh-inspector --install-completion zsh

For Fish:

gh-inspector --install-completion fish
# Or with uv:
uv run gh-inspector --install-completion fish

After installation, restart your shell or run:

source ~/.bashrc  # For Bash
source ~/.zshrc   # For Zsh

Now you can use tab completion:

gh-inspector <TAB>              # Shows available commands
gh-inspector find-python-library <TAB>  # Shows options

Usage

Running Commands

**Run directly:

gh-inspector find-python-library <org-name> <library1> [library2]...

Find Python Library Versions

Analyze library usage across repositories in a GitHub organization.

Examples:

# Find Django and requests versions in the 'python' org
gh-inspector find-python-library python django requests

# Find pydantic versions, including all repos (not just Python ones)
gh-inspector find-python-library myorg pydantic --all-repositories

# Show only repository names (no version details)
gh-inspector find-python-library myorg fastapi --format only_repo

# Check dev dependencies
gh-inspector find-python-library myorg pytest --source dev

Options:

  • --format / -f: Output format (default or only_repo)
  • --source / -s: Source files to check (default, dev, or all)
  • --all-repositories / -a: Check all repos regardless of primary language

Supported dependency files:

  • requirements.txt

Development

Install with dev dependencies:

uv sync --extra dev

Run linting and formatting:

uv run ruff check --fix .
uv run ruff format .

Set up pre-commit hooks:

uv run pre-commit install

License

MIT License - see LICENSE file for details.

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

gh_inspector-0.0.0.tar.gz (45.0 kB view details)

Uploaded Source

Built Distribution

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

gh_inspector-0.0.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file gh_inspector-0.0.0.tar.gz.

File metadata

  • Download URL: gh_inspector-0.0.0.tar.gz
  • Upload date:
  • Size: 45.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.11

File hashes

Hashes for gh_inspector-0.0.0.tar.gz
Algorithm Hash digest
SHA256 347ac3cdbfd8abb618bfdf5e683bcfe2ed99702a1129032e1a0679c2d2ad278e
MD5 0fcf320443643d75d209c23533f913dc
BLAKE2b-256 40425217eccac8e477a09a69b7fb4ea07d821f294d2d4750fff4331527f067ad

See more details on using hashes here.

File details

Details for the file gh_inspector-0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gh_inspector-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 125c68d847ff348ed595a352dabf4568787f6cac188a1365739198f94dbb4709
MD5 a1206cd826074f01d2f30fb363291069
BLAKE2b-256 7fed4be344fc4c64824a1047738afb32f882028109d9b8a39ae7aa3b66afc341

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