Harbor CLI (hrbcli)
A powerful command-line interface for Harbor container registry, written in Go.

Features
- π Full Harbor API Coverage - Manage projects, repositories, users, replications, and more
- π§ Multiple Output Formats - Table, JSON, and YAML output support
- π Secure Authentication - Support for basic auth and credential storage
- π¦ Multi-Architecture - Binaries for Linux, macOS, and Windows (amd64/arm64)
- π¨ Interactive Mode - Prompts for missing required information
- π Comprehensive Documentation - Built-in help for all commands
- π Shell Completions - Bash, Zsh, and Fish shell completions
- π Distribution Management - Manage preheat providers and policies
- π System Configuration - View and update Harbor system settings
- π Registry Endpoint Management - Configure external registries for replication or proxy cache
- π Job Service Monitoring - Inspect worker pools and queue lengths
Installation
Using Homebrew (macOS/Linux)
brew tap pascal71/hrbcli
brew install hrbcli
Using Go
go install github.com/pascal71/hrbcli/cmd/hrbcli@latest
Download Binary
Download the latest release from the releases page.
Build from Source
git clone https://github.com/pascal71/hrbcli.git
cd hrbcli
make build
Quick Start
# Interactive configuration
hrbcli config init
# Or set directly
hrbcli config set harbor_url https://harbor.example.com
hrbcli config set username admin
Basic Commands
# List all projects
hrbcli project list
# Create a new project
hrbcli project create myproject --public
# List repositories in a project
hrbcli repo list myproject
# Get repository details
hrbcli repo get myproject/myapp
# List tags for a repository
hrbcli repo tags myproject/myapp
# Delete a repository
hrbcli repo delete myproject/myapp:v1.0.0
# Get system information
hrbcli system info
# Show Harbor statistics
hrbcli system statistics
# Show job service dashboard
hrbcli jobservice dashboard
Scanner Commands
hrbcli scanner scan <project>
hrbcli scanner running <project>
hrbcli scanner reports <project> --summary
hrbcli scanner reports <project> --sort repo
hrbcli scanner reports <project> --sort crit
Distribution Commands
hrbcli distribution providers <project>
hrbcli distribution policies <project>
See docs/COMMANDS.md for more details.
Configuration
Harbor CLI can be configured through:
- Configuration file (
~/.hrbcli.yaml)
- Environment variables (
HARBOR_URL, HARBOR_USERNAME, HARBOR_PASSWORD)
- Command-line flags
Configuration File Example
harbor_url: https://harbor.example.com
username: admin
output_format: table
insecure: false
Environment Variables
export HARBOR_URL=https://harbor.example.com
export HARBOR_USERNAME=admin
export HARBOR_PASSWORD=secretpassword
HARBOR_PASSWORD can hold either your Harbor account password or a robot account token. Set it as an environment variable to avoid storing credentials in your configuration file.
Documentation
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Acknowledgments
- Harbor - The cloud native registry
- Cobra - CLI framework
- Viper - Configuration management