alfe setup --managed
alfe setup --managed runs the same connection flow as
alfe setup but non-interactively. It reads its
configuration from environment variables instead of prompting, which makes it
suitable for cloud-init scripts, Dockerfiles, and other unattended
provisioning.
ALFE_API_KEY=<your-api-key> alfe setup --managedEnvironment variables
Section titled “Environment variables”| Variable | Required | Purpose |
|---|---|---|
ALFE_API_KEY |
Yes | The API key the agent authenticates with. |
ALFE_API_URL |
No | Override the API endpoint. Defaults are derived from the key. |
ALFE_MANAGED |
No | Set to true to enable managed mode without passing --managed. |
If ALFE_API_KEY isn’t set, the command falls back to an existing
~/.alfe/config.toml if one is present; otherwise it errors.
What it does
Section titled “What it does”Managed setup performs the same work as the interactive wizard, in order and without prompts:
- Resolves the API key from the environment (or existing config) and writes
~/.alfe/config.tomlwith managed mode enabled. - Detects or installs the agent runtime and initializes the workspace.
- Fetches and applies the agent’s configuration.
- Installs and starts the gateway daemon as a system service.
- Registers the Alfe platform MCP server (best-effort; non-fatal if unavailable).
The result is a connected agent that comes back online automatically after a reboot — no interaction required.
Verifying
Section titled “Verifying”After provisioning, confirm the agent is healthy:
alfe doctorYou can also check the agent’s status from the dashboard at app.alfe.ai.