Skip to content

CLI overview & install

The Alfe CLI (@alfe.ai/cli) connects an agent to Alfe from your own machine or server, manages the local gateway daemon, and administers integrations and MCP servers.

Terminal window
npm i @alfe.ai/cli -- -g

The command is alfe. Check the version with:

Terminal window
alfe --version

The CLI stores its configuration at ~/.alfe/config.toml. It’s written for you by alfe login and alfe setup — you don’t normally edit it by hand. It holds your API key, the active runtime, and per-runtime workspace settings.

The API endpoint is derived automatically from your API key, so most commands need no extra flags. You can override it with --gateway <url> on alfe login when needed.

Command What it does
alfe login Authenticate the CLI with your Alfe account.
alfe setup Interactive first-time setup: connect an agent on this machine.
alfe setup --managed Non-interactive setup driven by environment variables.
alfe doctor Diagnose configuration, auth, and daemon health.
alfe gateway <cmd> Manage the local gateway daemon.
alfe integration <cmd> Install and manage integrations.
alfe mcp <cmd> Manage MCP servers available to the agent.
alfe remove Uninstall Alfe integrations and their runtime config.
alfe whoami Show the currently authenticated identity.

Authenticates the CLI. By default it opens your browser to authorize the CLI device; it then stores the resulting API key in ~/.alfe/config.toml.

Terminal window
alfe login

Useful options:

  • --token <key> — use a pre-issued API key instead of the browser flow (handy for CI and headless servers). You can also set the ALFE_API_KEY environment variable.
  • --gateway <url> — override the API base URL.
  • --method <browser|api-key> — skip the interactive method picker.
  • --no-browser — don’t auto-open a browser; print the URL to visit instead.
  • --force — re-authenticate even if a valid key already exists.

Manages the local gateway daemon that keeps the agent connected to Alfe.

Subcommand Purpose
start Start the daemon.
stop Stop the daemon.
restart Restart the daemon.
status Show daemon status.
install Install the daemon as a system service (auto-start on boot).
uninstall Remove the system service.
logs Tail the daemon logs.
daemon Run the daemon in the foreground (used by service managers).

Installs and manages integrations for the connected agent. Alias: alfe int.

Subcommand Purpose
list List installed integrations.
search [query] Search the integration registry.
install <name> [version] Install an integration from the registry.
configure <name> Configure an installed integration interactively.
status [name] Health-check one or all integrations.
remove <name> Uninstall an integration.

See Integrations for what’s available and how connect flows work.

Manages the MCP servers the agent can use.

Subcommand Purpose
list (alias ls) List registered MCP servers. Add --json for machine-readable output.
add <id> Register a new MCP server. Supports --transport <stdio|sse|streamable-http>, --command, --args, --env, --url, and --header.
remove <id> (alias rm) Remove a server. Use --force to remove managed entries.
test <id> Connect briefly and list the tools a server advertises. Add --timeout <ms>.

For details on individual setup commands, continue to alfe setup.