Local CLI

Local 10.2+ includes a command line interface (CLI) tool called localwp. It lets people and agents control Local from the command line on Windows, macOS and Linux. It’s off by default — you must install it from Local preferences.

Terminal window on macOS showing Local CLI command 'localwp start --all' with output "Starting all sites".

Enable Local CLI in Local’s advanced preferences

Install Local CLI before you try to use it:

  1. Open Local preferences.
  2. Navigate to “Advanced”.
  3. Toggle “Install Local CLI” to “On”.
  4. Click the “Apply” button.
Local advanced preferences window showing "Install Local CLI" enabled.

Use the localwp CLI

Local needs to be running before localwp commands work in full. localwp will try to launch Local if it’s closed. In a freshly opened terminal window:

Type localwp or localwp help for a list of commands.

Type localwp [command] --help for help on that command.

Using localwp with AI and agents

Agents such as Claude and Codex can use localwp and discover its commands and flags. Just ask them to “Use localwp to figure out why [sitename] returns a fatal error” and similar.

Helpful commands

For a full list of available commands, see localwp help.

Upgrading Local CLI

Upgrades are automatic with each new version of Local. Once Local CLI is installed, you don’t need to do anything other than update Local.

To uninstall Local CLI

  1. Open Local preferences.
  2. Navigate to “Advanced”.
  3. Toggle “Install Local CLI” to “Off”.
  4. Click the “Apply” button.

Troubleshooting

If you see “zsh: command not found: localwp”, try restarting your terminal or opening a fresh terminal window.

If you see, “Invalid auth token”, especially after a Local update, try restarting Local.

For other issues, try removing and reinstalling Local CLI:

  1. Visit Preferences → Advanced.
  2. Toggle “Install Local CLI” off and click Apply.
  3. Toggle “Install Local CLI” on and click Apply.

Feedback and support

Is there a missing command you want to see? Need help or have general feedback? Please start a thread in the Local community forum.