---
order: 20
---

# Managing AgentTeam Auth

The AgentTeam Desktop Client stores AgentTeam server auth locally. Each saved auth entry belongs to one AgentTeam server URL and one workspace.

## Common Commands

List saved AgentTeam auth:

```bash
agentteam auth status
```

Connect or reconnect a AgentTeam machine:

```bash
agentteam daemon --server-url <url> --api-key <machineApiKey>
```

Save or refresh auth without starting a foreground daemon:

```bash
agentteam auth login --api-key <machineApiKey>
```

`agentteam auth login` uses the default AgentTeam SaaS URL, `https://agentteam.pingcap.com`, when `--server-url` is omitted. Add `--server-url <url>` when connecting to another AgentTeam server.

Delete a saved auth entry:

```bash
agentteam auth logout <auth-id>
```

## The Difference Between `agentteam daemon --server-url ... --api-key ...` and `agentteam auth login`

These two commands are easy to mix up, but they solve different problems:

- `agentteam auth login --api-key ...`: resolve and save AgentTeam machine auth locally, using the default AgentTeam SaaS URL unless `--server-url` is provided
- `agentteam daemon --server-url ... --api-key ...`: resolve and save the same auth, then start the daemon in the foreground if needed

Both commands ask AgentTeam Server to resolve the machine API key into a workspace and machine identity before saving it locally. The user does not provide a workspace ID.

Running either command again for the same server URL and workspace updates the existing auth ID. Using the same server URL with a different workspace creates another auth entry.

## When Deletion Makes Sense

Deletion is usually the right move when:

- the auth entry is no longer used
- you want to remove an old configuration completely
- a newer machine key or workspace auth has replaced it

## Good Operating Habits

- keep the number of saved auth entries small
- review regularly which auth entries are still enabled and maintained
- remove stale auth entries after rotating or deleting machines

## Next

- [Machines](../machines/README.md)
