hrbcli

module
v0.0.0-...-6630550 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2025 License: Apache-2.0

README ΒΆ

Harbor CLI (hrbcli)

A powerful command-line interface for Harbor container registry, written in Go.

Go Report Card License

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

Configure Harbor Connection
# 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:

  1. Configuration file (~/.hrbcli.yaml)
  2. Environment variables (HARBOR_URL, HARBOR_USERNAME, HARBOR_PASSWORD)
  3. 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

Directories ΒΆ

Path Synopsis
cmd
hrbcli command
internal
pkg
api

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL