Skip to content

Latest commit

 

History

73 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

repocli

中文

A CLI for Git repositories, for developers, scripts, and coding agents. repocli provides repository tools with context about source files, components, and languages. It reports changes, identifies repository contents, and lets you browse a code graph locally.

Installation

Requires Go 1.26+ and Git. Install from source:

git clone https://github.com/compforge/repocli.git
cd repocli
make install

Tagged releases provide macOS/Linux archives and checksums. Use repocli version or repocli --version to identify the installed binary; repocli version --json produces structured output. Both source and release builds embed the version from the repository’s VERSION file.

make install uses go install: the binary goes to GOBIN, or $(go env GOPATH)/bin when GOBIN is unset. Ensure that directory is on PATH. Use make build to build only, producing bin/repocli.

Usage

diff reports changed source files and symbols, potentially affected files, and component context. Declaration discovery follows CodeGraph language capabilities; dependency-aware test selection supports Go, Python, JavaScript, and TypeScript.

repocli diff --repo /path/to/repo --base main --test-dir tests --json

Omit --json for readable text. Repeat --test-dir for multiple directories; use --test-dir . for tests alongside source files. Without it, all supported source files become candidate roots, within the workset budget. --base defaults to HEAD and compares that commit with the working tree.

Test impact is best effort: known-target inferred edges participate in recommendations, with confidence and basis retained on explanation edges. Granularity is automatic; each affected file reports its seed, path confidence and dependency distance. Local extraction gaps remain observations; unknown targets do not create edges. An empty test list does not prove that no tests are affected. Callers decide how to use the result. diff does not run project commands. See diff usage for patch input, output fields, and analysis limits.

view opens a local web server for the working tree's code graph:

repocli view
repocli view --repo /path/to/repo --addr 127.0.0.1:5484

Open the printed URL to explore documents, search symbols, filter relationships by kind and confidence, and inspect captured source and diagnostics. Use Refresh snapshot after edits. Cytoscape.js and all page assets are embedded; no Node.js, CDN, or database is needed at runtime. See graph viewer for scope and limits.

snapshot identifies repository contents without running change or impact analysis:

repocli snapshot --json
repocli snapshot --staged --json
repocli snapshot --head HEAD --json

Its output includes repository identity, component roots, languages, and package-tool evidence from the selected contents. These are shared with diff and view; see repository context. Its digest uses the same rules as diff; check complete before comparing it. See snapshot usage for scope and limitations.

Analysis commands and invalid invocations automatically log invocations, stdout/stderr, errors and exit status to ~/.repocli/logs/YYYY-MM-DD.log, keeping today and the previous 29 days. Each recorded run has a run_id; output destinations stay unchanged. Successful help/version commands do not initialize or write log files. Diff analyses also append comparison inputs, test lists, and stage timings to diff-YYYY-MM-DD.jsonl in the same directory. See execution logs.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages