# WordPress Studio CLI
`wp-studio` is the standalone, CLI-only version of [WordPress Studio](https://wordpress.studio/) – a fast, free, open source tool for local WordPress development powered by WordPress.com.
If you already have WordPress Studio installed, then the easiest way to use the CLI is to open WordPress Studio, go to Settings and ensure that the "WordPress Studio CLI for terminal" toggle is enabled.
The WordPress Studio CLI lets you:
- Create, run, and manage local WordPress sites from the terminal.
- Run WP-CLI commands.
- Import and export site backups.
- Pull from and push to WordPress.com sites.
- Publish ephemeral preview sites to share (requires WordPress.com login).
- Build WordPress sites in WordPress Studio Code with an interactive AI agent specialized in WordPress, backed by the full power of the WordPress Studio CLI.
- Integrate with other AI coding agents. Every site comes with an `AGENTS.md` file.
# Table of contents
- [Requirements](#requirements)
- [Installation](#installation)
- [Quick start](#quick-start)
- [Usage](#usage)
- [WordPress Studio Code](#wordpress-studio-code)
- [Import and export](#import-and-export)
- [Sync with WordPress.com and Pressable](#sync-with-wordpresscom-and-pressable)
- [Preview sites](#preview-sites)
## Requirements
`wp-studio` requires Node.js 22 or higher. You can download the appropriate version from the [Node.js website](https://nodejs.org/en/download).
## Installation
Run without installing:
```bash
npx wp-studio@latest --help
```
Install globally:
```bash
npm install -g wp-studio
studio --help
```
## Quick start
From anywhere on your system, run the following command to create a new WordPress site (with a step-by-step guide):
```bash
studio create
```
## Usage
The WordPress Studio CLI integrates with WordPress Studio and uses the same list of sites. Similarly to WordPress Studio, the WordPress Studio CLI also runs sites in the background. To see the list of sites under management by WordPress Studio and their current status, run the command:
```bash
studio list
studio list --format json
```
JSON output prints a fixed set of public fields (site identity, path, status, version, and URL). Fields outside that set, including admin passwords, are omitted. To read one site's admin password, run `studio config get admin-password --path ` and do not log the value.
To start and stop sites, run these commands:
```bash
studio start --path ~/Studio/my-site
studio stop --path ~/Studio/my-site
```
> These site commands used to live under a `site` group (e.g. `studio site list`). That group is still accepted as a hidden alias for backward compatibility, but the top-level commands above are preferred. Site settings now live under `studio config get` / `studio config set`.
Run WP-CLI commands in a site:
```bash
studio wp plugin list --path ~/Studio/my-site
studio wp option get home --path ~/Studio/my-site
```
## WordPress Studio Code
> 🧪 _WordPress Studio Code is currently in early access. Features, capabilities, and usage limits may change as it evolves._
WordPress Studio Code is an interactive AI agent specialized in building and optimizing WordPress sites. It integrates seamlessly with your WordPress Studio sites and can create themes, install plugins, edit code and content, and run WP-CLI commands autonomously from your terminal. It validates its own work through a built-in feedback loop that takes screenshots and confirms block syntax. You can use frontier models through the WordPress.com provider or bring your own API keys.
```bash
studio code
```
Delete, list or resume a previous session:
```bash
studio code sessions delete
studio code sessions list
studio code sessions resume
```
## Import and export
The WordPress Studio CLI allows you to import and export local backups.
When exporting, choose either a full-site backup as a `.zip` or `.tar.gz` file, or a database-only backup as a `.sql` file.
For imports, backup files from your WordPress.com site or from Jetpack’s Activity Log page are supported. So are `.wpress` files and `.zip` files from WordPress Playground or Local, and WordPress export (WXR) `.xml` files produced by **Tools → Export**. For more details, see the [documentation](https://wordpress.studio/docs/import-export/).
```bash
studio export --path ~/Studio/my-site
studio export --path ~/Studio/my-site --mode db
studio import ~/Backups/my-site-backup.zip --path ~/Studio/my-site
```
To host a site on a static host, export it as static HTML files with [Simply Static](https://wordpress.org/plugins/simply-static/). The plugin runs from the CLI bundle and is not installed in your site. Dynamic features such as comment and contact forms won't work in the static copy.
```bash
studio export-static ~/Sites/my-site-static --path ~/Studio/my-site
studio export-static ~/Sites/my-site-static --path ~/Studio/my-site --base-url https://example.com
```
## Sync with WordPress.com and Pressable
You can pull from and push to remote sites on both WordPress.com and Pressable. Both commands support selective sync, so you can decide which files to sync and whether to include the database.
```bash
studio pull --path ~/Studio/my-site
studio push --path ~/Studio/my-site
```
## Preview sites
The WordPress Studio CLI lets you share your work through preview sites. These are private WordPress.com sites shared through a preview link, and they allow you to share snapshots of your local sites with clients or team members.
To publish preview sites, you need to first authenticate with WordPress.com:
```bash
studio auth login
```
Publish a preview with this command:
```bash
studio preview create --path ~/Studio/my-site
```