Skip to content

chore: global update CLI reference docs #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion docs/.vitepress/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ const side = {
collapsed: true,
items: [
{ text: "gpu", link: "/developer/install/cli/gpu" },
{ text: "info", link: "/developer/install/cli/info" },
{ text: "osinfo", link: "/developer/install/cli/osinfo" },
{ text: "node", link: "/developer/install/cli/node" },
{
text: "olares backups",
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// docs/.vitepress/theme/index.ts
import DefaultTheme from "vitepress/theme";
import "./styles/custom.css";
import "./styles/index.css";
import { inBrowser, useRoute, useRouter, useData } from "vitepress";
import Layout from "./components/Layout.vue";
Expand Down
8 changes: 8 additions & 0 deletions docs/.vitepress/theme/styles/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* 只影响文档正文里的表格 */
.vp-doc table td:nth-child(2),
.vp-doc table th:nth-child(2) {
white-space: nowrap; /* 第二列不换行 */
}

/* 若想让整张表放宽布局,顺便改一下 ↓ */
/* .vp-doc table { table-layout: auto; } */
4 changes: 2 additions & 2 deletions docs/.vitepress/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ const side = {
collapsed: true,
items: [
{ text: "gpu", link: "/zh/developer/install/cli/gpu" },
{ text: "info", link: "/zh/developer/install/cli/info" },
{ text: "osinfo", link: "/zh/developer/install/cli/osinfo" },
{ text: "node", link: "/zh/developer/install/cli/node" },
{
text: "olares backups",
Expand Down Expand Up @@ -436,7 +436,7 @@ const side = {
},
{
text: "olares release",
link: "/zhdeveloper/install/cli/olares-release",
link: "/zh/developer/install/cli/olares-release",
},
{
text: "olares start",
Expand Down
2 changes: 1 addition & 1 deletion docs/developer/contribute/olares.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ make install VERSION=0.0.0-DEBUG
## How to uninstall

```bash
bash olares-uninstall.sh
bash olares-cli uninstall --all
```
66 changes: 33 additions & 33 deletions docs/developer/install/cli/backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,60 @@ outline: [2, 3]
---
# `olares backups backup`
:::warning
The `olares-cli olares backups download` command must be run first to install Restic. Otherwise, this command will return an error.
The `olares-cli backups download` command must be run first to install Restic. Otherwise, this command will return an error.
:::
## Synopsis
The `backup` subcommand allows you to back up data to the specified storage backend. It ensures your data is securely stored and can be restored whenever needed.

```bash
olares-cli olares backups backup <backend> --path <path> --repo-name <name> [options]
olares-cli backups backup <backend> --path <path> --repo-name <name> [options]
```

## Common options
These options apply to all backends:

| Name | Shorthand | Usage |
|---------------|-----------|----------------------------------------------|
| `--help` | `-h` | Displays help information. |
| `--path` | | Specifies the directory to back up. |
| `--repo-name` | | Specifies the name of the backup repository. |
| Option | Shorthand | Usage | Required | Default |
|---------------|-----------|----------------------------------------------|-------------------------|---------|
| `--help` | `-h` | Displays help information. | No | N/A |
| `--path` | | Specifies the directory to back up. | No | N/A |
| `--repo-name` | | Specifies the name of the backup repository. | No | N/A |

## Backend-specific options
### Options for `cos`

| Name | Shorthand | Usage |
|-----------------------|-----------|--------------------------------------------------------------------------------------------------|
| `--access-key` | | Specifies the Access Key for Tencent COS. |
| `--endpoint` | | Specifies the Tencent COS endpoint, e.g., `https://cos.{region}.myqcloud.com/{bucket}/{prefix}`. |
| `--limit-upload-rate` | | Limits the upload speed to a maximum rate in KiB/s (default: unlimited). |
| `--secret-access-key` | | Specifies the Secret Access Key for Tencent COS. |
| Option | Shorthand | Usage | Required | Default |
|-----------------------|-----------|--------------------------------------------------------------------------------------------------|-------------------------|------------|
| `--access-key` | | Specifies the Access Key for Tencent COS. | No | N/A |
| `--endpoint` | | Specifies the Tencent COS endpoint, e.g., `https://cos.{region}.myqcloud.com/{bucket}/{prefix}`. | No | N/A |
| `--limit-upload-rate` | | Limits the upload speed to a maximum rate in KiB/s. | No | unlimited |
| `--secret-access-key` | | Specifies the Secret Access Key for Tencent COS. | No | N/A | |

### Options for `fs`

| Name | Shorthand | Usage |
|--------------|-----------|----------------------------------------------------------------|
| `--endpoint` | | Specifies the local directory where the backup will be stored. |
| Option | Shorthand | Usage | Required | Default |
|------------|-----------|----------------------------------------------------------------|-------------------------|---------|
| `--endpoint` | | Specifies the local directory where the backup will be stored. | No | N/A |

### Options for `s3`

| Name | Shorthand | Usage |
|-----------------------|-----------|---------------------------------------------------------------------------------------------|
| `--access-key` | | Specifies the Access Key for Amazon S3. |
| `--endpoint` | | Specifies the Amazon S3 endpoint, e.g., `https://{bucket}.{region}.amazonaws.com/{prefix}`. |
| `--limit-upload-rate` | | Limits the upload speed to a maximum rate in KiB/s (default: unlimited). |
| `--secret-access-key` | | Specifies the Secret Access Key for Amazon S3. |
| Option | Shorthand | Usage | Required | Default |
|-----------------------|-----------|---------------------------------------------------------------------------------------------|-------------------------|------------|
| `--access-key` | | Specifies the Access Key for Amazon S3. | No | N/A |
| `--endpoint` | | Specifies the Amazon S3 endpoint, e.g., `https://{bucket}.{region}.amazonaws.com/{prefix}`. | No | N/A |
| `--limit-upload-rate` | | Limits the upload speed to a maximum rate in KiB/s. | No | unlimited |
| `--secret-access-key` | | Specifies the Secret Access Key for Amazon S3. | No | N/A | |

### Options for `space`

| Name | Shorthand | Usage |
|-------------------------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------|
| `--access-token` <sup>1</sup> | | Specifies the access token for Olares Space. |
| `--cloud-api-mirror` | | Specifies the cloud API mirror. |
| `--cloud-name` | | Specifies the cloud name of the Olares Space instance. <br/> The cloud name can be retrieved using the [`region`](region.md) subcommand. |
| `--cluster-id` <sup>2</sup> | | Specifies the cluster ID where the backup will be stored. |
| `--limit-upload-rate` | | Limits the upload speed to a maximum rate in KiB/s (default: unlimited). |
| `--olares-did` <sup>1</sup> | | Specifies the Olares DID. |
| `--region-id` | | Specifies the region ID of the Olares Space instance. <br/> The region ID can be retrieved using the [`region`](region.md) subcommand. |
| Option | Shorthand | Usage | Required | Default |
|-------------------------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|------------|
| `--access-token` <sup>1</sup> | | Specifies the access token for Olares Space. | No | N/A |
| `--cloud-api-mirror` | | Specifies the cloud API mirror. | No | N/A |
| `--cloud-name` | | Specifies the cloud name of the Olares Space instance. <br/> The cloud name can be retrieved using the [`region`](region.md) subcommand. | No | N/A |
| `--cluster-id` <sup>2</sup> | | Specifies the cluster ID where the backup will be stored. | No | N/A |
| `--limit-upload-rate` | | Limits the upload speed to a maximum rate in KiB/s. | No | unlimited |
| `--olares-did` <sup>1</sup> | | Specifies the Olares DID. | No | N/A |
| `--region-id` | | Specifies the region ID of the Olares Space instance. <br/> The region ID can be retrieved using the [`region`](region.md) subcommand. | No | N/A |

1. To retrieve the access token and Olares DID, inspect the payload of the network requests made by the Olares Space web interface after logging in. The `token` field corresponds to the access token, and the `userid` field corresponds to the Olares DID.

Expand All @@ -68,13 +68,13 @@ These options apply to all backends:
## Example
```bash
# Backup to Tencent COS
olares-cli olares backups backup cos --path /data --repo-name my_repo \
olares-cli backups backup cos --path /data --repo-name my_repo \
--access-key YOUR_KEY \
--secret-access-key YOUR_SECRET \
--endpoint https://cos.region.myqcloud.com/bucket/prefix

# Backup to Olares Space
olares-cli olares backups backup space --path /data --repo-name my_repo \
olares-cli backups backup space --path /data --repo-name my_repo \
--access-token YOUR_ACCESS_TOKEN \
--cloud-api-mirror https://api-mirror.example.com \
--cloud-name my_cloud \
Expand Down
15 changes: 7 additions & 8 deletions docs/developer/install/cli/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
The `download` subcommand downloads the Restic dependency tool. Restic is required for performing backup and restore operations, as well as managing snapshots.

```bash
olares-cli olares backups download [options]
olares-cli backups download [options]
```
## Options

| Name | Shorthand | Usage |
|----------------------|-----------|--------------------------------------------------------|
| `--download-cdn-url` | | Specifies the CDN URL for downloading the Restic tool. |
| `--help` | `-h` | Displays help information. |

| Option | Shorthand | Usage | Required | Default |
|--------------------|-----------|--------------------------------------------------------|-------------------------|--------------------|
| `--download-cdn-url`| | Specifies the CDN URL for downloading the Restic tool. | No | System default URL |
| `--help` | `-h` | Displays help information. | No | N/A |
## Example
```bash
```bash d
# Download Restic using a custom CDN URL
olares-cli olares backups download --download-cdn-url https://custom-cdn.example.com/restic
olares-cli backups download --download-cdn-url https://custom-cdn.example.com/restic
```
12 changes: 6 additions & 6 deletions docs/developer/install/cli/gpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ olares-cli gpu <subcommand> [options]

| Subcommand | Description |
|-------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| `install` | Installs GPU drivers and dependencies. Requires specifying the installation directory (`--base-dir`) and the Olares version (`--version`). |
| `install` | Installs GPU drivers and dependencies. |
| `enable` | Enables GPU functionality to support GPU-based applications. |
| `disable` | Disables GPU functionality, stopping support for GPU-based applications. |
| `uninstall` | Uninstalls GPU drivers and related components. |
Expand All @@ -26,11 +26,11 @@ olares-cli gpu <subcommand> [options]

## Options

| Name | Short | Description |
|--------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `--base-dir` | `-b` | Specifies the base installation directory for the GPU components. Typically, this is Olares' default installation directory `$HOME/.olares`. |
| `--version` | `-v` | Specifies the Olares version for GPU drivers and components. <br>Version values follow the format `x.y.z` (e.g., `1.10.0`) or include a build date (e.g., `1.10.0-20241109`).<br> Refer to the [GitHub Releases page](https://github.com/beclab/Olares/releases) for available versions. |
| `--help` | `-h` | Displays help information. |
| Option | Shorthand | Usage | Required | Default |
|------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|--------------------------------|
| `--base-dir`| `-b` | Specifies the base installation directory for the GPU components. | No | `$HOME/.olares` |
| `--version`| `-v` | Specifies the Olares version for GPU drivers and components. <br>Version values follow the format `x.y.z` (e.g., `1.10.0`) or include a build date (e.g., `1.10.0-20241109`).<br> Refer to the [GitHub Releases page](https://github.com/beclab/Olares/releases) for available versions. | No | Current version |
| `--help` | `-h` | Displays help information. | No | N/A |

## Example

Expand Down
Loading