Skip to main content

ghir

Search your GitHub repos, cloned or not, across every organization you belong to. Fetch once, then search offline; each hit says where it is cloned on this machine, if anywhere.

pip install ghir
ghir refresh                                   # you + your orgs, through the gh CLI
ghir search "flashcards spaced repetition"     # offline, ranked by ir
 0.032  thorwhalen/tetrachord  /home/me/proj/tt/tetrachord
        Music education with a learner model and scheduler at the architectural centre.
 0.015  thorwhalen/rbxloop  (not cloned)

Requires the GitHub CLI (gh auth login) for refresh only; searching never touches the network.

The four seams

ghir is corpus -> extraction -> ranking, with a cache beside it. Each is one keyword argument with a working default.

Seam Argument Default Alternatives
Locations: which repos refresh(locations) "@me": you and every org you belong to owner logins, "search:<github search query>"
Extraction: what text a repo contributes extract= "description_and_readme" (name, description, topics, README head) "description", or any record -> str callable
Ranking rank= "ir": hybrid dense + BM25 through ir, indexed incrementally "grep" (query terms as word prefixes, no index, no model), or any callable
Cache store= one JSON file per repo under ~/.local/share/ghir/repos/ any MutableMapping (a dol store: S3, a database)

refresh merges: fetched repos overwrite their own entries, and cached repos it did not see this time are kept. A location that fails to fetch is reported in "failed" and its cached repos stay.

import ghir

ghir.refresh(["i2mint", "search:user:thorwhalen topic:education"])
for hit in ghir.search("audio tagging", rank="grep", include_forks=False):
    print(hit.id, hit.local_path or hit.url)

Settings

Machine-specific choices go in ~/.config/ghir/config.json (or $GHIR_CONFIG):

{"locations": ["@me", "otosense"],
 "exclude": ["SomeClientOrg/*", "myorg/private-thing"]}

An owner excluded with owner/* is never queried. local_exclude takes patterns over local clone paths ("q/private-repo"); by default it is ir's own per-machine list, ~/.config/ir/exclude, so a repo ir must not index is not fetched, cached or shown through GitHub either. A refresh purges cached repos that have become excluded. Other keys: extract, local_roots (where clones are looked for; default $PP or your home), cache_dir, corpus_name.

Using it from ir

ghir refresh also registers the cache as the ir corpus gh_repos (a records corpus whose fetcher is ghir:records), so ir's own tools see it:

ir discover gh_repos "spaced repetition"
ir discover gh_repos packages "audio tagging"    # federated with the local packages corpus

Why this is a separate package and not part of ir: docs/adr/0001-where-ghir-lives.md.

Metadata

Release files for ghir 0.0.6

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

Source distribution (sdist)

Source distribution for ghir 0.0.6
File Size Uploaded Provenance Actions
ghir-0.0.6.tar.gz 20.4 kB Without provenance Details for ghir-0.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ghir 0.0.6
File Interpreter ABI Platform Actions
ghir-0.0.6-py3-none-any.whl Python 3 none any Details for ghir-0.0.6-py3-none-any.whl

Total release size: 40.7 kB

Release files / ghir-0.0.6.tar.gz

Download URL ghir-0.0.6.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0a877047fc906c32202422b9743285f749a596c3d133b3005308ac00214e3747
BLAKE2b-256 checksum
How to use checksums
7a5c33c4f9b4ef30bb6c5f84f9f6c90a21addf41cde621abf029eba3cb5b0aba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ghir-0.0.6-py3-none-any.whl

Download URL ghir-0.0.6-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f6406b5ded552a4c7bd0ab559353517c3c5d890fec31dcfd7e355476ee65ccb
BLAKE2b-256 checksum
How to use checksums
a66bf37206805d71f18ba924d2b814a7a63d17604b57c417434859e8f70310c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for ghir 0.0.6

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.

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