Repocheck is a CLI tool that provides an overview of local git repos in a directory. See valuable info at a quick glance about your repos such as author of last commit, last modified date, whether it is synced with remote and more
Usage:
repocheck [path] [flags]
Flags:
-A, --author string Filter by author of last commit
-h, --help help for repocheck
-j, --json Output as json
-L, --lastmodified string Filter by last modified date of repo
options: yyyy-mm-dd | ">yyyy-mm-dd" | ">=yyyy-mm-dd"
note: surround any filters containing < or > with quotes
--no-fetch Run without doing a git fetch for each repo
-r, --reverse Sort the results in descending order
-s, --sort string Sort results
options: author | lastmodified | name | path | synced (default "lastmodified")
-S, --synced string Filter by synced status of repo
options: y | n
-t, --tsv Output as tab separated values
For more detailed usage instructions see Usage
Pre-built packages for Windows, macOS, and Linux are found on the Releases page.
brew tap bevane/tap
brew install repocheck
Requires go v1.22 or later
go install github.com/bevane/repocheck@latest
Installing pre-built packages and brew package will install completions automatically.
For other cases including go install, if you want shell completions, you need to manually install it.
Manual Instructions:
- Clone this repo
git clone https://github.com/bevane/repocheck - Run
./scripts/completions.shto generate shell fragments for bash, zsh & fish in/completions - Copy the shell fragment for your shell into the appropriate directory for your shell.
- Example:
mv completions/repocheck.bash /usr/share/bash-completion/completions/repocheck
- Example:
Command help
repocheck -h or repocheck --help
Running repocheck without any args will list the repos in current directory
repocheck
Target directory can be passed in as an arg either as a relative path or an absolute path
repocheck projects
repocheck /home/user/projects
By default, repocheck will run a git fetch for each repo before determining its sync status to ensure that the information is up to date.
Repocheck can be run without doing git fetch for each repo with the --no-fetch flag:
repocheck --no-fetch
Sort flag -s or --sort can be used to sort the results by a specific key
repocheck --sort name to sort by repo name
repocheck -s synced to sort by sync status of the repo - unsynced repos will be at the top
Generally the results will be sorted in ascending order. Use -r or --reverse to sort in descending order
repocheck --sort name --reverse to sort by repo name in reverse (descending) order
repocheck -s synced -r to sort by sync status of the repo with unsynced repos at the bottom
Supported filter flags:
-Lor--lastmodified- filter results by repos that were last modified on, before or after a certain date-Sor--synced- filter results by synced status of repo-Aor--author- filter results by name of author of last commit for each repo
Examples
repocheck --synced y to only show repos that are synced
repocheck --author "Foo Bar" to only show repos where the author of the last commit is named Foo Bar
repocheck --lastmodified 2024-01-01 to only show repos that were last modified on 2024-01-01
repocheck --lastmodified ">=2024-01-01" to only show repos that were last modified on or later than 2024-01-01
Multiple filters can be combined:
repocheck -L "<2024-01-01" -S n to only show unsynced repos that were last modified before 2024-01-01
Note: for options containing '<' or '>' surround the entire query with quotes to prevent them from being interpreted as operators by bash
By default, repocheck will output the results in a pretty human-readable table. Repocheck also supports output flags to change the output format
Supported output flags:
-tor--tsv- to output results as tab separated values-jor--json- to output results as JSON
Examples
Machine-readable output can be piped to other command line utilities:
repocheck --tsv | cut -f2 to show only the second column of the results i.e the path data for each repo
repocheck --tsv | grep exercises to only show lines containing "exercises"
Submit an issue
Contributions are welcome. Please fork the repo and open pull requests to contribute. Ensure that your code passes the tests and include tests for any changes where applicable.
Repocheck is released under the MIT License