On a remote host without a browser: changedcli-sdks-libraries/cli/authentication
Nearest release: v2.1.328, published 7 hours after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+22added
Lines−11removed
From line
4
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits11to this page, all time
The whole hunk
from line 4, old and new numbered
/
from line 4
44description: Authenticate the ant CLI with interactive login, API keys, named profiles, and Workload Identity Federation.
55---
66
7The `ant` CLI supports several credential sources. The [Quickstart](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/quickstart#authentication) covers the one-command login (`ant auth login`). This page covers every option in full.
7The `ant` CLI supports several credential sources. The [CLI quickstart](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/quickstart#authentication) covers the one-command login (`ant auth login`). This page covers every option in full.
88
99## Interactive login
1010
from line 19
1919# Bind to a specific workspace and skip the browser picker:
2020ant auth login --workspace-id wrkspc_01...
2121
22# If the named profile you pass with --profile doesn't exist,
23# a new named profile will be created with that name.
22# If the profile that you name with --profile doesn't exist,
23# the login creates it.
2424ant auth login --profile work
2525```
2626
27During the browser flow, you select an organization and then a [workspace](https://platform.claude.com/docs/en/manage-claude/workspaces). The issued token is [scoped to that workspace](https://platform.claude.com/docs/en/manage-claude/workspaces#api-keys-and-resource-scoping), so the CLI can only see resources that belong to it. Pass `--workspace-id` to bind directly and skip the picker. To work in more than one workspace, see [Switch between workspaces](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/authentication#switch-between-workspaces).
27The CLI stores each login under a profile. The first time you log in under a profile, you select a [workspace](https://platform.claude.com/docs/en/manage-claude/workspaces) in the browser. If you belong to more than one Claude Console organization, you select the organization first. The issued token is [scoped to that workspace](https://platform.claude.com/docs/en/manage-claude/workspaces#api-keys-and-resource-scoping), so the CLI can only see resources that belong to it. Pass `--workspace-id` to bind directly to a workspace and skip the workspace picker.
2828
29The profile keeps that organization and workspace for its later logins. To work in another organization or workspace, log in under a new profile (see [Switch between workspaces](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/authentication#switch-between-workspaces)).
30
2931Interactive login is intended for local development and scripting on your own machine. For non-interactive workloads such as CI, servers, and containers, use [Workload Identity Federation](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation) instead.
3032
31Login writes credentials to `credentials/<profile>.json`. The first login for a profile also creates `configs/<profile>.json` and sets it as the active profile. To remove stored credentials, run `ant auth logout`, or `ant auth logout --all` to clear every profile.
33Login writes credentials to `credentials/<profile>.json`. The first login for a profile also creates `configs/<profile>.json`.
3234
35A login that names a profile, with `--profile` or `ANTHROPIC_PROFILE`, makes that profile the [active profile](https://platform.claude.com/docs/en/manage-claude/wif-reference#active-profile). Any command that doesn’t name a profile, a login included, uses the active profile. Until you make another profile active, that’s `default`.
36
37To remove the active profile’s stored credentials, run `ant auth logout`. The profile keeps its organization and workspace. To clear every profile, those settings included, run `ant auth logout --all`.
38
3339## Admin access
3440
35By default, `ant auth login` requests a workspace-scoped token. To manage the resources documented on the [Admin API](https://platform.claude.com/docs/en/manage-claude/admin-api) page, request the `org:admin` scope under a dedicated profile:
41By default, `ant auth login` requests a workspace-scoped token. To manage the resources documented on the [Admin API](https://platform.claude.com/docs/en/manage-claude/admin-api) page, request the `org:admin` scope under a dedicated profile. The login makes that profile active, so the example ends by switching back to your day-to-day profile:
3642
3743```bash CLI
3844ant auth login --profile admin --scope "org:admin"
from line 45
3945
4046# Print a bearer token for Authorization headers:
4147ant auth print-credentials --profile admin --access-token
48
49# Switch back to your day-to-day profile, the one that was active
50# before the login, such as default:
51ant profile activate default
4252```
4353
44The `org:admin` scope is granted only to organization members with the admin, owner, or primary owner role. The issued token has organization-wide access, and any workspace binding on the profile does not constrain it. Keep the admin profile separate from your day-to-day profile so routine commands never run with elevated access.
54Anthropic grants the `org:admin` scope only to users and service accounts with the admin role. The issued token has organization-wide access, and any workspace binding on the profile does not constrain it. Keep the admin profile separate from your day-to-day profile so routine commands never run with elevated access.
4555
4656## API key
4757
from line 126
116126# browser, or pass --workspace-id to skip the picker):
117127# ant auth login --profile other-ws
118128
119# 2. Make it the default for subsequent commands:
120ant profile activate other-ws
129# 2. The login made other-ws active. Switch back to your day-to-day
130# profile, such as default:
131ant profile activate default
121132
122# 3. Or select it for a single command without changing the default:
133# 3. Use other-ws for one command; later commands still use default:
123134ant --profile other-ws models list
124135ANTHROPIC_PROFILE=other-ws ant models list
125136```
from line 153
142153
143154The writable keys for `ant profile set` are `workspace_id`, `base_url`, `organization_id`, `scope`, `client_id`, and `console_url`. Setting `workspace_id` records the target workspace in the profile config but does not rebind credentials that were already issued; run `ant auth login` again under that profile to mint a token for the new workspace.
144155
145For the profile file schema and the federation block, see [Profile configuration file](https://platform.claude.com/docs/en/manage-claude/wif-reference#profile-configuration-file). For Workload Identity Federation, see the [Authentication overview](https://platform.claude.com/docs/en/manage-claude/authentication) and the [WIF reference](https://platform.claude.com/docs/en/manage-claude/wif-reference).
156For the profile file schema and the federation block, see [Profile configuration file](https://platform.claude.com/docs/en/manage-claude/wif-reference#profile-configuration-file). For Workload Identity Federation, see [Authentication](https://platform.claude.com/docs/en/manage-claude/authentication) and the [WIF reference](https://platform.claude.com/docs/en/manage-claude/wif-reference).
146157
147158## Next steps
148159
No line in this hunk matches that.