Skip to content

InstaWP CLI Overview

The InstaWP CLI brings your entire WordPress workflow into the terminal. Create sites, run WP-CLI on them, SSH in, sync files and databases, spin up local sandboxes, and tear everything down again — without opening the dashboard.

It is published to npm as @instawp/cli under the MIT license, and every command can emit JSON, which makes it equally usable by humans, CI pipelines, and AI coding agents.

Why a CLI

The dashboard is great for one-off work. A CLI is what you need when the work repeats:

  • Scriptable. Provision a preview site for every pull request, then delete it when the PR merges.
  • No manual SSH keys. The CLI generates, uploads, and caches the key for you the first time you run instawp ssh or instawp wp.
  • Local and cloud in one tool. Build locally with WordPress Playground (no Docker, no MySQL), then push the same site to InstaWP hosting.
  • Agent-friendly. AI assistants such as Claude Code, Cursor, and Codex can drive it, because every step is a shell command with parseable output.

Requirements

  • Node.js 18 or higher
  • An InstaWP account (an API token if you are running in CI)

Install

bash
npm install -g @instawp/cli@beta

Check that it is working:

bash
instawp --version

To update later:

bash
instawp upgrade

The CLI checks for a new version once a day and prints a hint when one is available. Set INSTAWP_NO_UPDATE_NOTIFIER=1 to silence that check.

Log in

bash
instawp login

This opens your browser, completes the handshake, and stores the session locally. Confirm who you are signed in as:

bash
instawp whoami

Logging in without a browser

On a server, in a container, or in CI there is no browser to open. Use a token instead — either pass it to login or export it as an environment variable:

bash
instawp login --token <your-api-token>
bash
export INSTAWP_TOKEN=<your-api-token>

Create the token in the InstaWP dashboard under API Tokens. See API Overview for details.

Two-minute quickstart

bash
npm install -g @instawp/cli@beta
instawp login
instawp create --name my-site --php 8.3

The site is provisioned on InstaWP infrastructure and is live in seconds. From there:

bash
instawp sites creds my-site            # WP admin username, password, magic login URL
instawp open my-site --magic           # open an auto-logged-in admin session
instawp wp my-site plugin list         # run WP-CLI against it
instawp sites delete my-site           # remove it when you are done

What you can do

AreaCommandsWhat it covers
Authlogin, whoamiBrowser or token-based authentication
Sitescreate, sites list, sites creds, sites php, sites delete, openProvision and manage hosted sites
Versionsversions create, versions list, versions restore, versions deleteRestorable point-in-time copies
Remote accesswp, ssh, exec, sql, logs, cache purge, plugin installWork directly on a hosted site
Syncsync push/pull, db push/pullMove files and databases between local and cloud
Locallocal create, local clone, local start/stop, local push/pullWordPress Playground sandboxes on your machine
Migrationmigrate pushMirror an existing local WordPress install to a new hosted site
Teamsteams list, teams switch, teams membersSwitch the team commands run against

Every command is documented in the Command Reference.

JSON output

Add --json to any command to get machine-readable output instead of the formatted terminal view:

bash
instawp create --name my-site --php 8.4 --json

This is what makes the CLI usable from scripts, CI jobs, and AI agents. See CI/CD and AI Agents.

Where to go next

Docs are open — edit on GitHub. Built with VitePress.