### Start Application Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt Start a specific application using its UUID. ```bash coolify app start ``` -------------------------------- ### Install Coolify CLI Locally Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/CLAUDE.md Install the Coolify CLI globally on your system using 'go install'. ```bash go install ./coolify ``` -------------------------------- ### Install Coolify CLI with Go Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt Install the Coolify CLI using the Go programming language. ```bash # Go install go install github.com/coollabsio/coolify-cli/coolify@latest ``` -------------------------------- ### Install Coolify CLI via script Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/README.md Recommended installation method for Linux and macOS systems. ```bash curl -fsSL https://raw.githubusercontent.com/coollabsio/coolify-cli/main/scripts/install.sh | bash ``` -------------------------------- ### Build and Install Coolify CLI Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/CONTRIBUTING.md Steps to clone the repository, build the CLI executable, and install it locally. ```bash # Fork the repository on GitHub # Clone your fork git clone https://github.com/YOUR_USERNAME/coolify-cli.git cd coolify-cli # Build the CLI go build -o coolify ./coolify # Install locally go install ``` -------------------------------- ### Development Commands Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/README.md Standard Go commands for building, testing, and installing the CLI locally. ```bash # Build go build -o coolify ./coolify # Run tests go test ./... # Run with coverage go test -cover ./... # Install locally go install ./coolify ``` -------------------------------- ### Install Coolify CLI via Go Install Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/HOW-TO-RELEASE.md Install the Coolify CLI directly using the 'go install' command. This method is useful for developers or users with Go installed. ```bash go install github.com/coollabsio/coolify-cli/coolify@v1.x.x ``` -------------------------------- ### Install Coolify CLI on Windows Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt Install the Coolify CLI on Windows using PowerShell. ```powershell # Windows (PowerShell) irm https://raw.githubusercontent.com/coollabsio/coolify-cli/main/scripts/install.ps1 | iex ``` -------------------------------- ### Build and Release Commands Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/ARCHITECTURE.md Commands for building the binary locally, installing it, and performing multi-platform releases using GoReleaser. ```bash # Local build go build -o coolify ./coolify # Install locally go install ./coolify # Multi-platform release goreleaser release --clean ``` -------------------------------- ### Install Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Methods to install the Coolify CLI on Linux, macOS, and Windows. ```bash # Linux/macOS - Install script (recommended) curl -fsSL https://raw.githubusercontent.com/coollabsio/coolify-cli/main/scripts/install.sh | bash # Homebrew (macOS/Linux) brew install coollabsio/coolify-cli/coolify-cli # Go install go install github.com/coollabsio/coolify-cli/coolify@latest # Windows PowerShell irm https://raw.githubusercontent.com/coollabsio/coolify-cli/main/scripts/install.ps1 | iex ``` -------------------------------- ### Command Test Example Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/CLAUDE.md Illustrates a basic structure for testing command-line commands, focusing on parsing, output, and error handling using a mock API client. ```go func TestServersListCmd(t *testing.T) { // Test with mock client // Verify output format // Test error cases } ``` -------------------------------- ### Install Coolify CLI with Homebrew Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt Install the Coolify CLI using Homebrew on macOS or Linux. ```bash # Homebrew (macOS/Linux) brew install coollabsio/coolify-cli/coolify-cli ``` -------------------------------- ### Run Coolify CLI Commands Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/CONTRIBUTING.md How to execute the Coolify CLI using 'go run' and examples of common commands with flags. ```bash # Run without installing go run ./coolify [command] # Example commands go run ./coolify context list go run ./coolify server list --debug # With flags go run ./coolify server list --format json --debug ``` -------------------------------- ### Control Application Lifecycle Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms-full.txt Commands to start, stop, and restart a specific application. ```bash coolify app start coolify app stop coolify app restart ``` -------------------------------- ### Release Notes Markdown Example Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/HOW-TO-RELEASE.md Example of release notes content in Markdown format, detailing new features, bug fixes, and breaking changes. ```markdown ## What's New - Added support for database management - Improved error messages for API failures ## Bug Fixes - Fixed panic when config file is missing ## Breaking Changes - None ``` -------------------------------- ### JSON Configuration Structure Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/ARCHITECTURE.md Example of the JSON structure for CLI configuration, including instance definitions with name, FQDN, token, and default status, as well as the last update check time. ```json { "instances": [ { "name": "prod", "fqdn": "https://coolify.example.com", "token": "your-token", "default": true } ], "lastUpdateCheckTime": "2025-01-15T10:30:00Z" } ``` -------------------------------- ### Homebrew Install Command Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/HOW-TO-RELEASE.md Install the Coolify CLI using Homebrew. This command assumes the tap 'coollabsio/coolify-cli' has been added. ```bash brew install coollabsio/coolify-cli/coolify-cli ``` -------------------------------- ### Install Coolify CLI on Linux/macOS Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt Use this curl command for a recommended installation on Linux and macOS systems. ```bash # Linux/macOS (recommended) curl -fsSL https://raw.githubusercontent.com/coollabsio/coolify-cli/main/scripts/install.sh | bash ``` -------------------------------- ### API Request Body Example Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/ARCHITECTURE.md Example of a JSON request body for creating a new server via the API, including the server's name and IP address. ```json { "name": "my-server", "ip": "192.168.1.100" } ``` -------------------------------- ### Table-Driven Test Structure Example Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/CLAUDE.md Demonstrates a table-driven test structure in Go, using a slice of structs to define multiple test scenarios with inputs and expected outputs. ```go func TestServersList(t *testing.T) { tests := []struct { name string response string wantErr bool wantCount int }{ { name: "successful list", response: readFixture("servers_list.json"), wantErr: false, wantCount: 3, }, { name: "empty list", response: "[]", wantErr: false, wantCount: 0, }, { name: "api error", response: `{"error":"unauthorized"}`, wantErr: true, wantCount: 0, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // Test implementation }) } } ``` -------------------------------- ### Define the API client structure Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/ARCHITECTURE.md Defines the HTTP client configuration and a generic GET request method. ```go type Client struct { baseURL string token string httpClient *http.Client retries int timeout time.Duration } func (c *Client) Get(ctx context.Context, path string, result interface{}) error { return c.doRequest(ctx, "GET", path, nil, result) } ``` -------------------------------- ### Get Application Details Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt Retrieve detailed information about a specific application using its UUID. ```bash coolify app get ``` -------------------------------- ### Get Deployment Details with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Retrieves detailed information for a specific deployment using its UUID. ```bash # Get deployment details coolify deploy get dep-abc123 ``` -------------------------------- ### Manage Database Lifecycle with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Controls the lifecycle of a database instance, including starting, stopping, and restarting. ```bash # Database lifecycle coolify database start db-123 coolify database stop db-123 coolify database restart db-123 ``` -------------------------------- ### Coolify CLI configuration file format Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/ARCHITECTURE.md Example JSON structure for the CLI configuration file located at ~/.config/coolify/config.json. ```json { "instances": [ { "name": "prod", "fqdn": "https://coolify.example.com", "token": "your-api-token", "default": true }, { "name": "staging", "fqdn": "https://staging.coolify.example.com", "token": "staging-token" } ] } ``` -------------------------------- ### Get Server Details with Resources using Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Retrieves detailed information for a specific server, including its running resources like containers, applications, and databases. Requires server UUID. ```bash # Get server details with resources coolify server get srv-123 --resources # Shows running containers, applications, databases on the server ``` -------------------------------- ### Create a Service (One-Click) Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms-full.txt Create a new service using a predefined type. Use `--instant-deploy` for immediate deployment. List available types with `--list-types`. ```bash coolify service create --project-uuid --server-uuid --instant-deploy coolify service create --list-types ``` -------------------------------- ### API Client Initialization with Options Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/ARCHITECTURE.md Shows how to initialize the API client using the Options pattern, allowing for flexible configuration of debug mode, retries, and timeouts. ```go client := api.NewClient(url, token, api.WithDebug(true), api.WithRetries(5), api.WithTimeout(60 * time.Second), ) ``` -------------------------------- ### Install Coolify CLI via Script Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/HOW-TO-RELEASE.md Install the Coolify CLI using the provided curl script. This is a common method for end-users to install the CLI. ```bash curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash ``` -------------------------------- ### Create Service Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt Create a new service instance, specifying its type, project UUID, server UUID, and enabling instant deployment. ```bash coolify service create --project-uuid --server-uuid --instant-deploy ``` -------------------------------- ### Create Database Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt Create a new database instance, specifying the type (e.g., postgresql), server UUID, project UUID, and environment name. ```bash coolify database create postgresql --server-uuid --project-uuid --environment-name production ``` -------------------------------- ### Create Application with Docker Image Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms-full.txt Create a new application from a pre-built Docker image hosted in a registry. Specify the image name and exposed ports. ```bash coolify app create dockerimage --project-uuid --server-uuid --docker-registry-image-name nginx --ports-exposes 80 ``` -------------------------------- ### API Response Body Example Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/ARCHITECTURE.md Example of a JSON response body for a server resource, including its UUID, name, and IP address. ```json { "uuid": "abc123", "name": "my-server", "ip": "192.168.1.100" } ``` -------------------------------- ### Deploy Preview Environment with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Initiates a deployment for a preview environment, linked to a pull request ID. Requires resource name. ```bash # Deploy preview environment coolify deploy name my-api --pull-request-id 123 ``` -------------------------------- ### Manage Application Environment Variables Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms-full.txt List, create, and synchronize environment variables for an application. Use `--file` to sync from a file and `--build-time` or `--preview` for specific sync types. ```bash coolify app env list coolify app env create --key API_KEY --value secret123 coolify app env sync --file .env.production --build-time --preview ``` -------------------------------- ### coolify app deployments logs Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms-full.txt Get deployment logs for an application. ```APIDOC ## coolify app deployments logs [deployment-uuid] ### Description Get deployment logs for an application. ### Parameters #### Path Parameters - **app-uuid** (string) - Required - The unique identifier of the application - **deployment-uuid** (string) - Optional - The unique identifier of the deployment #### Query Parameters - **--debuglogs** (boolean) - Optional - Show debug logs - **--follow (-f)** (boolean) - Optional - Follow log output - **--lines (-n)** (integer) - Optional - Number of log lines to display ``` -------------------------------- ### List Database Backup Configurations with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Lists all backup configurations for a given database UUID. ```bash # List backup configurations coolify database backup list ``` -------------------------------- ### Get Current Team Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms-full.txt Display the currently active team context. ```bash coolify team current ``` -------------------------------- ### View Application Deployment Logs Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt View the logs for a specific application deployment. Use the `--follow` flag to stream logs in real-time. ```bash coolify app deployments logs --follow ``` -------------------------------- ### Manage Database Backups Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/README.md Commands for listing, creating, and triggering backups for specific database instances. ```bash coolify database backup list coolify database backup create \ --frequency "0 2 * * *" \ --enabled \ --save-s3 \ --retention-days-locally 7 coolify database backup trigger ``` -------------------------------- ### Get Service Details Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt Retrieve detailed information about a specific service using its UUID. ```bash coolify service get ``` -------------------------------- ### Get Database Details Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt Retrieve detailed information about a specific database using its UUID. ```bash coolify database get ``` -------------------------------- ### Manage Applications Source: https://context7.com/coollabsio/coolify-cli/llms.txt Commands for creating, updating, and controlling the lifecycle of applications. ```bash # List all applications coolify app list # Output: # UUID NAME STATUS GIT_BRANCH FQDN # abc123-def456-789 my-api running main https://api.example.com # xyz789-abc123-456 frontend stopped develop https://app.example.com # Get detailed application info (JSON format) coolify app get abc123-def456-789 --format=json # Create application from public Git repository coolify app create public \ --server-uuid \ --project-uuid \ --environment-name production \ --git-repository https://github.com/user/repo \ --git-branch main \ --build-pack nixpacks \ --ports-exposes 3000 \ --domains "api.example.com" \ --instant-deploy # Create application from Docker image coolify app create dockerimage \ --server-uuid \ --project-uuid \ --environment-name production \ --docker-registry-image-name nginx \ --docker-registry-image-tag latest \ --ports-exposes 80 # Update application configuration coolify app update abc123-def456-789 \ --name "my-api-v2" \ --git-branch production \ --domains "api.example.com,api2.example.com" \ --health-check-enabled \ --health-check-path "/health" # Application lifecycle commands coolify app start abc123-def456-789 coolify app stop abc123-def456-789 coolify app restart abc123-def456-789 # View application logs coolify app logs abc123-def456-789 # Delete application (with confirmation skip) coolify app delete abc123-def456-789 --force ``` -------------------------------- ### Create Database Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms-full.txt Creates a new database instance with specified configurations. ```APIDOC ## CLI COMMAND: coolify database create ### Description Create a new database instance. Requires project and server UUIDs. ### Parameters #### Path Parameters - **type** (string) - Required - The type of database to create. #### Options - **--project-uuid** (string) - Required - Project UUID - **--server-uuid** (string) - Required - Server UUID - **--name** (string) - Optional - Database name - **--description** (string) - Optional - Database description - **--environment-name** (string) - Optional - Environment name - **--environment-uuid** (string) - Optional - Environment UUID - **--instant-deploy** (boolean) - Optional - Deploy immediately after creation (default: false) - **--is-public** (boolean) - Optional - Make database publicly accessible (default: false) - **--public-port** (integer) - Optional - Public port (default: 0) - **--limits-cpus** (string) - Optional - CPU limit (e.g., '0.5', '2') - **--limits-memory** (string) - Optional - Memory limit (e.g., '512m', '2g') - **--image** (string) - Optional - Docker image - **--destination-uuid** (string) - Optional - Destination UUID if server has multiple destinations - **--postgres-user** (string) - Optional - PostgreSQL user - **--postgres-password** (string) - Optional - PostgreSQL password - **--postgres-db** (string) - Optional - PostgreSQL database name - **--mysql-user** (string) - Optional - MySQL user - **--mysql-password** (string) - Optional - MySQL password - **--mysql-database** (string) - Optional - MySQL database name - **--mysql-root-password** (string) - Optional - MySQL root password - **--mariadb-user** (string) - Optional - MariaDB user - **--mariadb-password** (string) - Optional - MariaDB password - **--mariadb-database** (string) - Optional - MariaDB database name - **--mariadb-root-password** (string) - Optional - MariaDB root password - **--mongo-root-username** (string) - Optional - MongoDB root username - **--mongo-root-password** (string) - Optional - MongoDB root password - **--mongo-database** (string) - Optional - MongoDB database name - **--redis-password** (string) - Optional - Redis password - **--keydb-password** (string) - Optional - KeyDB password - **--dragonfly-password** (string) - Optional - Dragonfly password - **--clickhouse-admin-user** (string) - Optional - Clickhouse admin user - **--clickhouse-admin-password** (string) - Optional - Clickhouse admin password ``` -------------------------------- ### Get Coolify Context Version Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt Retrieve the version information for the current Coolify context. ```bash coolify context version ``` -------------------------------- ### Manage Servers Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/README.md Commands for listing, adding, and inspecting server resources. ```bash # List servers in production coolify --context=prod server list # Add a server with validation coolify server add myserver 192.168.1.100 --validate # Get server details with resources coolify server get --resources ``` -------------------------------- ### List Coolify Contexts Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt Display a list of all configured Coolify contexts. ```bash coolify context list ``` -------------------------------- ### Deploy Resource by Name with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Initiates a deployment for a resource identified by its name. Recommended for deployments. ```bash # Deploy by resource name (recommended) coolify deploy name my-api # Output: # MESSAGE DEPLOYMENT_UUID # Deployment started successfully dep-abc123 ``` -------------------------------- ### Manage Service Lifecycle with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Controls the lifecycle of a service instance, including starting, stopping, and restarting. ```bash # Service lifecycle coolify service start svc-123 coolify service stop svc-123 coolify service restart svc-123 ``` -------------------------------- ### Manage Multiple Coolify Contexts Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms-full.txt Demonstrates adding multiple contexts and switching between them for different deployment environments. ```bash coolify context add prod https://prod.coolify.io coolify context add staging https://staging.coolify.io coolify context use prod coolify --context=staging server list ``` -------------------------------- ### Create Application with Dockerfile Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms-full.txt Create a new application by providing a Dockerfile directly. This is useful for custom build processes. ```bash coolify app create dockerfile --project-uuid --server-uuid --dockerfile "FROM node:18 COPY . . RUN npm install CMD ["node", "index.js"]" ``` -------------------------------- ### Concurrent Resource Deployment Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/ARCHITECTURE.md Demonstrates concurrent deployment of multiple resources using goroutines and a WaitGroup for synchronization. This optimizes performance by running deployments in parallel. ```go // Deploy multiple resources concurrently var wg sync.WaitGroup for _, name := range names { wg.Add(1) go func(n string) { defer wg.Done() deployResource(n) }(name) } wg.Wait() ``` -------------------------------- ### GET coolify app storage list Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms-full.txt Lists all persistent volumes and file storages associated with a specific application. ```APIDOC ## GET coolify app storage list ### Description List all persistent volumes and file storages for a specific application. ### Method GET ### Endpoint coolify app storage list ``` -------------------------------- ### Use global flags and output formats Source: https://context7.com/coollabsio/coolify-cli/llms.txt Apply global configuration flags to commands, such as context, host, token, and output format. ```bash # Use specific context coolify --context=prod app list # Override host and token inline coolify --host https://coolify.io --token app list # Output formats coolify app list # Table format (default) coolify app list --format=json # JSON format (for scripting) coolify app list --format=pretty # Pretty-printed JSON # Show sensitive information (tokens, passwords) coolify app env list --show-sensitive # Enable debug mode coolify --debug app get # Force operations (skip confirmations) coolify app delete --force ``` -------------------------------- ### Get Server Domains with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Retrieves the list of domains associated with a specific server. Requires server UUID. ```bash # Get server domains coolify server domains srv-123 ``` -------------------------------- ### New Server Service Constructor Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/ARCHITECTURE.md Demonstrates dependency injection by passing an API client to the ServerService constructor. This facilitates testing by allowing mock clients to be injected. ```go func NewServerService(client *api.Client) *ServerService { return &ServerService{client: client} } ``` -------------------------------- ### Service Management Commands Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms-full.txt Commands for managing services within Coolify, including listing, starting, stopping, restarting, and managing storage. ```APIDOC ## GET /api/services ### Description List all services in Coolify. ### Method GET ### Endpoint /api/services ### Parameters #### Query Parameters (None) ### Response #### Success Response (200) - **services** (array) - A list of services. #### Response Example ```json { "services": [ { "uuid": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "name": "my-app", "status": "running" } ] } ``` ``` ```APIDOC ## POST /api/services/{uuid}/restart ### Description Restart a service (restart all containers). ### Method POST ### Endpoint /api/services/{uuid}/restart ### Parameters #### Path Parameters - **uuid** (string) - Required - The UUID of the service to restart. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Service restarted successfully." } ``` ``` ```APIDOC ## POST /api/services/{uuid}/start ### Description Start a service (deploy all containers). ### Method POST ### Endpoint /api/services/{uuid}/start ### Parameters #### Path Parameters - **uuid** (string) - Required - The UUID of the service to start. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Service started successfully." } ``` ``` ```APIDOC ## POST /api/services/{uuid}/stop ### Description Stop a service (stop all containers). ### Method POST ### Endpoint /api/services/{uuid}/stop ### Parameters #### Path Parameters - **uuid** (string) - Required - The UUID of the service to stop. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Service stopped successfully." } ``` ``` ```APIDOC ## POST /api/services/{service_uuid}/storage ### Description Create a storage for a service. ### Method POST ### Endpoint /api/services/{service_uuid}/storage ### Parameters #### Path Parameters - **service_uuid** (string) - Required - The UUID of the service. #### Request Body - **mount_path** (string) - Required - Mount path inside the container. - **type** (string) - Required - Storage type: 'persistent' or 'file'. - **content** (string) - Optional - File content (file only). - **fs_path** (string) - Optional - Host directory path (file only, required when --is-directory is set). - **host_path** (string) - Optional - Host path (persistent only). - **is_directory** (boolean) - Optional - Whether this is a directory mount (file only, default: false). - **name** (string) - Optional - Volume name (persistent only). ### Request Example ```json { "mount_path": "/data", "type": "persistent", "name": "my-volume" } ``` ### Response #### Success Response (200) - **uuid** (string) - The UUID of the created storage. - **message** (string) - Confirmation message. #### Response Example ```json { "uuid": "f0e1d2c3-b4a5-6789-0123-456789abcdef", "message": "Storage created successfully." } ``` ``` ```APIDOC ## DELETE /api/services/{service_uuid}/storage/{storage_uuid} ### Description Delete a storage from a service. ### Method DELETE ### Endpoint /api/services/{service_uuid}/storage/{storage_uuid} ### Parameters #### Path Parameters - **service_uuid** (string) - Required - The UUID of the service. - **storage_uuid** (string) - Required - The UUID of the storage to delete. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Storage deleted successfully." } ``` ``` ```APIDOC ## GET /api/services/{service_uuid}/storage ### Description List all persistent volumes and file storages for a specific service. ### Method GET ### Endpoint /api/services/{service_uuid}/storage ### Parameters #### Path Parameters - **service_uuid** (string) - Required - The UUID of the service. ### Response #### Success Response (200) - **storages** (array) - A list of storages. #### Response Example ```json { "storages": [ { "uuid": "f0e1d2c3-b4a5-6789-0123-456789abcdef", "name": "my-volume", "mount_path": "/data", "type": "persistent" } ] } ``` ``` ```APIDOC ## PUT /api/services/{service_uuid}/storage ### Description Update a storage for a service. ### Method PUT ### Endpoint /api/services/{service_uuid}/storage ### Parameters #### Path Parameters - **service_uuid** (string) - Required - The UUID of the service. #### Request Body - **uuid** (string) - Required - Storage UUID (use 'storage list' to find). - **type** (string) - Required - Storage type: 'persistent' or 'file'. - **content** (string) - Optional - File content (file only). - **host_path** (string) - Optional - Host path (persistent only). - **is_preview_suffix_enabled** (boolean) - Optional - Enable preview suffix for this storage (default: false). - **mount_path** (string) - Optional - Mount path inside the container. - **name** (string) - Optional - Storage name (persistent only). - **id** (integer) - Optional - Storage ID (deprecated, use --uuid instead). ### Request Example ```json { "uuid": "f0e1d2c3-b4a5-6789-0123-456789abcdef", "type": "persistent", "mount_path": "/new-data" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Storage updated successfully." } ``` ``` -------------------------------- ### Run Go tests and coverage Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/CONTRIBUTING.md Commands for executing tests, checking coverage, and generating HTML reports. ```bash # Run all tests go test ./internal/... # Run with coverage go test ./internal/... -cover # Run specific package go test ./internal/service/... -v # Run specific test go test ./internal/service -run TestServerService_List -v # Generate coverage report go test ./internal/... -coverprofile=coverage.out go tool cover -html=coverage.out ``` -------------------------------- ### Manage Application Lifecycle and Environment Variables Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/README.md Commands for listing, inspecting, and controlling application states, as well as managing environment variables including bulk synchronization from files. ```bash # List all applications coolify app list # Get application details coolify app get # Manage application lifecycle coolify app start coolify app stop coolify app restart # View application logs coolify app logs # Environment variables coolify app env list coolify app env create --key API_KEY --value secret123 # Sync from .env file (updates existing, creates new, keeps others unchanged) coolify app env sync --file .env coolify app env sync --file .env.production --build-time --preview ``` -------------------------------- ### Get Database Details with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Retrieves detailed information for a specific database using its UUID. Supports pretty-formatted output. ```bash # Get database details coolify database get db-123 --format=pretty ``` -------------------------------- ### List Databases with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Lists all available databases managed by Coolify. Shows UUID, name, type, status, and image. ```bash # List all databases coolify database list # Output: # UUID NAME TYPE STATUS IMAGE # db-123 mydb postgresql running postgres:16-alpine # db-456 cache redis running redis:7 ``` -------------------------------- ### Get Service Details with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Retrieves detailed information for a specific service using its UUID. Supports JSON output format. ```bash # Get service details coolify service get svc-123 --format=json ``` -------------------------------- ### Create a Git Branch Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/CONTRIBUTING.md When starting new work, create a feature branch from the 'v4.x' branch using this command. This ensures your changes are based on the latest development version. ```bash git checkout -b feature/my-feature v4.x ``` -------------------------------- ### Use Production Coolify Context Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt Switch to the 'prod' context for Coolify. ```bash coolify context use prod ``` -------------------------------- ### Manage Coolify Contexts Source: https://context7.com/coollabsio/coolify-cli/llms.txt Commands to configure, switch, and verify connections to different Coolify instances. ```bash # Add a self-hosted context (set as default with -d) coolify context add prod https://coolify.example.com -d # Add multiple contexts for different environments coolify context add staging https://staging.coolify.io coolify context add dev https://dev.coolify.io # Set token for Coolify Cloud coolify context set-token cloud # List all configured contexts coolify context list # Output: # NAME URL DEFAULT # prod https://coolify.example.com true # staging https://staging.coolify.io false # Switch default context coolify context use staging # Verify current context connection coolify context verify # Output: Connected to Coolify at https://staging.coolify.io # Get API version coolify context version # Output: 4.0.0-beta.471 # Update context properties coolify context update prod --url https://new-coolify.example.com --token # Delete a context coolify context delete dev ``` -------------------------------- ### Implement MyFeature Service Layer Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/CONTRIBUTING.md Provides the service layer for interacting with myfeature resources. It includes methods for listing, getting, creating, and deleting myfeatures using an API client. ```go package service import ( "context" "github.com/coollabsio/coolify-cli/internal/api" "github.com/coollabsio/coolify-cli/internal/models" ) type MyFeatureService struct { client *api.Client } func NewMyFeatureService(client *api.Client) *MyFeatureService { return &MyFeatureService{client: client} } func (s *MyFeatureService) List(ctx context.Context) ([]models.MyFeature, error) { var items []models.MyFeature err := s.client.Get(ctx, "myfeature", &items) return items, err } func (s *MyFeatureService) Get(ctx context.Context, uuid string) (*models.MyFeature, error) { var item models.MyFeature err := s.client.Get(ctx, "myfeature/"+uuid, &item) return &item, err } func (s *MyFeatureService) Create(ctx context.Context, req models.MyFeatureCreateRequest) (*models.Response, error) { var response models.Response err := s.client.Post(ctx, "myfeature", req, &response) return &response, err } func (s *MyFeatureService) Delete(ctx context.Context, uuid string) error { return s.client.Delete(ctx, "myfeature/"+uuid) } ``` -------------------------------- ### Configure and Trigger Database Backups Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms-full.txt Set up scheduled backups for a database with a cron frequency and enable S3 saving. Trigger a manual backup for a specific database and backup configuration. ```bash coolify database backup create --frequency "0 2 * * *" --enabled --save-s3 coolify database backup trigger ``` -------------------------------- ### Create PostgreSQL Database with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Creates a new PostgreSQL database instance. Requires server and project UUIDs, environment name, database name, user, password, and database name. Supports instant deployment. ```bash # Create PostgreSQL database coolify database create postgresql \ --server-uuid \ --project-uuid \ --environment-name production \ --name mydb \ --postgres-user appuser \ --postgres-password secretpass \ --postgres-db appdb \ --instant-deploy ``` -------------------------------- ### Create Database Backup Configuration with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Creates a new backup configuration for a database, specifying frequency, S3 storage, retention policies, and databases to include. Requires database UUID and S3 storage UUID. ```bash # Create backup configuration with S3 storage coolify database backup create \ --frequency "0 2 * * *" \ --enabled \ --save-s3 \ --s3-storage-uuid \ --retention-days-local 7 \ --retention-days-s3 30 \ --databases-to-backup "appdb,analytics" ``` -------------------------------- ### List Deployments Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt Retrieve a list of all deployments. ```bash coolify deploy list ``` -------------------------------- ### List Database Backup Executions with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Lists all executed backups for a given database and backup configuration. Shows UUID, status, size, and creation time. ```bash # List backup executions coolify database backup executions # Output: # UUID STATUS SIZE CREATED_AT # exec-123 success 45MB 2024-01-15T02:00:00Z # exec-456 success 44MB 2024-01-14T02:00:00Z ``` -------------------------------- ### List Servers with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Lists all managed servers. Shows UUID, name, IP address, and status. ```bash # List all servers coolify server list # Output: # UUID NAME IP STATUS # srv-123 production 192.168.1.100 running # srv-456 staging 192.168.1.101 running ``` -------------------------------- ### Create Application with Nixpacks Build Pack Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms-full.txt Create a new application using the Nixpacks build pack, specifying repository, branch, server, and exposed ports. ```bash coolify app create public --project-uuid --server-uuid --git-repository https://github.com/user/repo --git-branch main --build-pack nixpacks --ports-exposes 3000 ``` -------------------------------- ### List Applications Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt Retrieve a list of all applications managed by Coolify. ```bash coolify app list ``` -------------------------------- ### Manage Database Lifecycle Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/README.md Commands for listing, creating, and controlling the lifecycle of database resources. ```bash # List databases coolify database list # Create a PostgreSQL database coolify database create postgresql \ --server-uuid \ --project-uuid \ --name mydb \ --instant-deploy # Manage database lifecycle coolify database start coolify database stop coolify database restart ``` -------------------------------- ### POST /deploy/batch Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms-full.txt Deploy multiple resources by name. ```APIDOC ## POST coolify deploy batch ### Description Deploy multiple resources by name. ### Method POST ### Endpoint coolify deploy batch ### Parameters #### Path Parameters - **names** (string) - Required - Comma-separated list of resource names. #### Request Body - **--docker-tag** (string) - Optional - Docker image tag override for the deployment - **--force** (boolean) - Optional - Force deployment - **--pull-request-id** (integer) - Optional - Pull request ID for preview deployments ``` -------------------------------- ### Manage Environment Variables Source: https://context7.com/coollabsio/coolify-cli/llms.txt Commands to list, create, update, and sync environment variables for applications. ```bash # List all environment variables coolify app env list # Output: # UUID KEY VALUE BUILD_TIME PREVIEW # env-123 DATABASE_URL postgres://.. false false # env-456 API_KEY sk-... true true # Get specific environment variable coolify app env get DATABASE_URL # Create new environment variable coolify app env create \ --key API_SECRET \ --value "my-secret-value" \ --build-time \ --preview \ --is-literal # Update existing environment variable coolify app env update API_SECRET \ --value "new-secret-value" \ --key NEW_API_SECRET # Optional: rename the key # Sync from .env file (updates existing, creates new, keeps others) coolify app env sync --file .env.production --build-time --preview # Delete environment variable coolify app env delete ``` -------------------------------- ### List Services with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Lists all managed services. Shows UUID, name, status, and type. ```bash # List all services coolify service list # Output: # UUID NAME STATUS TYPE # svc-123 monitoring running prometheus-grafana # svc-456 logging running loki-stack ``` -------------------------------- ### Trigger Application Deployment Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms-full.txt Initiate a deployment for an application by name or in batch. Use `--force` to override checks. ```bash coolify deploy name my-application coolify deploy batch api,worker,frontend --force ``` -------------------------------- ### View Application Logs Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt View the logs for a specific application. Use the `--follow` flag to stream logs in real-time. ```bash coolify app logs --follow ``` -------------------------------- ### Manage Multi-Environment Workflows Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/README.md Configure multiple Coolify instances as contexts and switch between them to execute commands against specific environments. ```bash # Add multiple contexts coolify context add prod https://prod.coolify.io coolify context add staging https://staging.coolify.io coolify context add dev https://dev.coolify.io # Set default coolify context use prod # Use different contexts coolify --context=staging servers list coolify --context=prod deploy name api coolify --context=dev resources list # Default context (prod in this case) coolify servers list ``` -------------------------------- ### Batch Deploy Multiple Resources with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Initiates deployments for multiple resources simultaneously by listing their names. Supports forcing the deployment. ```bash # Batch deploy multiple resources coolify deploy batch api,worker,frontend --force # Output: # MESSAGE DEPLOYMENT_UUID # Deployment started successfully dep-123 # Deployment started successfully dep-456 # Deployment started successfully dep-789 ``` -------------------------------- ### List Deployments with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Lists all deployment records managed by Coolify. ```bash # List all deployments coolify deploy list ``` -------------------------------- ### Add New Server with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Adds a new server to Coolify management. Requires server name, IP address, and private key UUID. Optional port, user, and validation. ```bash # Add a new server coolify server add myserver 192.168.1.100 \ --port 22 \ --user root \ --validate # Output: Server added successfully with UUID: srv-789 ``` -------------------------------- ### Create Redis Database with Coolify CLI Source: https://context7.com/coollabsio/coolify-cli/llms.txt Creates a new Redis cache instance. Requires server and project UUIDs, environment name, database name, and password. Supports instant deployment. ```bash # Create Redis cache coolify database create redis \ --server-uuid \ --project-uuid \ --environment-name production \ --name cache \ --redis-password cachepass \ --instant-deploy ``` -------------------------------- ### Manage Services Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/README.md Commands to list, inspect, and control service lifecycles and environment variables. ```bash # List services coolify service list # Get service details coolify service get # Manage services coolify service start coolify service restart # Environment variables (same as applications) coolify service env sync --file .env ``` -------------------------------- ### List Resources Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt Retrieve a list of all resources managed by Coolify. ```bash coolify resource list ``` -------------------------------- ### Run Coolify CLI Locally Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/CLAUDE.md Execute the Coolify CLI from the source directory. Replace [command] with the desired CLI command. ```bash go run ./coolify [command] ``` -------------------------------- ### Manage File-Based Application Storage Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms-full.txt Create file-based storage for applications, mounting a specific file path and providing its content. ```bash coolify app storage create --type file --mount-path /app/config.yml --content "key: value" ``` -------------------------------- ### List Projects Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms.txt Retrieve a list of all projects within Coolify. ```bash coolify project list ``` -------------------------------- ### Run Go Tests Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/HOW-TO-RELEASE.md Execute all tests within the internal packages. Ensure all tests pass before proceeding with a release. ```bash go test ./internal/... ``` -------------------------------- ### Execute Deployment Workflows Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/README.md Commands for deploying applications by name, batch, or UUID, and monitoring or canceling active deployments. ```bash # Deploy single app by name (easier than UUID) coolify deploy name my-application # Deploy multiple apps at once coolify deploy batch api,worker,frontend # Force deploy with specific context coolify --context=prod deploy batch api,worker --force # Deploy a preview with an explicit docker tag coolify deploy uuid u5ualfp30j27qtfpgcen8p03 --pull-request-id 2345 --docker-tag 1.28.3 # Traditional UUID deployment still works coolify deploy uuid abc123-def456-... # Monitor deployments coolify deploy list coolify deploy get # Cancel a deployment coolify deploy cancel ``` -------------------------------- ### Server Management Commands Source: https://github.com/coollabsio/coolify-cli/blob/v4.x/llms-full.txt Commands for adding, removing, and managing servers. ```APIDOC ## POST coolify server add ### Description Add a server to Coolify. ### Method POST ### Endpoint coolify server add ### Parameters #### Path Parameters - **server_name** (string) - Required - **ip_address** (string) - Required - **private_key_uuid** (string) - Required #### Query Parameters - **--port (-p)** (integer) - Optional - Port (default: 22) - **--user (-u)** (string) - Optional - User (default: root) - **--validate** (boolean) - Optional - Validate the server (default: false) ```