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.4

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.4
File Size Uploaded Provenance Actions
ghir-0.0.4.tar.gz 18.1 kB Without provenance Details for ghir-0.0.4.tar.gz

Built distribution (wheel)

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

Total release size: 35.7 kB

Release files / ghir-0.0.4.tar.gz

Download URL ghir-0.0.4.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c304b3d0a39ccdf9b7425474c4896acee1316a08dae0be39ce0b36ea34991a20
BLAKE2b-256 checksum
How to use checksums
387190018d6a3eea4715464633009e5e836bc1dfb784caedd5e8f127ebaf7418
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.4-py3-none-any.whl

Download URL ghir-0.0.4-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78f298f21f3b6ab79639f1e85c275966b1e71bee409f487d4de813ad9c0fe0bc
BLAKE2b-256 checksum
How to use checksums
b8d577b6647bd490461efcde6818a9c8a6c6b9c00add5fd786b403d2ce16377a
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.4

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