MCPcopy Create free account
hub / github.com/mergestat/mergestat-lite

github.com/mergestat/mergestat-lite @v0.6.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.6.2 ↗ · + Follow
520 symbols 1,473 edges 138 files 99 documented · 19% 44 cross-repo links updated 6d agov0.6.2 · 2024-03-13★ 3,51928 open issues

Browse by type

Functions 388 Types & classes 132
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Go Reference BuildStatus Go Report Card TODOs codecov Twitter Follow

mergestat-lite MergeStat Logo

mergestat-lite is a command-line tool for running SQL queries on git repositories and related data sources. It's meant for ad-hoc querying of source-code on disk through a common interface (SQL), as an alternative to patching together various shell commands. It can execute queries that look like:

-- how many commits have been authored by user@email.com?
SELECT count(*) FROM commits WHERE author_email = 'user@email.com'

It installs a binary named mergestat.

More in-depth examples and documentation can be found on our dedicated documentation site.

Join our community on Slack if you have questions, or just to say hi 🎉.

Installation

See the full instructions in our documentation.

Homebrew

brew tap mergestat/mergestat
brew install mergestat

Docker

docker run -v "${PWD}:/repo" mergestat/mergestat "select count(*) from commits"

Examples

SQL queries can be executed in the CLI on local or remote git repositories. Remote repos are cloned to a temporary directory at runtime.

CLI SQL Screenshot

The --format flag can be used to output json, ndjson, csv and more (see mergestat -h). This can be useful for piping/using with other tools.

Higher level commands such as mergestat summarize commits generate reports without requiring a SQL input. Learn more here about the available flags such as --start to change the date range and --json to output as JSON.

CLI Summarize Commits Screenshot

Learn more in our docs

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 196
Method 192
Struct 126
TypeAlias 3
FuncType 2
Interface 1

Languages

Go100%

Modules by API surface

extensions/options/options.go18 symbols
cmd/summarize/commits/commits.go16 symbols
cmd/summarize/blame/blame.go16 symbols
extensions/internal/git/refs.go15 symbols
extensions/internal/git/log.go15 symbols
extensions/internal/sourcegraph/sourcegraph_search.go13 symbols
extensions/internal/golang/go_mod_to_json.go12 symbols
extensions/internal/github/repo_commits.go10 symbols
pkg/locator/locator.go9 symbols
extensions/internal/github/starred_repos.go9 symbols
extensions/internal/github/stargazers.go9 symbols
extensions/internal/github/repo_issues.go9 symbols

Dependencies from manifests, versioned

dario.cat/mergov1.0.0 · 1×
github.com/ProtonMail/go-cryptov1.0.0 · 1×
github.com/PullRequestInc/go-gpt3v1.2.0 · 1×
github.com/asaskevich/govalidatorv0.0.0-2023030114320 · 1×
github.com/augmentable-dev/vtabv0.0.0-2022100515113 · 1×
github.com/aymanbagabas/go-osc52/v2v2.0.1 · 1×

For agents

$ claude mcp add mergestat-lite \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page