Thank you for your interest in contributing to the Harbor CLI project! We welcome contributions of all kinds, from bug fixes and documentation improvements to new features and suggestions.
The Harbor CLI is a powerful command-line tool to interact with the Harbor container registry. It's built in Go and helps users manage Harbor resources like projects, registries, artifacts, and more — directly from their terminal.
You can try the CLI immediately using Docker:
docker run -ti --rm -v $HOME/.harbor/config.yaml:/root/.harbor/config.yaml registry.goharbor.io/harbor-cli/harbor-cli --helpecho "alias harbor='docker run -ti --rm -v \$HOME/.harbor/config.yaml:/root/.harbor/config.yaml registry.goharbor.io/harbor-cli/harbor-cli'" >> ~/.zshrc
source ~/.zshrcMake sure Go is installed (≥ v1.24).
git clone https://github.com/goharbor/harbor-cli.git && cd harbor-cli
go build -o harbor-cli cmd/harbor/main.go
./harbor-cli --helpAlternatively, use Dagger for isolated builds:
dagger call build-dev --platform darwin/arm64 export --path=./harbor-cli
./harbor-dev --help..
├── cmd/harbor/ # Entry point (main.go) and all CLI commands (Cobra-based)
├── pkg/ # Shared utilities and internal packages used across commands
├── doc/ # Project documentation
├── test/ # CLI tests and test data
├── .github/ # GitHub workflows and issue templates
├── go.mod / go.sum # Go module dependencies
└── README.md # Project overview and usage
1. Fork and Clone
git clone https://github.com/your-username/harbor-cli.git
cd harbor-cligit checkout -b feat/<your-feature-name>Follow coding and formatting guidelines.
Ensure your changes work as expected.
gofmt -s -w .
dagger call build-dev --platform darwin/arm64 export --path=./harbor-cli #Recommended
./harbor-dev --helpIf dagger is not installed in your system, you can also build the project using the following commands:
gofmt -s -w .
go build -o ./bin/harbor-cli cmd/harbor/main.go
./bin/harbor-cli --helpBefore committing, always regenerate the documentation if you've made any code changes or added new commands:
dagger call run-doc export --path=./docgit commit -s -m "feat(project): add delete command for project resources"git push origin feat/<your-feature-name>Then, Open a Pull Request on GitHub
✅ Note: Add your CLI or unit tests to the
test/directory.
go test ./...- Use
go fmt ./...to format your code. - Use descriptive commit messages:
feat: New featurefix: Bug fixdocs: Documentation onlytest: Adding or updating testsrefactor: Code cleanupchore: Maintenance tasks
- Slack: Join us in #harbor-cli
- Issues: Use GitHub Issues for bugs, ideas, or questions.
- Mailing List:
- Users: harbor-users@lists.cncf.io
- Devs: harbor-dev@lists.cncf.io
All contributions are under the Apache 2.0 License.
Thank you for contributing to Harbor CLI! Your work helps improve the Harbor ecosystem for everyone. 🙌