# Command reference

URL: https://rustpress.witsberry.com/command-reference/

> Every rp command in one place: serve, update, import, export, themes, plugins, database, cache, cron, users, MCP and shared hosting setup.

This page lists every `rp` command, grouped by task. Every command takes `--root DIR`, the site folder; without it, `$RP_ROOT` or the current folder is used. `rp help` prints them all.

## Site

| Command                                                        | What it does                                                                    |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `rp serve [--listen ADDR] [--safe-mode]`                       | Run the site: front end, `/rp-admin/`, `/rp-login`, `/rp-json/`                 |
| `rp install --url … --title … --user … --password … --email …` | Install without the browser                                                     |
| `rp update [--check]`                                          | Install the latest signed release; running servers switch over without downtime |
| `rp version`                                                   | Show the installed version                                                      |
| `rp option get NAME` / `rp option set NAME VALUE`              | Read or change a setting                                                        |
| `rp export DIR`                                                | Write the public site as static HTML (needs pretty permalinks)                  |
| `rp demo DIR`                                                  | Build a throwaway demo site and export it                                       |
| `rp help`                                                      | List every command                                                              |

## Shared hosting

| Command                               | What it does                                                           |
| ------------------------------------- | ---------------------------------------------------------------------- |
| `rp cgi [--fcgi-listen ADDR]`         | Run under a web server as FastCGI or CGI (picked by itself)            |
| `rp cgi-setup --public DIR [--force]` | Write the start scripts and `.htaccess`, and print the cron job to add |

Steps are in [Hosting](/hosting/).

## Content

| Command                                                                                               | What it does                                                        |
| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `rp import FILE.xml [--author LOGIN] [--create-users] [--no-attachments] [--allow-local-attachments]` | Import a WordPress export file; attachments go to the Media Library |
| `rp export-content [FILE.xml] [--content post\|page\|all]`                                            | Write a WordPress export file                                       |
| `rp media regenerate`                                                                                 | Rebuild image sizes                                                 |

## Themes and plugins

| Command                                                          | What it does                                                |
| ---------------------------------------------------------------- | ----------------------------------------------------------- |
| `rp theme list`                                                  | List installed themes                                       |
| `rp theme activate SLUG`                                         | Activate a theme                                            |
| `rp theme build`                                                 | Compile the theme’s Tailwind CSS                            |
| `rp theme export SLUG`                                           | Export a theme as a zip                                     |
| `rp theme install FILE.zip [--replace] [--activate] [--convert]` | Install a theme; `--convert` converts a WordPress theme zip |
| `rp plugin list`                                                 | List installed plugins                                      |
| `rp plugin activate SLUG` / `deactivate SLUG`                    | Turn a plugin on or off (its requirements are checked)      |
| `rp plugin export SLUG`                                          | Export a plugin as a zip                                    |
| `rp plugin install FILE.zip [--replace] [--activate]`            | Install a plugin                                            |
| `rp plugin build DIR`                                            | Compile a Rust plugin to WebAssembly, in a sandbox          |
| `rp backup [FILE]`                                               | Save every theme and plugin in one zip                      |

## Database and cache

| Command                             | What it does                                                                                                                       |
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `rp db schema`                      | Show the database tables and who owns them                                                                                         |
| `rp db optimize [--revisions N]`    | Clean and compact the database (also runs weekly)                                                                                  |
| `rp db leftovers`                   | List data left by removed plugins                                                                                                  |
| `rp db plugin-data SLUG [--remove]` | Show a plugin’s data, or remove it                                                                                                 |
| `rp cache status`                   | Check the cache server (Redis, Valkey, Memcached)                                                                                  |
| `rp cache flush`                    | Clear every cache: pages on all servers, plugins’ cached data, templates and Cloudflare. Also **Clear cache** in the admin toolbar |

## Users and AI

| Command                                                   | What it does                                                                                      |
| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `rp user create LOGIN EMAIL PASSWORD [ROLE]`              | Create a user                                                                                     |
| `rp user app-password LOGIN NAME`                         | Create an application password for an API client or AI app                                        |
| `rp mcp --user ID [--abilities site,content,code,deploy]` | Serve the site’s AI tools as an MCP server over stdio (also over HTTP at `/rp-json/rp/v1/ai/mcp`) |

More on connecting AI apps: [MCP and AI tools](/mcp-and-ai-tools/).

## Maintenance

| Command                  | What it does                                                                                        |
| ------------------------ | --------------------------------------------------------------------------------------------------- |
| `rp cron list`           | Scheduled events and background job counts                                                          |
| `rp cron run`            | Run due scheduled tasks, background jobs, cleanup and the update check once (for a system cron job) |
| `rp cleanup [--dry-run]` | Clear stale AI workspace files, old rollback copies, trash and logs (also runs daily)               |

Settings and environment variables are in [Configuration](/configuration/).
