Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions cli-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Step 1: Clone the required repositories
HARBOR_CLI_REPO="https://github.com/goharbor/harbor-cli.git"

# Step 2: Fetch the latest tag from the repository
LATEST_TAG=$(
git ls-remote --tags --sort='v:refname' "$HARBOR_CLI_REPO" |
tail -n1 |
awk -F/ '{print $3}'
)

# # Step 3: Clone the repository at the latest tag
git clone --depth 1 --branch "$LATEST_TAG" "$HARBOR_CLI_REPO" harbor-cli

# Step 4: Copy the CLI documentation to the website directory
HARBOR_CLI_DOCS="harbor-cli/doc/"
WEBSITE_CLI_DOCS="content/cli-docs"
rsync -av --delete --prune-empty-dirs \
--exclude '*.go' \
--exclude 'man-docs' \
--exclude 'README.md' \
"$HARBOR_CLI_DOCS" \
"$WEBSITE_CLI_DOCS"

# Step 5: Clean up the cloned repository
rm -rf harbor-cli
13 changes: 13 additions & 0 deletions content/cli-docs/cli-docs/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Harbor CLI Commands
weight: 25
---

This section describes the comprehensive set of commands provided by the Harbor CLI, which enables you to efficiently manage and interact with your Harbor registry. The Harbor CLI commands are categorized by function,

- `harbor` - Configure the Harbor CLI and set global flags to customize your experience.
- `harbor artifact` - Manage artifacts in Harbor Repository
- `harbor project` - Manage projects and assign resources to them
- `harbor registry` - Manage registries in Harbor
- `harbor repo` - Manage repositories in Harbor context
- `harbor user` - Administer users in Harbor, including creating, updating, and managing user accounts
32 changes: 32 additions & 0 deletions content/cli-docs/cli-docs/harbor-artifact-delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: harbor artifact delete
weight: 35
---
## harbor artifact delete

### Description

##### delete an artifact

```sh
harbor artifact delete [flags]
```

### Options

```sh
-h, --help help for delete
```

### Options inherited from parent commands

```sh
-c, --config string config file (default is $HOME/.config/harbor-cli/config.yaml)
-o, --output-format string Output format. One of: json|yaml
-v, --verbose verbose output
```

### SEE ALSO

* [harbor artifact](harbor-artifact.md) - Manage artifacts

42 changes: 42 additions & 0 deletions content/cli-docs/cli-docs/harbor-artifact-info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: harbor artifact info
weight: 25
---
## harbor artifact info

### Description

##### Get info of an artifact

### Synopsis

Get info of an artifact

```sh
harbor artifact info [flags]
```

### Examples

```sh
harbor artifact info <project>/<repository>/<reference>
```

### Options

```sh
-h, --help help for info
```

### Options inherited from parent commands

```sh
--config string config file (default is $HOME/.harbor/config.yaml) (default "/home/user/.harbor/config.yaml")
-o, --output-format string Output format. One of: json|yaml
-v, --verbose verbose output
```

### SEE ALSO

* [harbor artifact](harbor-artifact.md) - Manage artifacts

48 changes: 48 additions & 0 deletions content/cli-docs/cli-docs/harbor-artifact-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: harbor artifact list
weight: 20
---
## harbor artifact list

### Description

##### List container artifacts (images, charts, etc.) in a Harbor repository with metadata

### Synopsis

List all artifacts (e.g., container images, charts) within a given Harbor repository.
Supports optional project/repository input in the form <project>/<repository>.
Displays key artifact metadata including tags, digest, type, size, vulnerability count, and push time.

Examples:
harbor-cli artifact list # Interactive prompt for project and repository
harbor-cli artifact list library/nginx # Directly list artifacts in the nginx repo under 'library' project

Supports pagination, search queries, and sorting using flags.

```sh
harbor artifact list [flags]
```

### Options

```sh
-h, --help help for list
-p, --page int Page number (default 1)
-n, --page-size int Size of per page (default 10)
-q, --query string Query string to query resources
-s, --sort string Sort the resource list in ascending or descending order
```

### Options inherited from parent commands

```sh
-c, --config string config file (default is $HOME/.config/harbor-cli/config.yaml)
-o, --output-format string Output format. One of: json|yaml
-v, --verbose verbose output
```

