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.1.tar.gz (11.7 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.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gh_inspector-0.0.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.2 cpython/3.14.0 HTTPX/0.28.1

File hashes

Hashes for gh_inspector-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9b3b3ccd77cda81cef85331f4dac6f24b763dc9575949a8c6d540de794e47bc8
MD5 b87e1d990ba39ebd058ce1b83ced9796
BLAKE2b-256 0bd644e2ba56a1cfa7c7a477312535d31ff8bcab3714d0ccdd14570c33f10b74

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gh_inspector-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.2 cpython/3.14.0 HTTPX/0.28.1

File hashes

Hashes for gh_inspector-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1f57441447d678c2ab56f0a8527a4dd0920089796ec58187f0d98ef9b88865ca
MD5 4d97fdc41e82a7bb439b78f98fc87e08
BLAKE2b-256 b745843e151b9ef411742c48452ba6dffa4652bab2df12efce5278fe9e881790

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