gh-codeowners
A GitHub CLI extension for GitHub's CODEOWNERS file.
The codeowners GitHub CLI extension identifies the owners for files in a local repository or directory. This extension uses the codeowners go module from hmarr.
Installation
gh extension install robandpdx/gh-codeownersUsage
By default, the command line tool will walk the directory tree, printing the code owners of any files that are found.
$ gh codeowners --help
usage: codeowners <path>...
-f, --file string CODEOWNERS file path
-h, --help show this help message
-o, --owner strings filter results by owner
-u, --unowned only show unowned files (can be combined with -o)
$ ls
CODEOWNERS DOCUMENTATION.md README.md example.go example_test.go
$ cat CODEOWNERS
*.go @example/go-engineers
*.md @example/docs-writers
README.md product-manager@example.com
$ gh codeowners
CODEOWNERS (unowned)
README.md product-manager@example.com
example_test.go @example/go-engineers
example.go @example/go-engineers
DOCUMENTATION.md @example/docs-writersTo limit the files the tool looks at, provide one or more paths as arguments.
$ gh codeowners *.md
README.md product-manager@example.com
DOCUMENTATION.md @example/docs-writersPass the --owner flag to filter results by a specific owner.
$ gh codeowners -o @example/go-engineers
example_test.go @example/go-engineers
example.go @example/go-engineersPass the --unowned flag to only show unowned files.
$ gh codeowners -u
CODEOWNERS (unowned)