### SEE ALSO

* [harbor artifact](harbor-artifact.md) - Manage artifacts

42 changes: 42 additions & 0 deletions content/cli-docs/cli-docs/harbor-artifact-scan-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: harbor artifact scan start
weight: 80
---
## harbor artifact scan start

### Description

##### Start a scan of an artifact

### Synopsis

Start a scan of an artifact in Harbor Repository

```sh
harbor artifact scan start [flags]
```

### Examples

```sh
harbor artifact scan start <project>/<repository>/<reference>
```

### Options

```sh
-h, --help help for start
```

### Options inherited from parent commands

```sh
-c, --config string config file (default is $HOME/.config/harbor-cli/config.yaml)
-o, --output-format string Output format. One of: json|yaml
-v, --verbose verbose output
```

### SEE ALSO

* [harbor artifact scan](harbor-artifact-scan.md) - Scan an artifact

42 changes: 42 additions & 0 deletions content/cli-docs/cli-docs/harbor-artifact-scan-stop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: harbor artifact scan stop
weight: 10
---
## harbor artifact scan stop

### Description

##### Stop a scan of an artifact

### Synopsis

Stop a scan of an artifact in Harbor Repository

```sh
harbor artifact scan stop [flags]
```

### Examples

```sh
harbor artifact scan stop <project>/<repository>/<reference>
```

### Options

```sh
-h, --help help for stop
```

### Options inherited from parent commands

```sh
-c, --config string config file (default is $HOME/.config/harbor-cli/config.yaml)
-o, --output-format string Output format. One of: json|yaml
-v, --verbose verbose output
```

### SEE ALSO

* [harbor artifact scan](harbor-artifact-scan.md) - Scan an artifact

40 changes: 40 additions & 0 deletions content/cli-docs/cli-docs/harbor-artifact-scan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: harbor artifact scan
weight: 60
---
## harbor artifact scan

### Description

##### Scan an artifact

### Synopsis

Scan an artifact in Harbor Repository

### Examples

```sh
harbor artifact scan start <project>/<repository>/<reference>
```

### Options

```sh
-h, --help help for scan
```

### Options inherited from parent commands

```sh
-c, --config string config file (default is $HOME/.config/harbor-cli/config.yaml)
-o, --output-format string Output format. One of: json|yaml
-v, --verbose verbose output
```

### SEE ALSO

* [harbor artifact](harbor-artifact.md) - Manage artifacts
* [harbor artifact scan start](harbor-artifact-scan-start.md) - Start a scan of an artifact
* [harbor artifact scan stop](harbor-artifact-scan-stop.md) - Stop a scan of an artifact

38 changes: 38 additions & 0 deletions content/cli-docs/cli-docs/harbor-artifact-tags-create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: harbor artifact tags create
weight: 65
---
## harbor artifact tags create

### Description

##### Create a tag of an artifact

```sh
harbor artifact tags create [flags]
```

### Examples

```sh
harbor artifact tags create <project>/<repository>/<reference> <tag>
```

### Options

```sh
-h, --help help for create
```

### Options inherited from parent commands

```sh
-c, --config string config file (default is $HOME/.config/harbor-cli/config.yaml)
-o, --output-format string Output format. One of: json|yaml
-v, --verbose verbose output
```

### SEE ALSO

* [harbor artifact tags](harbor-artifact-tags.md) - Manage tags of an artifact

38 changes: 38 additions & 0 deletions content/cli-docs/cli-docs/harbor-artifact-tags-delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: harbor artifact tags delete
weight: 80
---
## harbor artifact tags delete

### Description

##### Delete a tag of an artifact

```sh
harbor artifact tags delete [flags]
```

### Examples

```sh
harbor artifact tags delete <project>/<repository>/<reference> <tag>
```

### Options

```sh
-h, --help help for delete
```

### Options inherited from parent commands

```sh
-c, --config string config file (default is $HOME/.config/harbor-cli/config.yaml)
-o, --output-format string Output format. One of: json|yaml
-v, --verbose verbose output
```

### SEE ALSO

* [harbor artifact tags](harbor-artifact-tags.md) - Manage tags of an artifact

Loading