# Connect Localwp Cli

> Use when WP-CLI, MySQL, Composer, or PHP must run inside the environment of a site managed by LocalWP on macOS. Guides agents to run the zero-config localwp-wpcli.sh helper script to execute commands in the correct site environment automatically.

- **Type:** Skill
- **Install:** `agentstack add skill-mmnaderi-localwp-cli-skill-localwp-cli-skill`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [mmnaderi](https://agentstack.voostack.com/s/mmnaderi)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [mmnaderi](https://github.com/mmnaderi)
- **Source:** https://github.com/mmnaderi/localwp-cli-skill

## Install

```sh
agentstack add skill-mmnaderi-localwp-cli-skill-localwp-cli-skill
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Connect LocalWP CLI

## Purpose

LocalWP runs each site in an isolated environment with its own PHP runtime, MySQL socket, and configurations. Sourcing LocalWP's environment manually is complex. This skill provides a zero-config helper script that automatically detects the active LocalWP site, configures the environment (from existing ssh-entry shell scripts or dynamically via `sites.json`), and executes CLI commands (such as `wp`, `mysql`, `composer`, or `php`).

## Workflow

1. Confirm the LocalWP site is running.
2. Locate the WordPress project directory (the folder containing `wp-config.php` or its parent).
3. Run the helper script to execute CLI commands:

```bash
.agents/skills/connect-localwp-cli/scripts/localwp-cli.sh "$PWD" wp db check
```

Or omit the path to use the current working directory:

```bash
.agents/skills/connect-localwp-cli/scripts/localwp-cli.sh wp db check
```

## Validation

Always run a read-only check first to verify connectivity:

```bash
.agents/skills/connect-localwp-cli/scripts/localwp-cli.sh wp option get siteurl
.agents/skills/connect-localwp-cli/scripts/localwp-cli.sh wp db check
```

## Safety

- Export the database before performing any destructive or write operations:
  ```bash
  .agents/skills/connect-localwp-cli/scripts/localwp-cli.sh wp db export
  ```
- Treat `wp db *`, `wp option update`, `wp post *`, and `wp eval-file` as write-capable.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [mmnaderi](https://github.com/mmnaderi)
- **Source:** [mmnaderi/localwp-cli-skill](https://github.com/mmnaderi/localwp-cli-skill)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-mmnaderi-localwp-cli-skill-localwp-cli-skill
- Seller: https://agentstack.voostack.com/s/mmnaderi
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
