Olares/docs/developer/install/cli/upgrade.md
Meow33 8133704761
docs: add CLI docs for user, upgrade, and disk commands (#2383)
* docs: add CLI docs for user, upgrade, and disk commands

* docs: update based on comments

* docs: fix typo

* docs: refine formatting and add description for argument

* docs: resolve conflicts
2026-01-13 17:30:57 +08:00

53 lines
No EOL
1.6 KiB
Markdown

# `upgrade`
## Synopsis
The `upgrade` command provides a set of tools for upgrading Olares and checking upgrade readiness and compatibility.
```bash
olares-cli upgrade <subcommand> [options]
```
## Subcommands
| Subcommand | Aliases | Description |
|--|--|--|
| `precheck` | | Prechecks Olares for upgrade. |
| `spec` | `current-spec` | Gets the upgrade spec of the current CLI version. |
| `viable` | | Determines whether upgrade can be directly performed upon a base version. |
## Global options
These options apply to the main `upgrade` command and are inherited by its subcommands where applicable.
| Option | Shorthand | Usage | Required | Default |
|--|--|--|--|--|
| `--base-dir` | `-b` | Sets the base directory for Olares packages. | No | `$HOME/.olares` |
| `--help` | `-h` | Displays help information. | No | N/A |
| `--version` | `-v` | Sets the target Olares version to upgrade to. For example, `1.10.0`, `1.10.0-20241109`. | No | N/A |
## Options for `viable`
| Option | Shorthand | Usage | Required | Default |
|--|--|--|--|--|
| `--base` | `-b` | Base version to check. | No | Current Olares system version |
:::warning Option conflict
The `-b` shorthand is used by the parent command for `--base-dir`. However, when running `upgrade viable`, `-b` specifically refers to `--base`.
:::
## Examples
```bash
# Check whether the current system can be upgraded directly
olares-cli upgrade viable
# Check upgrade viability from a specific base version
olares-cli upgrade viable --base 1.9.0
# Run pre-upgrade checks
olares-cli upgrade precheck
# View the upgrade spec of the current CLI
olares-cli upgrade spec
```