Studio CLI
Control WordPress Studio features from the terminal with Studio CLI—manage local sites, create/update/delete WordPress.com preview sites, and authenticate.
What is Studio CLI?
Studio CLI is a globally available command-line utility for interacting with WordPress Studio features from your terminal. It’s designed to work even when the Studio desktop app is closed, and it’s used to manage local Studio sites and preview environments hosted on WordPress.com.
The CLI can be installed with Studio (it comes bundled) or used as a standalone npm module called wp-studio. Its core purpose is to let you control Studio-related tasks—such as preview site creation, updating, and authentication—from scripts and build steps.
Key Features
- Global terminal command (
studio): Run Studio-related actions from anywhere without needing Studio to stay open. - Structured command syntax (
studio <area> <command> [options]): Apply predictable patterns for site and preview workflows. - Path targeting (
--path): Point commands at a specific Studio site directory instead of relying on the current working directory. - WordPress.com authentication management: Use
studio auth login,studio auth logout, andstudio auth statusto connect CLI actions to an authenticated WordPress.com account when required. - Preview site operations: Create, list, update, and delete temporary shareable preview sites on WordPress.com using commands like
studio preview create,studio preview list,studio preview update, andstudio preview delete. - Local site management commands: Manage local Studio sites (status, create, list, start, stop, delete, and configure) from the terminal using
studio site ...commands.
How to Use Studio CLI
-
Enable Studio CLI in the Studio app (recommended if you already use Studio):
- Open the “WordPress Studio” application.
- In the main menu, open the Settings modal (or click the gear icon).
- Enable “Studio CLI” and click Save.
- On macOS, you may be prompted for your account password to allow installation.
-
Open a terminal and verify availability:
- Use
studio --helpto view a high-level overview.
- Use
-
Authenticate for tasks that require WordPress.com access (e.g., preview sites):
- Run
studio auth login. - The command opens a browser-based flow; you’ll receive an authentication token to paste into the terminal.
- Confirm with
studio auth status.
- Run
-
Create and share a preview site from your local Studio site:
- From the root of your local Studio site, run:
cd /path/to/your/studio-site studio preview create - The CLI builds and uploads your local site to a preview environment and returns a preview URL to share.
- From the root of your local Studio site, run:
-
Update or delete previews using the preview host name:
- List previews with
studio preview listto obtain the host identifier. - Update:
studio preview update <host> - Delete:
studio preview delete <host>
- List previews with
-
Target a different site directory when needed:
- Add
--path /path/to/siteto commands instead of changing directories:studio preview create --path /path/to/your/studio-site
- Add
Use Cases
-
Manage local Studio sites without leaving the terminal: Use
studio site status,studio site start,studio site stop, andstudio site listto control local environments while working in a script-heavy workflow. -
Create preview environments to share with teammates or stakeholders: Run
studio preview createfrom your local Studio site root to produce a temporary shareable preview URL hosted on WordPress.com. -
Iterate on a preview as changes land: After initial preview creation, use
studio preview update <host>to rebuild and redeploy changes from the local site to the existing preview environment. -
Clean up preview environments: Use
studio preview delete <host>to permanently remove a preview site once it’s no longer needed. -
Automate Studio workflows in build steps: Use
studiocommands from scripts to integrate tasks such as preview creation/updating and site management into your development pipeline.
FAQ
Do I need the Studio desktop app open to use Studio CLI? No. Studio CLI is designed to interact with Studio features from your terminal regardless of whether Studio is open.
How do I point a command at a specific Studio site directory?
Most commands assume you’re running them from the root of a Studio-managed site. If you’re not, use the --path option (for example, studio preview create --path /path/to/site).
What happens if I run a preview command while logged out?
Commands that require authentication (such as studio preview create) will return an error and guide you to log in.
How do I find which preview host name to use for update/delete?
Run studio preview list to display associated previews and their host values. Use that host with studio preview update <host> or studio preview delete <host>.
Where does authentication information come from for studio auth login?
The login command starts a browser-based flow to connect the CLI to your WordPress.com account, then provides an authentication token you paste into the terminal to complete the process.
Alternatives
- Manual Studio UI workflow: If you don’t need terminal automation, using the Studio application directly can cover preview creation and local site control without CLI integration.
- Generic WordPress command-line tooling (e.g., WP-CLI + custom scripting): Where Studio-specific preview environments aren’t required, you can combine command-line WordPress tools with your own scripts to manage site tasks, though preview hosting and Studio-specific features may not be covered.
- Other local WordPress orchestration approaches: Instead of Studio’s site management commands, you can use different local WordPress setups (containerized or scripted) and handle previews via separate deployment steps, at the cost of losing the Studio CLI’s unified workflow for preview/update/delete and Studio-managed sites.
Alternatives
Struere
Struere is an AI-native operational system that replaces spreadsheet workflows with structured software—dashboards, alerts, and automations.
Falconer
Falconer is a self-updating knowledge platform for high-speed teams to write, share, and find reliable internal documentation and code context in one place.
OpenFlags
OpenFlags is an open source, self-hosted feature flag system with a control plane and typed SDKs for progressive delivery and safe rollouts.
GitBoard
GitBoard is a native macOS menu bar app for GitHub Projects to view your kanban board, filter by status, search issues, and create or assign.
Codex Plugins
Use Codex Plugins to bundle skills, app integrations, and MCP servers into reusable workflows—extending Codex access to tools like Gmail, Drive, and Slack.
garden-md
Turn meeting transcripts into a structured, linked company wiki with local markdown and an HTML browser view. Sync from supported sources.