CLI
Configuration
Configure the AutoHost CLI using environment variables and the agent config file.
Environment Variables
The CLI respects the following environment variables for customizing paths:
| Variable | Default | Description |
|---|---|---|
| AUTOHOST_HOME | ~/.autohost | Base directory for AutoHost data and configuration |
| AUTOHOST_CADDY_DIR | /etc/caddy (or ~/.autohost/caddy) | Caddy configuration directory |
| AUTOHOST_COREDNS_DIR | ~/.autohost/coredns | CoreDNS configuration directory |
Agent Configuration File
The agent configuration is stored at /etc/autohost/config.yaml with permissions 600:
api_url: "https://api.autohst.dev" # Cloud API URL (HTTP) ws_url: "" # Reserved for future use grpc_address: "api.autohst.dev:9090" # Cloud API gRPC address agent_token: "autohost-node_xxxx" # Node token (from enrollment) node_id: "my-server" # Unique node identifier tags: ["production", "web"] # Optional tags for categorization
Auto-generated
Application Data
Installed applications store their Docker Compose files and data under ~/.autohost/apps/<app-name>/.
Custom Commands
Custom command scripts are stored in /var/lib/autohost/commands/. They are owned by root with group autohost (permissions 750) so the agent can execute them.
AutoHost can be configured through configuration files, environment variables, or command-line flags.
Configuration File
The global configuration file is located at ~/.autohost/config.yaml:
api_url: https://api.autohost.cloud default_region: us-east-1 output_format: table telemetry: true auth: token: <your-api-token> defaults: timeout: 30s retries: 3
Environment Variables
export AUTOHOST_API_URL=https://api.autohost.cloud export AUTOHOST_TOKEN=your-api-token export AUTOHOST_REGION=us-east-1 export AUTOHOST_DEBUG=true
Project Configuration
Each project has an autohost.yaml file in its root directory:
name: my-project
version: "1.0"
region: us-east-1
services:
api:
image: myapp/api:latest
replicas: 3
ports:
- "8080:8080"
env:
- DATABASE_URL=${DATABASE_URL}
resources:
cpu: 500m
memory: 512Mi