Skip to content

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.

Terminal window
ALFE_API_KEY=<your-api-key> alfe setup --managed
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.

Managed setup performs the same work as the interactive wizard, in order and without prompts:

  1. Resolves the API key from the environment (or existing config) and writes ~/.alfe/config.toml with managed mode enabled.
  2. Detects or installs the agent runtime and initializes the workspace.
  3. Fetches and applies the agent’s configuration.
  4. Installs and starts the gateway daemon as a system service.
  5. 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.

After provisioning, confirm the agent is healthy:

Terminal window
alfe doctor

You can also check the agent’s status from the dashboard at app.alfe.ai.