CLI Commands
CLI Commands
Command Structure
All Cloudscript CLI commands follow this basic structure:
cloud [command] <path> [options]Where:
commandis one of: convert, plan, apply, destroypathis either a file path or directory pathoptionsare additional flags and parameters
cloud convert
Synopsis
cloud convert <path>Description
Converts .cloud configuration files into standard infrastructure code, generating Terraform, Kubernetes, and Ansible configurations.
Path Requirements
If your
.cloudfile references external files (usingfile()), provide the directory containing both the.cloudfile and referenced filesIf no external files are referenced, you can provide either the
.cloudfile path or its containing directory
Behavior
Validates the
.cloudfile syntaxCreates/overwrites the IaC directory
Generates:
Terraform configurations (main.tf.json)
Kubernetes manifests (resources.yml)
Ansible playbooks (playbook.yml)
Pre-processes any file references
Warning
Converting will:
Overwrite all existing content in the IaC directory
Make previously deployed resources unmanageable via
cloud destroy
Example
# Converting a configuration with external files
cloud convert ./my-project
# Converting a single .cloud file
cloud convert ./my-project/service.cloudcloud plan
Synopsis
cloud plan <path>Description
Performs a comprehensive dry-run of your infrastructure deployment, analyzing all components:
Terraform plan for infrastructure changes
Kubernetes dry-run for container configurations
Ansible check mode for configuration management
Capabilities
Validates syntax and configuration
Detects potential deployment issues
Shows detailed change preview
Identifies missing dependencies
Validates network configurations
Checks security group settings
Example Output
Planned changes:
CREATE: compute 'web_server' in infrastructure block
MODIFY: security_group 'allow_http' in infrastructure block
CREATE: deployment 'webapp' in containers block
MODIFY: service 'nginx' in configuration blockcloud apply
Synopsis
cloud apply <path> [--auto-approve]Description
Deploys your infrastructure by executing:
Terraform apply for cloud resources
Kubernetes apply for container workloads
Ansible playbook for configuration management
Features
Automatic SSH key management
Network access configuration
Security group management
Error handling
Progress tracking
Options
--auto-approve: Skip interactive approval
Important Notes
Requires appropriate cloud provider credentials
Handles both AWS and GCP deployments
Manages dependencies between components
Provides real-time deployment status
Supports rollback on failure
Example
# Interactive deployment
cloud apply ./my-project
# Non-interactive deployment
cloud apply ./my-project --auto-approvecloud destroy
Synopsis
cloud destroy <path> [--auto-approve]Description
Removes all deployed infrastructure components in the correct order:
Removes container workloads
Terminates cloud resources
Cleans up associated configurations
Safety Features
Interactive confirmation required
Resource dependency checking
Staged deletion process
State verification
Options
--auto-approve: Skip confirmation prompt
Example
# Interactive destruction
cloud destroy ./my-project
# Non-interactive destruction
cloud destroy ./my-project --auto-approveWarning
The destroy command will permanently remove all resources. Ensure you have:
Backed up any important data
Verified the correct path
Understood which resources will be removed
Last updated