CLI flags & environment variables
Every flag has a corresponding environment variable. Flags take precedence.
| Flag | Env var | Description |
|---|---|---|
| --port, -p | PORT | Required. Local port to expose |
| --subdomain, -s | SUBDOMAIN | Subdomain to register — myapp → myapp.macha.live. If omitted, a random 8-character subdomain is generated. |
| --server | MACHA_SERVER | Tunnel server hostname (default: macha.live) |
| --control-port | CONTROL_PORT | Server control plane port (default: 9000) |
| --data-port | DATA_PORT | Server data plane port (default: 9001) |
| --token | MACHA_TOKEN | Auth token (required when server has AUTH_TOKEN set) |
| --tls | — | Enable TLS using Mozilla root certs (for macha.live) |
| --tls-ca <PATH> | — | Enable TLS with a custom CA certificate (for self-signed certs) |
| --tls-insecure | — | Enable TLS without cert verification — dev only |
| --no-reconnect | — | Exit on disconnect instead of reconnecting |
| --ttl, -t <SECS> | — | Registration TTL in seconds (default: 3600 = 1 hour). When it elapses the server drops the subdomain; with auto-reconnect (default) the agent re-registers immediately with a fresh TTL. |
| --dashboard-port | MACHA_DASHBOARD_PORT | Dashboard HTTP port (default: 4040, set 0 to disable) |
Examples
# Basic — random subdomain macha --port 3000 # Pick your own subdomain macha --port 3000 --subdomain myapp # Using env vars (good for .env files) PORT=3000 SUBDOMAIN=myapp macha # Self-hosted server with auth token macha --port 3000 --subdomain myapp \ --server tunnel.yourcompany.com \ --token my-secret-token \ --tls # Run once (no reconnect), custom dashboard port macha --port 8080 --subdomain staging \ --no-reconnect \ --dashboard-port 5050 # Shorter TTL — drop registration after 10 minutes if not renewed macha --port 3000 --subdomain myapp --ttl 600