Skip to main content
The validate command checks service configurations, dependencies, and compatibility before generating a stack.

Usage

create-better-openclaw validate [options]

Options

--services
string
Comma-separated service IDs to validate.
--preset
string
Validate a preset configuration.
--dir
string
Validate an existing docker-compose.yml file in the specified directory.
--json
boolean
default:"false"
Output results as JSON for programmatic use.

Examples

Validate services

create-better-openclaw validate --services postgres,redis,qdrant
Output:
Configuration is valid!

  Services:  3
  Memory:    ~1024MB

Validate with auto-resolved dependencies

create-better-openclaw validate --services qdrant,ollama
Output:
Configuration is valid!

  Services:  4
  Memory:    ~2560MB

  Auto-added dependencies:
    + postgres (required: qdrant)
    + redis (required: ollama)
The validator automatically adds required dependencies and shows what was added.

Validate a preset

create-better-openclaw validate --preset researcher
Output:
Configuration is valid!

  Services:  4
  Memory:    ~4096MB

Validate existing directory

create-better-openclaw validate --dir ./my-stack
Output:
Found docker-compose.yml at ./my-stack/docker-compose.yml

With warnings

create-better-openclaw validate --services ollama,vllm
Output:
Configuration is valid!

  Services:  5
  Memory:    ~8192MB

  Auto-added dependencies:
    + postgres (required: ollama)
    + redis (required: ollama)

  Warnings:
    ! High memory usage detected (~8GB). Ensure host has sufficient resources.
    ! Multiple LLM inference engines selected. Consider using only one.

With errors

create-better-openclaw validate --services invalid-service
Output:
Configuration has errors:

  x Unknown service: "invalid-service"
The command exits with status code 1 when validation fails.

JSON output

create-better-openclaw validate --services postgres,redis --json
Output:
{
  "valid": true,
  "serviceCount": 2,
  "estimatedMemoryMB": 512,
  "warnings": [],
  "errors": [],
  "addedDependencies": []
}

JSON output with errors

create-better-openclaw validate --services invalid --json
Output:
{
  "valid": false,
  "serviceCount": 0,
  "estimatedMemoryMB": 0,
  "warnings": [],
  "errors": [
    {
      "message": "Unknown service: \"invalid\"",
      "severity": "error"
    }
  ],
  "addedDependencies": []
}

Validation checks

The validator performs the following checks:

Service existence

Verifies all specified services exist in the service registry.

Dependency resolution

Automatically adds required dependencies and checks for circular dependencies.

Resource estimation

Calculates estimated memory usage for the stack.

Compatibility

Checks for service conflicts and incompatibilities.

Warnings

Detects potential issues like:
  • High memory usage
  • Multiple services of the same type
  • Beta/alpha maturity services
  • Missing recommended configurations

Exit codes

  • 0 - Validation successful
  • 1 - Validation failed or errors detected

Use cases

Pre-flight check before generation

create-better-openclaw validate --services postgres,redis,qdrant && \
create-better-openclaw generate my-stack --services postgres,redis,qdrant

CI/CD validation

#!/bin/bash
if create-better-openclaw validate --dir ./stack --json | jq -e '.valid'; then
  echo "Stack configuration is valid"
  docker compose -f ./stack/docker-compose.yml up -d
else
  echo "Stack configuration is invalid"
  exit 1
fi

Check existing stack

create-better-openclaw validate --dir ./production-stack

Build docs developers (and LLMs) love