{"id":47687175,"url":"https://github.com/pleaseai/local-hub","last_synced_at":"2026-04-02T14:55:08.619Z","repository":{"id":347243068,"uuid":"1193301596","full_name":"pleaseai/local-hub","owner":"pleaseai","description":"Local GitHub API cache proxy — reduce latency and save rate limits","archived":false,"fork":false,"pushed_at":"2026-03-27T09:46:08.000Z","size":15616,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-27T17:04:54.683Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pleaseai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-27T04:35:50.000Z","updated_at":"2026-03-27T09:46:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pleaseai/local-hub","commit_stats":null,"previous_names":["pleaseai/local-hub"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pleaseai/local-hub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleaseai%2Flocal-hub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleaseai%2Flocal-hub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleaseai%2Flocal-hub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleaseai%2Flocal-hub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pleaseai","download_url":"https://codeload.github.com/pleaseai/local-hub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleaseai%2Flocal-hub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31308448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-02T14:55:08.007Z","updated_at":"2026-04-02T14:55:08.614Z","avatar_url":"https://github.com/pleaseai.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# local-hub\n\nLocal GitHub API cache proxy — reduce latency and save rate limits.\n\n## What it does\n\n`local-hub` sits between your GitHub CLI (or any GitHub API client) and the GitHub API, transparently caching responses to deliver:\n\n- **Near-zero latency** for repeated requests (served from local cache)\n- **Rate limit savings** via ETag-based conditional requests (304 responses don't count against limits)\n- **Offline access** to previously fetched data\n\n```\ngh CLI ──(Unix socket)──→ local-hub ──(HTTPS)──→ GitHub API\nfetch  ──(HTTP :8787)───→  (cache)\n```\n\n## Features\n\n- **Dual listen** — Unix socket for `gh` CLI + TCP port for `fetch`/`octokit`\n- **ETag + TTL caching** — conditional requests for freshness, TTL for speed\n- **Token-hash isolation** — each token gets its own cache namespace (no privilege leaks)\n- **All GET requests cached** — issues, PRs, repos, orgs, projects, and more\n- **Write passthrough** — POST/PUT/PATCH/DELETE go straight to GitHub with related cache invalidation\n- **Tiny footprint** — ~3-5MB memory, \u003c2ms cold start (Rust native binary)\n- **Zero config** — sensible defaults, just start and go\n\n## Installation\n\n### Homebrew (macOS / Linux)\n\n```bash\nbrew install pleaseai/tap/local-hub\n```\n\n### npm\n\n```bash\nnpm install -g local-hub\n```\n\n### Cargo\n\n```bash\ncargo install --git https://github.com/pleaseai/local-hub\n```\n\n### Binary\n\nDownload platform-specific binaries from [Releases](https://github.com/pleaseai/local-hub/releases).\n\n## Quick start\n\n```bash\n# Start the proxy\nlocal-hub start\n\n# Configure gh CLI to use it\ngh config set http_unix_socket ~/.local-hub/local-hub.sock\n\n# Use gh as normal — requests are now cached\ngh issue list\n\n# Show cache statistics\nlocal-hub status\n\n# Flush cache entries\nlocal-hub flush\n\n# For fetch/octokit clients, use HTTP endpoint\n# baseUrl: http://localhost:8787\n```\n\n## How it works\n\n### Caching strategy\n\n1. **GET request arrives** → compute cache key from `SHA256(token)[:16] + method + URL + query`\n2. **Cache hit + not expired** → return cached response instantly\n3. **Cache hit + expired** → send conditional request with `If-None-Match: \u003cetag\u003e`\n4. **304 Not Modified** → refresh TTL, return cached response (no rate limit cost)\n5. **Cache miss or 200** → store response + ETag + TTL, return to client\n\n### Cache invalidation\n\n- **TTL-based** — configurable per-endpoint pattern (default: 5 minutes)\n- **Write-triggered** — mutations automatically invalidate related cache entries\n- **Manual** — `local-hub flush [pattern]` to clear specific entries\n\n### Authentication\n\nTokens are **never stored**. Only a truncated SHA-256 hash is used as a cache namespace prefix, ensuring:\n\n- Each token's cached data is isolated\n- Token rotation automatically creates a fresh namespace\n- No risk of serving cached data across different permission levels\n\n## Development\n\nRequires [mise](https://mise.jdx.dev) for toolchain management.\n\n```bash\nmise install              # Install rust + lefthook\nmise run dev              # Build local-hub + start web dev server\nmise run hub              # Build and start local-hub only\nmise run web              # Start web dev server only\nmise run build            # Build local-hub (release)\nmise run stop             # Stop local-hub\n```\n\n## Configuration\n\n```bash\n# Custom port\nlocal-hub start --port 9000\n\n# Custom cache directory\nlocal-hub start --cache-dir ~/.my-cache\n\n# Custom default TTL (seconds)\nlocal-hub start --ttl 600\n\n# Show cache stats\nlocal-hub status\n```\n\n## Architecture\n\n```\ncrates/\n└── server/\n    └── src/\n        ├── main.rs       # CLI entry point (start, status, flush)\n        ├── server.rs     # axum HTTP proxy (TCP + Unix socket)\n        ├── proxy.rs      # Request forwarding to GitHub API\n        ├── cache.rs      # redb cache layer (get, set, invalidate)\n        ├── key.rs        # Cache key generation (token hash + URL normalization)\n        ├── ttl.rs        # Per-endpoint TTL rules\n        ├── error.rs      # Typed error definitions\n        └── lib.rs        # Library root (re-exports)\n```\n\n### Tech stack\n\n- **Language**: [Rust](https://www.rust-lang.org) — minimal memory, instant startup\n- **HTTP**: [axum](https://github.com/tokio-rs/axum) + [hyper](https://hyper.rs) — async HTTP server\n- **Cache**: [redb](https://github.com/cberner/redb) — embedded key-value store (single file, ACID)\n- **Tooling**: [mise](https://mise.jdx.dev) — version management\n\n## Roadmap\n\n- [x] **Phase 1**: Local proxy with TTL + ETag caching\n- [ ] **Phase 2**: Webhook-based cache invalidation (via relay-worker)\n- [ ] **Phase 3**: Team shared cache (L2 layer)\n- [ ] **Phase 4**: Web client dashboard (via better-hub) — in progress (`apps/web`)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpleaseai%2Flocal-hub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpleaseai%2Flocal-hub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpleaseai%2Flocal-hub/lists"}