The add and remove commands allow you to modify an existing OpenClaw stack by adding or removing services.
add command
Add a service to an existing stack.
Usage
create-better-openclaw add <service-id> [options]
Arguments
The service ID to add (e.g., qdrant, prometheus, ollama).
Options
Project directory containing the stack (default: current directory).
Overwrite existing files if there are conflicts.
Output results as JSON for programmatic use.
Examples
Add a vector database
cd my-stack
create-better-openclaw add qdrant
Output:
Adding qdrant to stack...
Added qdrant. Stack now has 4 services.
Add to a specific directory
create-better-openclaw add prometheus --dir ./production-stack
Add with automatic dependency resolution
create-better-openclaw add ollama
If the stack doesn’t have required dependencies (like Redis), they’ll be automatically added:
Adding ollama to stack...
Added ollama. Stack now has 5 services.
Note: Also added required dependencies:
+ redis (required by ollama)
Service already exists
create-better-openclaw add postgres
Output:
Service "postgres" is already in the stack.
JSON output
create-better-openclaw add grafana --json
Output:
{
"added": "grafana",
"serviceCount": 6,
"estimatedMemoryMB": 3584
}
remove command
Remove a service from an existing stack.
Usage
create-better-openclaw remove <service-id> [options]
Arguments
The service ID to remove (e.g., qdrant, prometheus, ollama).
Options
Project directory containing the stack (default: current directory).
Output results as JSON for programmatic use.
Examples
Remove a service
cd my-stack
create-better-openclaw remove ollama
Output:
Removing ollama from stack...
Removed ollama. Stack now has 3 services.
Remove from a specific directory
create-better-openclaw remove grafana --dir ./production-stack
Service not in stack
create-better-openclaw remove elasticsearch
Output:
Service "elasticsearch" is not in the stack.
Cannot remove mandatory service
create-better-openclaw remove postgres
Output:
Cannot remove "postgres": it is mandatory.
Mandatory services are core dependencies required by other services and cannot be removed.
JSON output
create-better-openclaw remove prometheus --json
Output:
{
"removed": "prometheus",
"serviceCount": 4
}
Workflow examples
Incrementally build a stack
# Start with minimal preset
create-better-openclaw my-stack --preset minimal
cd my-stack
# Add vector search
create-better-openclaw add qdrant
# Add monitoring
create-better-openclaw add prometheus
create-better-openclaw add grafana
# Add local LLM
create-better-openclaw add ollama
# Start the stack
docker compose up -d
Optimize resource usage
# Remove resource-intensive services
create-better-openclaw remove elasticsearch
create-better-openclaw remove ollama
# Check remaining services
docker compose config --services
Swap services
# Replace Ollama with vLLM
create-better-openclaw remove ollama
create-better-openclaw add vllm
Prepare for production
# Add monitoring and proxy
create-better-openclaw add prometheus
create-better-openclaw add grafana
create-better-openclaw add caddy
Important notes
Stack file must exist
Both commands require an existing docker-compose.yml file in the target directory. If you don’t have a stack yet, use generate or init first:
create-better-openclaw generate my-stack --preset minimal
cd my-stack
create-better-openclaw add qdrant
Automatic dependency management
When adding services:
- Required dependencies are automatically added
- Duplicate services are detected and skipped
When removing services:
- Mandatory services cannot be removed
- No automatic cleanup of orphaned dependencies (manual review recommended)
Configuration preservation
The commands regenerate the entire docker-compose.yml and related files. Any manual modifications to generated files will be overwritten. To preserve custom configurations:
- Use environment variables in
.env (not overwritten)
- Use Docker Compose override files (
docker-compose.override.yml)
- Keep custom configs in separate directories
Restart required
After adding or removing services, restart the stack:
docker compose down
docker compose up -d