Documentation

​
​

Development

User Acquisition

Monetization

Industry

Unity Gaming Services CLI

v1.7

Legacy
​

GitHub Repository

Unity Gaming Services CLI

v1.7

Legacy
​

​
​
Unity Gaming Services CLI
  • Overview
Get started
  • Install the CLI
  • Set up a Common Configuration
  • Get Authenticated
  • Use Your First Command
Base commands
  • Configuration
  • Deploy
  • Environment
  • Fetch
  • Login
  • Logout
  • Status
Deployment definition
  • What is a Deployment Definition
  • Commands for Deployment Definition
  • Excludes
  • Troubleshooting Deployment Definition
Samples
  • CI/CD Pipeline Usage
  • Deploy Samples
  • File Type Associations
  • Redirecting Command Result to File
Troubleshooting
  • Project Roles
  • Unauthorized (Error 403)
CLI Services Documentation
  • Access
  • Cloud Code
  • Cloud Content Delivery
  • Cloud Save
  • Economy
  • Game Server Hosting
  • Leaderboards
  • Lobby
  • Matchmaker
  • Player
  • Remote Config
  • Scheduler
  • Triggers
  1. Overview

Login

Safely stores the Service Account Key ID and Secret key locally.
Read time 1 minute
Last updated 3 months ago

Safely stores the Service Account Key ID and Secret key locally.
Note
This is a base command specific to the CLI that allows you to make authenticated calls to our apis. It is not related to the Authentication Unity Service.

Interactive usage

By default, calling this command prompts you to enter your service account
key-id
and
secret-key
.
ugs loginEnter your key-id: <your-key-id>Enter your secret-key: <your-secret-key>

Automated usage

You can automate login by using both the
--service-key-id
option and the
--secret-key-stdin
option.
The
--service-key-id
option expects your service account
key-id
as argument.
The
--secret-key-stdin
option expects your
secret-key
in the standard input.
ugs login --service-key-id "your-key-id" --secret-key-stdin < "secret-key-file"
Where
"your-key-id"
is your service account
key-id
, and
"secret-key-file"
is the path to a file containing your service account
secret key
.

Options

Option

Alias

Description

key-id--service-key-idThe key-id of your service account. Must be used with "--secret-key-stdin".
secret-key--secret-key-stdinThe secret-key of your service account. Must be used with "--service-key-id".
help-?, -h, --helpDisplay help and usage information.
quiet-q, --quietReduce logging to a minimum.
json-j, --jsonUse JSON as the output format.

Environment Variables

Logging in with Environment Variables

To log in manually use the
ugs login
command.
To log in with system environment variables, set
UGS_CLI_SERVICE_KEY_ID
and
UGS_CLI_SERVICE_SECRET_KEY
to your system's environment variables.
Authenticated calls follow an order of priority for authentication:
local configuration
>
Service Account Key ID and Secret key environment variables

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.

  • On this page
    • Interactive usage

    • Automated usage

    • Options

    • Environment Variables

      • Logging in with Environment Variables