Install and sign in
Overview
Install the AGS CLI and sign in to your AGS environment.
Install
Homebrew (macOS)
brew install accelbyte/tap/ags-cli
Homebrew users get updates through the normal brew upgrade flow.
macOS and Linux (installer script)
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/AccelByte/accelbyte-ags-cli/releases/latest/download/accelbyte-ags-cli-installer.sh | sh
Windows (installer script)
powershell -ExecutionPolicy Bypass -c "irm https://github.com/AccelByte/accelbyte-ags-cli/releases/latest/download/accelbyte-ags-cli-installer.ps1 | iex"
The AGS CLI binaries are not code-signed yet. Your operating system may display a warning on the first run. On macOS, open the binary's properties in System Settings and allow it to run. On Windows, select Run anyway if prompted by SmartScreen.
Sign in
Browser login (interactive)
ags auth login
This opens a browser window and completes the sign-in flow. It requires a public IAM client with http://127.0.0.1:<port> configured as a redirect URI. The default port is 8080. Change it with --port if that port is in use.
Unless you set them with flags, environment variables, or a profile, the CLI prompts for two values:
- Base URL: the address of your game's AGS environment, for example
https://<YourStudioID>-<YourTitleID>.prod.gamingservices.accelbyte.io. Replace<YourStudioID>-<YourTitleID>with your game's Namespace ID: your studio ID and the game's title ID, joined by a hyphen. The Admin Portal opens on your studio's address, which is not the Base URL of your game. - Client ID: the ID of the IAM client, for example
2c7308eb4f3d48e3b892fa0794f14a9c. It is not the client name.
The CLI checks the client with IAM before it opens the browser:
- If you type an ID that IAM does not know, the prompt asks again. After three rejected answers, the command stops.
- If the ID comes from
--client-id,AGS_CLIENT_ID, or your profile, and IAM does not know it, the command stops with an error. - If the CLI cannot reach IAM, it prints a warning, and the login continues.
- If the client's redirect URI cannot lead back to this login, for example because it uses another port, the CLI prints a warning and a tip before it waits for the browser.
Before it opens the browser, the CLI prints the client it signs in with: Signing in with IAM client <id>.
If you don't have that IAM client yet, create it from the login prompt:
-
Press Enter at the Client ID prompt. If the CLI asks for the namespace to create the client in, enter it. The CLI prints a link to the IAM client form in the Admin Portal. The link selects the AGS CLI template, which creates a public client with
http://127.0.0.1:8080as its redirect URI. -
Open the link and create the client. If your Admin Portal doesn't have the AGS CLI template yet, the form opens empty. Enter Client Type: Public, Client Name: AGS CLI, and Redirect URI:
http://127.0.0.1:8080.If you log in with
--portand a port other than8080, set the client's redirect URI tohttp://127.0.0.1:<port>. This applies whether the form uses the AGS CLI template or opens empty. The CLI prints the same reminder under the link. -
Paste the new client's ID at the
Paste the new client's Client ID:prompt.
CI login (client credentials)
ags auth login --grant client-credentials
Use this in CI pipelines and service accounts. It requires a confidential IAM client and a client secret. Store the client secret as a CI secret variable. After login, subsequent ags commands in the same session use the stored token without passing credentials on every call.