
Welcome to the Harbor CLI project! This powerful command-line tool facilitates seamless interaction with the Harbor container registry. It simplifies various tasks such as creating, updating, and managing projects, registries, and other resources in Harbor.
Project Scope π§ͺ
The Harbor CLI is designed to enhance your interaction with the Harbor container registry. Built on Golang, it offers a user-friendly interface to perform various tasks related to projects, registries, and more. Whether you're creating, updating, or managing resources, the Harbor CLI streamlines your workflow efficiently.
Project Features π€―
πΉ Get details about projects, registries, repositories and more
πΉ Create new projects, registries, and other resources
πΉ Delete projects, registries, and other resources
πΉ Run commands with various flags for enhanced functionality
πΉ More features coming soon... π§
Example Commandsπ‘
β harbor --help
Official Harbor CLI
Usage:
harbor [command]
Examples:
// Base command:
harbor
// Display help about the command:
harbor help
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
login Log in to Harbor registry
project Manage projects and assign resources to them
registry Manage registries
repo Manage repositories
user Manage users
version Version of Harbor CLI
Flags:
--config string config file (default is $HOME/.harbor/config.yaml) (default "/home/bishal/.harbor/config.yaml")
-h, --help help for harbor
-o, --output-format string Output format. One of: json|yaml
-v, --verbose verbose output
Use "harbor [command] --help" for more information about a command.
Log in to Harbor Registry
harbor login demo.goharbor.io -u admin -p Harbor12345
Create a New Project
harbor project create
List all Projects
harbor project list
# output
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Project Name Access Level Type Repo Count Creation Time β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β library public project 0 1 hour ago β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
List all Repository in a Project
harbor repo list
# output
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Name Artifacts Pulls Last Modified Time β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β library/harbor-cli 1 0 0 minute ago β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Platform |
Status |
| Linux |
β
|
| macOS |
β
|
| Windows |
β
|
Installation
Build From Source
git clone https://github.com/goharbor/harbor-cli.git
cd harbor-cli/cmd/harbor
go build .
sudo mv harbor /usr/local/bin/
Linux and MacOS
use amd64/arm64 as per your system architecture
## Linux
tar -xzf harbor_0.0.1_linux_amd64.tar.gz
cd harbor_0.0.1_linux_amd64
sudo mv harbor /usr/local/bin/
## MacOS
tar -xzf harbor_0.0.1_darwin_amd64.tar.gz
cd harbor_0.0.1_darwin_amd64
sudo mv harbor /usr/local/bin/
Windows
winget install harbor
License
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Acknowledgements
This project is maintained by the Harbor community. We thank all our contributors and users for their support.
β€οΈ Show your support
For any questions or issues, please open an issue on our GitHub Issues page.
Give a β if this project helped you, Thank YOU!