# CLI Overview

The Status200 CLI, `status200`, manages your Status200 project from a terminal or a script. List, read, create, change, delete and count monitors, incidents, alerts, status pages and the other records the Status200 API offers, with an API key of your project.

:::cards
- [How the CLI works](#how-the-cli-works): One command, one API request, one answer.
- [Install the CLI](#install-the-cli): One npm command, and the version to pick.
- [Run your first commands](#run-your-first-commands): Save your API key, then list your incidents.
- [Commands at a glance](#commands-at-a-glance): Every command, and the page that explains it.
:::

## How the CLI works

Each command sends one request to the Status200 REST API and prints the answer. The CLI takes the API key and your Status200's address from flags, environment variables or a context that `status200 login` saved. The key decides what a command may read and change, exactly as it does for the API.

```mermaid title="One command, one request"
flowchart TB
    T["Your terminal<br/>or a CI job"] -->|"status200 incident list"| C["status200 CLI"]
    K["The API key and URL:<br/>flags, environment<br/>or a saved context"] --> C
    C -->|"POST /api/incident/get-list"| A["Status200 REST API"]
    A -->|"the records the key<br/>may read, as JSON"| C
    C -->|"a table in a terminal,<br/>JSON in a pipe"| T
```

The commands for records come with the CLI: each kind of record the Status200 API opens to tools has one, the same records the [MCP server](/docs/ai/mcp-server) has tools for. Run `status200 resources` to list them.

## Before you begin

- **Node.js and npm**, a current LTS release, to install the CLI.
- **An API key of your project.** Create one in **Project Settings → Advanced → API Keys** with **Create API Key**: see [Create an API key](/docs/api-reference/api-reference#create-an-api-key).
- **On Status200 Cloud, the Growth plan or above.** A project's API keys work only on it: see [API keys and SCIM below their plan](/docs/api-reference/api-reference#api-keys-and-scim-below-their-plan).

## Install the CLI

Install the `@status200/cli` package from npm. It adds the `status200` command, and `--version` prints the version you installed:

```bash
npm install -g @status200/cli
status200 --version
```

The CLI is released with Status200 and has the same version number. On a self-hosted Status200, install the CLI of your Status200's version, so its commands match the records your server has:

```bash
npm install -g @status200/cli@<your-oneuptime-version>
```

## Run your first commands

:::steps
### Save your API key

Log in with the key and your Status200's address. The CLI saves them as a context named `default` and uses it from now on:

```bash
status200 login <your-api-key> https://status200.ru
```

It answers `Logged in successfully. Context "default" is now active.` On a self-hosted Status200, use its address in place of `https://status200.ru`.

### List your incidents

```bash
status200 incident list
```

The ten newest incidents appear as a table. `login` saves the key without checking it, so this is the first command that shows the key works: if it is refused, see [Troubleshooting](/docs/cli/authentication#troubleshooting).

### See what else you can manage

```bash
status200 resources
```

The list shows every kind of record you can work with, and its command, such as `monitor`, `status-page` or `on-call-policy`.
:::

## Commands at a glance

| Command | What it does | Read more |
| --- | --- | --- |
| `status200 login <api-key> <instance-url>` | Saves an API key and an address as a context | [Authentication](/docs/cli/authentication#log-in) |
| `status200 context list`, `use`, `current`, `delete` | Lists, switches, shows and deletes saved contexts | [Authentication](/docs/cli/authentication#contexts) |
| `status200 whoami` | Shows the URL and API key the next command will use | [Authentication](/docs/cli/authentication#check-what-the-cli-will-use) |
| `status200 deploy` | Records a deploy, or another change, for charts and Status200 AI | [Deploys and Changes](/docs/telemetry/change-events) |
| `status200 <resource> list`, `get`, `create`, `update`, `delete`, `count` | Works with one kind of record | [Resource Operations](/docs/cli/resource-operations) |
| `status200 resources` | Lists the kinds of record, with their commands | [Command Reference](/docs/cli/command-reference#status200-resources) |
| `status200 version` | Prints the CLI's version | [Command Reference](/docs/cli/command-reference#status200-version) |
| `status200 help [command]` | Shows the help of a command | [Get help](#get-help) |

## Global options

These options work with every command, before or after it:

| Option | What it does |
| --- | --- |
| `--api-key <key>` | The API key for this command, in place of the saved one |
| `--url <url>` | Your Status200's address for this command |
| `--context <name>` | A saved context for this command, in place of the current one |
| `-o, --output <format>` | `table`, `json` or `wide`: see [Output Formats](/docs/cli/output-formats) |
| `--no-color` | Prints without colors |
| `-V, --version` | Prints the CLI's version |
| `-h, --help` | Shows the help of the command |

## Get help

Every command has its own help, with its arguments, options and defaults:

```bash
status200 --help
status200 help incident
status200 incident list --help
```

## Next steps

:::cards
- [Authentication](/docs/cli/authentication): Contexts for each environment, and which key a command uses.
- [Resource Operations](/docs/cli/resource-operations): List, read, create, change, delete and count records.
- [Output Formats](/docs/cli/output-formats): Tables for people, JSON for scripts.
- [Scripting & CI/CD](/docs/cli/scripting): Exit codes, jq and pipelines.
- [Command Reference](/docs/cli/command-reference): Every command, option and default.
:::
