A CLI tool using gh to rapidly locate and inspect files in remote GitHub repositories without cloning.
- GitHub CLI (
gh): Install from cli.github.com - Python 3.10+: Required for running the tool
- uv (optional): For faster dependency management
-
Clone the repository:
git clone https://github.com/acabelloj/gh-inspector.git cd gh-inspector -
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 .
-
Authenticate with GitHub CLI (if not already done):
gh auth login
Enable tab completion for commands and options:
For Bash:
gh-inspector --install-completion bash
# Or with uv:
uv run gh-inspector --install-completion bashFor Zsh:
gh-inspector --install-completion zsh
# Or with uv:
uv run gh-inspector --install-completion zshFor Fish:
gh-inspector --install-completion fish
# Or with uv:
uv run gh-inspector --install-completion fishAfter installation, restart your shell or run:
source ~/.bashrc # For Bash
source ~/.zshrc # For ZshNow you can use tab completion:
gh-inspector <TAB> # Shows available commands
gh-inspector find-python-library <TAB> # Shows options**Run directly:
gh-inspector find-python-library <org-name> <library1> [library2]...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 devOptions:
--format/-f: Output format (defaultoronly_repo)--source/-s: Source files to check (default,dev, orall)--all-repositories/-a: Check all repos regardless of primary language
Supported dependency files:
requirements.txt
Install with dev dependencies:
uv sync --extra devRun linting and formatting:
uv run ruff check --fix .
uv run ruff format .Set up pre-commit hooks:
uv run pre-commit installMIT License - see LICENSE file for details.