Haggis is a command-line tool built with Go, designed to search GitHub repositories using GraphQL. It simplifies the task of searching for specific files like CODEOWNERS
across GitHub organizations and repositories, helping platform engineers streamline their searches.
- Clone the repository:
git clone https://github.com/your-repo/haggis.git
cd haggis
- Build the binary:
go build -o haggis
- Run via Docker (optional):
docker build -t haggis .
haggis [command] [flags]
codeowners
: Searches for the.github/CODEOWNERS
file in the specified GitHub organization and repository.
--org, -o
(required): GitHub organization to search.--repo, -r
(optional): Specific GitHub repository to search. If omitted, all repositories in the organization will be searched.--branch, -b
(optional): Specific branch to search. If not specified, the default branch is used.
- Search all repositories in an organization for the
CODEOWNERS
file:
haggis codeowners --org your-github-org
- Search a specific repository for the
CODEOWNERS
file on a specific branch:
haggis codeowners --org your-github-org --repo your-repo --branch main
- Run via Docker:
docker run --rm -it -e GITHUB_TOKEN=your_github_token --entrypoint haggis haggis codeowners --org your-github-org
- Ensure the
GITHUB_TOKEN
environment variable is set with a valid GitHub Personal Access Token (PAT) for authenticated requests. - HAGGIS supports auto-completion scripts for enhanced CLI experience using the
completion
sub-command.