amp auth

このページはまだあなたの言語に翻訳されていません。 現在取り組んでいますので、後でもう一度確認してください。

These commands authenticate amp and manage its stored credential profiles. For how profiles, regions, and credential precedence work, go to Authentication.

amp auth signup

Creates an account and saves credentials when available. If authorization is required, an interactive terminal shows the verification URL and waits for authorization; with --non-interactive or without a terminal, it returns the next step. Exit 0 can indicate requires_auth; inspect status to distinguish it from authorized. By utilizing this command you agree to the Terms of Service (https://amplitude.com/terms) and acknowledge the Privacy Policy (https://amplitude.com/privacy) applies.

bash
amp auth signup --non-interactive --email alex@example.com --full-name "Alex Morgan" --region us --accept-tos --json

amp auth login

Authenticates through the interactive OAuth device flow and saves the result as a profile. Pass --region us or --region eu when you create a profile. Omit --profile to use the implicit default profile.

A bare amp auth login, with no --profile or --region, re-authenticates the active profile against its recorded region. The CLI also accepts the development-oriented --env and --base-url options but omits them from standard help. Go to Configuration for details.

bash
amp auth login --region us

amp auth login start

Begins OAuth device authorization: returns a verification URL, user code, and expiry, and records a pending authorization. The authorization is completed out of band by confirming the code; amp auth login poll returns the resulting credential.

Use it from an agent or script. It records the pending authorization locally but doesn't expose the device code. The response includes the login poll command to run after the user approves the request.

bash
amp auth login start --region us --json

amp auth login poll

Completes the device authorization returned by amp auth login start or amp auth signup: returns the credential once the code is confirmed, or reports that authorization is still pending or the code has expired. Each call blocks up to ~25s (--timeout <seconds>, or --timeout 0 for a single check).

A pending authorization returns status: "pending" and exit code 75. An approved authorization saves the credential and returns status: "authorized". Expired and failed authorizations return error envelopes.

bash
amp auth login poll --json
amp auth login poll --timeout 0 --json

amp auth pat

Saves a Personal Access Token as a profile instead of running the device flow. --with-token is mandatory: it makes the supply-an-existing-PAT path explicit. It reads the PAT from stdin when piped, or shows a masked prompt at a terminal.

bash
echo "$PAT" | amp auth pat --with-token --profile ci --region us

amp auth use <profile>

Switches the active profile without re-authenticating.

bash
amp auth use eu

amp auth list

Lists stored profiles. An asterisk (*) marks the active one.

bash
amp auth list
amp auth list --json

amp auth status

Reports the active credential's type, base URL, and expiry, and announces when AMP_TOKEN is overriding profile selection.

bash
amp auth status
amp auth status --json

amp auth token

Prints the active access token to stdout.

bash
TOKEN=$(amp auth token)

amp logout

Removes one stored profile, or every stored profile. Unlike the other commands on this page, logout is a top-level command, not a subcommand of amp auth.

At a terminal, amp logout --all asks for confirmation. In a script or other non-interactive process, pass --yes or the command stops without deleting profiles. Logout also cancels a pending device login for the selected profile.

bash
amp logout --profile staging   # remove one profile
amp logout --all               # remove every profile
amp logout --all --yes         # remove every profile without a prompt

For credential precedence (--token > AMP_TOKEN > --profile > AMP_PROFILE > the active profile) and the scopes each command family needs, go to Authentication.

これは役に立ちましたか?

For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.

このページでは