-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from bishal7679/patch-1
enhancement: Improve README.md
- Loading branch information
Showing
1 changed file
with
133 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,152 @@ | ||
# harbor-cli | ||
LFX mentorship program project original author https://github.com/akshatdalton | ||
|
||
https://github.com/cncf/mentoring/tree/main/programs/lfx-mentorship/2023/01-Mar-May#an-official-golang-api-client-and-cli-for-harbor | ||
https://mentorship.lfx.linuxfoundation.org/project/7e8cb88a-5b37-471c-8db8-e11907b5a661 | ||
![harbor-3](https://github.com/goharbor/harbor-cli/assets/70086051/835ab686-1cce-4ac7-bc57-05a35c2b73cc) | ||
|
||
#Under Contstruction! | ||
# How to Install: | ||
**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.** | ||
|
||
- Run `go mod download` to install the dependencies | ||
- Run `go build -o harbor` to generate the build file | ||
# Project Scope π§ͺ | ||
|
||
# How to Use: | ||
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. | ||
|
||
If you have completed the above steps, now you are all set to use this project. | ||
<br> | ||
<br> | ||
`./harbor --help` or do `./harbor help`: | ||
```shell | ||
# Project Features π€― | ||
|
||
πΉ Get details about projects, registries, repositories and more <br> | ||
πΉ Create new projects, registries, and other resources <br> | ||
πΉ Delete projects, registries, and other resources <br> | ||
πΉ Run commands with various flags for enhanced functionality <br> | ||
πΉ More features coming soon... π§ | ||
|
||
# Example Commandsπ‘ | ||
|
||
```bash | ||
β 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 | ||
create create project, registry, etc. | ||
delete delete project, registry, etc. | ||
get get project, registry, etc. | ||
help Help about any command | ||
list list project, registry, etc. | ||
login Log in to Harbor registry | ||
update update registry, etc. | ||
project Manage projects and assign resources to them | ||
registry Manage registries | ||
repo Manage repositories | ||
user Manage users | ||
version Version of Harbor CLI | ||
|
||
Flags: | ||
-h, --help help for harbor | ||
--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 | ||
|
||
```bash | ||
harbor login demo.goharbor.io -u admin -p Harbor12345 | ||
``` | ||
|
||
#### Create a New Project | ||
|
||
```bash | ||
harbor project create | ||
``` | ||
|
||
#### List all Projects | ||
|
||
```bash | ||
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 | ||
|
||
```bash | ||
harbor repo list | ||
|
||
# output | ||
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | ||
β Name Artifacts Pulls Last Modified Time β | ||
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β | ||
β library/harbor-cli 1 0 0 minute ago β | ||
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | ||
``` | ||
|
||
# Supported Platforms | ||
|
||
Platform | Status | ||
--|-- | ||
Linux | β | ||
macOS | β | ||
Windows | β | ||
|
||
# Installation | ||
|
||
## Build From Source | ||
|
||
```bash | ||
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 | ||
|
||
```bash | ||
## 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 | ||
|
||
```bash | ||
winget install harbor | ||
``` | ||
|
||
# Community | ||
|
||
* **Twitter:** [@project_harbor](https://twitter.com/project_harbor) | ||
* **User Group:** Join Harbor user email group: [harbor-users@lists.cncf.io](https://lists.cncf.io/g/harbor-users) to get update of Harbor's news, features, releases, or to provide suggestion and feedback. | ||
* **Developer Group:** Join Harbor developer group: [harbor-dev@lists.cncf.io](https://lists.cncf.io/g/harbor-dev) for discussion on Harbor development and contribution. | ||
* **Slack:** Join Harbor's community for discussion and ask questions: [Cloud Native Computing Foundation](https://slack.cncf.io/), channel: [#harbor](https://cloud-native.slack.com/messages/harbor/), [#harbor-dev](https://cloud-native.slack.com/messages/harbor-dev/) and [#harbor-cli](https://cloud-native.slack.com/messages/harbor-cli/). | ||
|
||
# License | ||
|
||
This project is licensed under the Apache 2.0 License. See the [LICENSE](https://github.com/goharbor/harbor-cli/blob/main/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](https://github.com/goharbor/harbor-cli/issues) page.<br> | ||
Give a β if this project helped you, Thank YOU! |