Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>LocalWP AssistantNew to Visual Studio Code? Get it now.
LocalWP Assistant

LocalWP Assistant

Per Soderlind

|
1 install
| (0) | Free
Copilot Chat participant for Local by Flywheel — query plugins, options, database and more via @localwp
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

LocalWP Assistant — VS Code Chat Participant

A GitHub Copilot Chat participant (@localwp) that lets you query and manage your Local by Flywheel WordPress sites directly from VS Code.

Features

  • Auto-detects the active site from your open file or workspace root
  • Direct MySQL connection — no WP-CLI overhead for read queries
  • WP-CLI for everything else, using Local's bundled PHP and MySQL binaries
  • LM-powered answers — free-form questions are answered in human-readable Markdown, not raw JSON
  • Follow-up suggestions after every response
  • Remembers your site — pick once, reuse for the session
  • Cross-platform — macOS, Windows, and Linux

Requirements

  • Local by Flywheel installed
  • WP-CLI in your PATH
    • macOS: brew install wp-cli
    • Other: see WP-CLI install docs
  • GitHub Copilot Chat extension

Install

Install from the VS Code Marketplace, or search for LocalWP Assistant in VS Code Extensions.

Development

git clone https://github.com/soderlind/localwp-assistant
cd localwp-assistant
npm install
npm run compile

Press F5 in VS Code to launch the Extension Development Host, or package with vsce package.

Usage

Open Copilot Chat and type @localwp followed by your question.

Slash commands

Command Description
@localwp /sites List all Local sites with running status
@localwp /plugins List active plugins (fast — direct DB)
@localwp /options siteurl Fetch options matching a pattern
@localwp /db SELECT ... Run a raw read-only SQL query

Free-form examples

@localwp What plugins are active?
@localwp What is the siteurl?
@localwp List all users
@localwp What WordPress version is running?
@localwp Show me all transients matching _site_transient_%
@localwp --site=my-other-site What theme is active?

Targeting a specific site

If multiple sites are running, the extension auto-detects from your open file. To override:

@localwp --site=my-site-name What plugins are active?

If auto-detection can't determine the site, a QuickPick will appear. Your choice is remembered for the session — subsequent messages reuse the last selected site automatically. Use --site=<name> to switch.

Architecture

src/
├── extension.ts                  ← Registers the chat participant
├── localwp/
│   ├── sites.ts                  ← Reads sites.json + site-statuses.json
│   ├── mysql.ts                  ← Direct MySQL connection via socket/TCP
│   └── wpcli.ts                  ← Runs WP-CLI via Local's bundled PHP
└── participant/
    ├── handler.ts                ← Routes requests to MySQL or WP-CLI
    └── siteSelector.ts           ← Auto-detects or QuickPicks the target site

Why direct MySQL?

On macOS/Linux, Local exposes a MySQL Unix socket per site. On Windows, it exposes a TCP port. Connecting directly with mysql2 is much faster than spinning up a PHP process for WP-CLI — especially for simple reads like listing plugins or fetching options.

WP-CLI is still used for write operations and anything that needs WordPress context (hooks, filters, PHP eval).

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft