> ## Documentation Index
> Fetch the complete documentation index at: https://planetscale.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# PlanetScale CLI commands: maintenance

## Getting Started

Make sure to first [set up your PlanetScale developer environment](/docs/cli/planetscale-environment-setup.md). Once you've installed the `pscale` CLI, you can interact with PlanetScale and manage your databases straight from the command line.

## The `maintenance` command

List and show [maintenance schedules](/docs/plans/managed/maintenance-schedules.md) for a Vitess database on an Enterprise plan.

Maintenance schedules define when PlanetScale can perform planned maintenance (for example Vitess or MySQL version updates). This command is read-only. **`--org` is required.**

**Usage:**

```bash theme={null}
pscale maintenance <SUB-COMMAND> <FLAG>
```

### Available sub-commands

| **Sub-command** | **Sub-command flags** | **Description** | **Product** |
| :- | :- | :- | :- |
| `list <DATABASE_NAME>` | | List maintenance schedules for a database | Vitess |
| `show <DATABASE_NAME> <SCHEDULE_ID>` | | Show a maintenance schedule | Vitess |
| `windows <DATABASE_NAME> <SCHEDULE_ID>` | | List maintenance windows for a schedule | Vitess |

### Available flags

| **Flag** | **Description** |
| :- | :- |
| `-h`, `--help` | View help for the `maintenance` command |
| `--org <ORGANIZATION_NAME>` | The organization for the current user (required) |

### Global flags

| **Command** | **Description** |
| :- | :- |
| `--api-token <TOKEN>` | The API token to use for authenticating against the PlanetScale API. |
| `--api-url <URL>` | The base URL for the PlanetScale API. Default is `https://api.planetscale.com/`. |
| `--config <CONFIG_FILE>` | Config file. Default is `$HOME/.config/planetscale/pscale.yml`. |
| `--debug` | Enable debug mode. |
| `-f`, `--format <FORMAT>` | Show output in a specific format. Possible values: `human` (default), `json`, `csv`. |
| `--no-color` | Disable color output. |
| `--service-token <TOKEN>` | The service token for authenticating. |
| `--service-token-id <TOKEN_ID>` | The service token ID for authenticating. |

## Examples

### List schedules

```bash theme={null}
pscale maintenance list <DATABASE_NAME> --org <ORGANIZATION_NAME>
```

### Show a schedule

```bash theme={null}
pscale maintenance show <DATABASE_NAME> <SCHEDULE_ID> --org <ORGANIZATION_NAME>
```

### List windows for a schedule

```bash theme={null}
pscale maintenance windows <DATABASE_NAME> <SCHEDULE_ID> --org <ORGANIZATION_NAME>
```

## Need help?

Get help from [the PlanetScale Support team](https://planetscale.com/contact?initial=support), or join our [Discord community](https://pscale.link/community) to see how others are using PlanetScale.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.