-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Summary
Currently, when WP-CLI is not installed, ensureWpCli() shows installation instructions and exits. This proposal adds automatic WP-CLI installation to improve the onboarding experience.
Current Behavior
When WP-CLI is missing, users see:
Error: WP-CLI is not installed or not in PATH.
Install WP-CLI:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
Or visit: https://wp-cli.org/#installing
Proposed Behavior
Automatically download and install WP-CLI to a tool-managed location (~/.wordsmith/bin/wp) when not detected.
Implementation Plan
1. Add installWpCli() function
- Download
wp-cli.pharfrom official source - Save to
~/.wordsmith/bin/wp - Make executable (
chmod +x) - No sudo required
2. Update findWpCliPath()
- Check
~/.wordsmith/bin/wpfirst - Fall back to system PATH lookup
3. Modify ensureWpCli()
- Prompt user for confirmation before auto-installing
- Show progress during download
- Verify installation succeeded
4. (Optional) Add explicit command
wordsmith doctororwordsmith setupfor manual installation/verification
Considerations
| Aspect | Decision |
|---|---|
| Install location | ~/.wordsmith/bin/wp - isolated, no sudo needed |
| User consent | Prompt before installing (not silent) |
| Platform support | macOS/Linux initially, Windows TBD |
| PHP dependency | Check PHP is available before attempting install |
Benefits
- Zero-friction onboarding for new users
- No manual installation steps required
- Tool manages its own dependencies
- Doesn't require elevated privileges
Related Files
src/lib/wpcli.ts- Core WP-CLI abstraction layer
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels