Ploy CLI
Ploy CLI is a powerful tool for managing and deploying your cloud applications.
Installation
Prerequisites
Option 1: Install Script (Recommended)
To install Ploy CLI, run:
curl -fsSL https://raw.githubusercontent.com/ploycloud/ploy-cli/main/install.sh | bash
This script will automatically download and install the latest version of Ploy CLI.
Option 2: Manual Installation
- Go to the releases page and download the latest version for your
operating system and architecture.
- Rename the downloaded file to
ploy.
- Make the file executable:
chmod +x ploy
- Move the file to a directory in your PATH, e.g.,
sudo mv ploy /usr/local/bin/
Usage
ploy [command]
Available Commands:
Global Services
ploy services start: Start global services (MySQL, Redis, Nginx Proxy)
ploy services stop: Stop global services
ploy services restart: Restart global services
Site Management
ploy sites start: Start all sites
ploy sites stop: Stop all sites
ploy sites restart: Restart all sites
Individual Site Operations
ploy start: Start the current site
ploy stop: Stop the current site
ploy restart: Restart the current site
ploy logs [container]: View logs from containers
ploy exec [container] [command]: Execute commands inside a container
WordPress CLI
ploy wp [wp-cli commands]: Execute WP-CLI commands for the current WordPress site
Deployment and Status
ploy deploy: Deploy a repository to PloyCloud
ploy list: List all deployments
ploy status: Check the status of a deployment
Miscellaneous
ploy version: Display the current version of Ploy CLI
ploy update: Update Ploy CLI to the latest version
For more information on a specific command, run:
ploy [command] --help
Examples
-
Start global services:
ploy global start
-
Deploy a repository:
ploy deploy https://github.com/username/repo.git
-
Start all sites:
ploy sites start
-
Execute a WP-CLI command:
ploy wp plugin list
-
View logs for a specific container:
ploy logs nginx
Configuration
Ploy CLI uses a configuration file to store your API key and default region. You can set these values by creating
a ~/.ploy/config.yaml file with the following content:
api_key: your-api-key-here
region: us-west-2
Alternatively, you can set environment variables:
export PLOY_API_KEY=your-api-key-here
export PLOY_REGION=us-west-2
Development
To contribute to Ploy CLI development:
-
Clone the repository:
git clone https://github.com/ploycloud/ploy-cli.git
cd ploy-cli
-
Install dependencies:
go mod download
-
Build the project:
go build -o ploy
-
Run tests:
go test ./...
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature)
- Commit your changes (
git commit -m 'Add some AmazingFeature')
- Push to the branch (
git push origin feature/AmazingFeature)
- Open a Pull Request
License
This project is licensed under the MIT License. See the LICENSE file for details.
Support
If you encounter any issues or have questions, please open an issue on
GitHub.