Running Commands
This guide covers the commands available via SSH on your staging environment.
Interactive Mode
Connect without a command to enter an interactive shell:
You'll get a wp-shell> prompt where you can run multiple commands without reconnecting:
WordPress Restricted Shell
Type 'help' for available commands, 'exit' to quit.
wp-shell> wp plugin list
wp-shell> composer show
wp-shell> exit
Single Command Mode
Run a single command and exit:
Replace {slug} with your site's slug.
File Operations
Listing Files
# List files in WordPress root
# List plugins
# List themes
Viewing Files
# View a file
# View with line numbers
WP-CLI
WP-CLI is the command-line interface for WordPress.
Plugin Management
# List all plugins
# Install a plugin
# Activate a plugin
# Update all plugins
# Deactivate and delete a plugin
Theme Management
# List themes
# Activate a theme
Database Operations
# Export database to local file
# Search and replace (useful for domain changes)
# Run the replacement (remove --dry-run)
User Management
# List users
# Create a user
# Reset a password
Cache Management
# Flush object cache
# Flush rewrite rules
WooCommerce Commands
# List orders
# Update stock
WP-CLI Documentation
For the full list of WP-CLI commands, see the WP-CLI Command Reference.
Composer
Manage PHP dependencies with Composer.
# Install dependencies
# Update dependencies
# Require a new package
# Show installed packages
Composer on Production
Composer changes on staging need to be deployed to production via the normal deployment process. Running composer install on staging doesn't affect production.