$ show openclaw/gitcrawl
gitcrawl is a Go-based CLI and library for ingesting GitHub repository data (issues, PRs, comments, reviews, code files, workflow runs) into a local SQLite database, then searching and analyzing that data offline. It exposes commands like `gitcrawl sync owner/repo`, `gitcrawl search issues`, and `gitcrawl code index`, with optional full-text code search. The architecture is a layered CLI: a command layer, a GitHub GraphQL/REST client with rate-limit guarding, a sqlc-generated SQLite data-access layer, and a small TUI built on bubbletea/lipgloss. It also includes a separate metrics store with strict database-ownership validation and idempotent writes.
The LLM identified 5 files worth highlighting for reuse:
GitHub API client that fetches issues, PRs, comments, reviews, and code history via GraphQL/REST. Includes rate-limit guarding and safe error evidence, making it extractable for any GitHub automation tool.
Source-of-truth SQL query definitions with typed sqlc-generated Go structs. Demonstrates a clean repository pattern with idempotent upserts and explicit :one/:many/:execrows variants, adaptable to other SQLite-backed services.
Platform-specific implementations for signal handling, file locking, process management, and portable rename. Isolates OS differences behind a small interface, making it a reusable cross-platform utility layer.
SQLite-backed metrics store that refuses to open databases not created by the tool, using owner/version markers and schema checks, and rejects symlinks/hardlinks/whitespace paths. Enforces idempotent writes with ON CONFLICT DO NOTHING and hashed IDs, a strong pattern for safe local metric storage.
Full SQL schema definition with manual user_version-based migration tracking. Although versioning is manual, the schema is centralized and includes ownership validation, making it a useful reference for SQLite-backed applications that need controlled evolution.