MCPcopy
hub / github.com/mergestat/mergestat-lite

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

repository ↗ · DeepWiki ↗ · release v0.6.2 ↗
520 symbols 1,473 edges 138 files 99 documented · 19%
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

RepoLocator (Interface)
RepoLocator is a service that the virtual modules rely upon to create or open an existing git repository. [2 implementers]
extensions/services/locator.go
OptionFn (FuncType)
OptionFn represents any function capable of customising or providing options
extensions/options/options.go
RepoLocatorFn (FuncType)
RepoLocatorFn is an adapter type that adapts any function with compatible signature to a RepoLocator instance.
extensions/options/options.go

Core symbols most depended-on inside this repo

RowContent
called by 46
extensions/internal/tools/tools.go
t1f0
called by 35
extensions/internal/github/utils.go
handleExitError
called by 31
cmd/root.go
Close
called by 30
extensions/internal/git/log.go
Open
called by 27
extensions/services/locator.go
Next
called by 13
extensions/internal/git/log.go
WriteTo
called by 10
pkg/display/display.go
repoOwnerAndName
called by 10
extensions/internal/github/utils.go

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/Microsoft/go-winiov0.6.1 · 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×
github.com/charmbracelet/bubblesv0.18.0 · 1×

For agents

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

⬇ download graph artifact