@hasna/repos
v0.1.9
Published
Local repo intelligence platform for AI agents — track all repos, search commits, PRs, branches across your machine. CLI + MCP + Web dashboard.
Maintainers
Readme
@hasna/repos
Local repo intelligence platform for AI agents. Track all repos on your machine, search commits, PRs, branches across every repository. CLI + MCP server + Web dashboard.
Install
bun install -g @hasna/reposQuick Start
# Scan all repos under ~/Workspace
repos scan
# List all tracked repos
repos repos
# Search across everything
repos search "authentication"
# Show stats
repos stats
# Start the dashboard
repos-serve # http://localhost:19450CLI Commands
| Command | Description |
|---------|-------------|
| repos scan | Discover and index all git repos |
| repos repos | List repositories |
| repos repo <name> | Get repo details |
| repos commits | List commits |
| repos branches | List branches |
| repos tags | List tags |
| repos prs | List pull requests |
| repos search <query> | Unified search across all entities |
| repos stats | Global statistics |
| repos activity | Recent commit activity |
| repos contributors | Top contributors |
| repos stale | Stale repos with no recent commits |
| repos heatmap | Commit activity heatmap |
| repos sync-github | Sync PRs from GitHub |
| repos gh-info <name> | Fetch GitHub metadata |
All commands support --json for machine-readable output.
MCP Server
repos-mcp19 tools available for AI agents:
list_repos,get_repo,search_reposlist_commits,search_commitslist_branches,list_tagslist_prs,search_prslist_remotessearch(unified)scan_reposget_stats,get_repo_statssync_github_prs,sync_all_github_prs,fetch_repo_metadataregister_agent,heartbeat,list_agents
REST API
repos-serve # Default port: 19450| Endpoint | Method | Description |
|----------|--------|-------------|
| /api/repos | GET | List repos |
| /api/repos/:id | GET | Get repo + stats |
| /api/search/repos | GET | Search repos |
| /api/commits | GET | List commits |
| /api/search/commits | GET | Search commits |
| /api/branches | GET | List branches |
| /api/tags | GET | List tags |
| /api/prs | GET | List PRs |
| /api/search | GET | Unified search |
| /api/stats | GET | Global stats |
| /api/scan | POST | Trigger scan |
SDK
import { scanRepos, searchAll, listRepos, getGlobalStats } from "@hasna/repos";
const result = scanRepos(["/home/user/code"]);
const repos = listRepos({ org: "myorg" });
const results = searchAll("authentication");HTTP mode
Run a shared Streamable HTTP MCP server (stateless, 127.0.0.1 only):
repos-mcp --http # default port 8830
MCP_HTTP=1 repos-mcp # via env
repos-mcp --http --port 8830- Health:
GET http://127.0.0.1:8830/health - MCP:
http://127.0.0.1:8830/mcp - Stdio remains the default when
--http/MCP_HTTP=1are not set. repos-servealso mounts/healthand/mcpon its HTTP port.
Data Storage
SQLite database at ~/.hasna/repos/repos.db with WAL mode and FTS5 full-text search.
License
Apache-2.0
