# Command-line reference

Canonical HTML: [Command-line reference](https://getred.dev/docs/reference/cli). Website source: `b212874eefaf200143affa21c770fbb8855a4f5c`. Documented Red release: v0.9.1. Installer source: `b86a2ca4b92e9547d3b174910c82db8a259f5171`.

Look up Red's editor, validation, runtime asset, Agent, session, plugin, language, and keyboard commands.

<a id="open-the-editor"></a>

## Open the editor

| Command                      | Purpose                                          |
| ---------------------------- | ------------------------------------------------ |
| `red [FILES...]`             | Open zero or more files                          |
| `red .` or `red PATH/TO/DIR` | Browse a directory in a read-only editor buffer  |
| `red -r PATH [FILES...]`     | Set the workspace root before opening files      |
| `red -c TOML [FILES...]`     | Apply a repeatable inline configuration override |
| `red --version`              | Print the installed version                      |
| `red --help`                 | Print the generated command reference            |

<a id="check-the-installation-and-configuration"></a>

## Check the installation and configuration

| Command                      | Purpose                                                                   |
| ---------------------------- | ------------------------------------------------------------------------- |
| `red --self-check`           | Validate the bundled runtime and plugins                                  |
| `red update --check`         | Check for a newer stable release without replacing the executable         |
| `red update`                 | Install the latest stable release for an official standalone installation |
| `red --check-config`         | Validate the effective user configuration                                 |
| `red --agent-check`          | Report Codex prerequisites without installing anything                    |
| `red --agent-check --strict` | Exit nonzero when Agent editing isn't ready                               |
| `red keys`                   | Show the keyboard protocol and decoded key events                         |

<a id="inspect-and-eject-runtime-assets"></a>

## Inspect and eject runtime assets

| Command                   | Purpose                                                         |
| ------------------------- | --------------------------------------------------------------- |
| `red --runtime-files`     | List visible plugins and themes with their sources              |
| `red --eject ASSET`       | Copy a bundled plugin or theme into the configuration directory |
| `red --eject-force ASSET` | Replace an existing user copy                                   |

<a id="manage-sessions"></a>

## Manage sessions

| Command                          | Purpose                                           |
| -------------------------------- | ------------------------------------------------- |
| `red --detach[=NAME] [FILES...]` | Start a detachable owner and attach this terminal |
| `red --attach NAME`              | Attach to a local live session                    |
| `red --stop NAME`                | Stop a local live session                         |
| `red --resume`                   | Restore the latest crash-recovery snapshot        |

<a id="manage-packages-and-languages"></a>

## Manage packages and languages

```shell
red plugin catalog
red plugin install [OWNER/REPOSITORY]
red plugin install --path DIRECTORY
red plugin install --catalog ID
red plugin list
red plugin update ID
red plugin update --all
red plugin disable ID
red plugin enable ID
red plugin remove ID [--purge]

red language trust LANGUAGE_OR_PATH
red language untrust LANGUAGE_OR_PATH
red language check-indent FIXTURES.json
```
