alfe setup --managed
alfe setup --managed runs the connection flow without prompts, so it suits
cloud-init scripts, Dockerfiles, and other unattended provisioning. It reads its
configuration from environment variables and marks the machine as managed.
ALFE_API_KEY=<SETUP_TOKEN> alfe setup --managedUse a setup token from the agent’s Overview tab. The token decides which agent the machine runs.
Environment variables
Section titled “Environment variables”These variables configure the run:
| Variable | Required | Purpose |
|---|---|---|
ALFE_API_KEY |
Yes | The API key the agent authenticates with. |
ALFE_API_URL |
No | Override the API endpoint. By default it’s 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 the key in
~/.alfe/config.toml. If neither exists, it exits with an error.
What it does
Section titled “What it does”Managed setup runs these steps in order:
- Resolves the API key and writes
~/.alfe/config.tomlwith managed mode on. - Asks Alfe which agent and runtime the key belongs to.
- Installs the runtime if it’s missing, and installs a diagnostics helper on a best-effort basis.
- Prepares the workspace and applies the agent’s persona.
- Installs and starts the gateway daemon as a system service.
- Registers the Alfe platform MCP server. A failure here doesn’t fail setup.
The result is a connected agent that comes back online after a reboot.
Verify
Section titled “Verify”Confirm the agent is healthy:
alfe doctorYou can also check its status in the dashboard.