Skip to content

Connect an agent and send your first message

By the end of this tutorial you’ll have a live agent connected to Alfe from your own machine, verified from both the CLI and the Agent API, and you’ll have sent it a message. It takes a few minutes.

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

Then confirm it’s on your PATH:

Terminal
alfe --version

Link the CLI to your account. By default this opens your browser to authorize the device:

Terminal window
alfe login

On a headless machine, pass a pre-issued key instead (or set ALFE_API_KEY):

Terminal window
alfe login --token <your-api-key>

Confirm who you are:

Terminal window
alfe whoami

alfe setup connects an agent on this machine. It installs and configures the agent runtime, starts the local gateway daemon, and registers the Alfe platform tools so the agent can reach memory, model routing, and integrations:

Terminal window
alfe setup

When it finishes, the daemon is running and the agent is connected. Check its health any time:

Terminal window
alfe doctor

Your connected agent has its own API key (written into ~/.alfe/config.toml by setup, and the value of ALFE_API_KEY if you set it). Ask the API who it is:

Terminal
curl https://api.alfe.ai/agent/identity/whoami \
-H "Authorization: Bearer $ALFE_API_KEY"
{ "data": { "agentId": "agt_…", "tenantId": "" } }

Seeing your agentId confirms the agent is authenticated and reachable. See Authentication for the full token model.

Open your agent in the dashboard at app.alfe.ai and send it a message. To talk to it where you already work, connect a channel like Slack or Discord from Integrations — each agent gets its own bot identity on the channel.