Introduction
This guide will walk you through a workaround to get a list of all published Economy resources using the Unity Gaming Services Command Line Interface (UGS CLI). This is useful when the dashboard doesn't clearly show which resources have been published, helping you verify the state of your game's economy configuration.
Prerequisites and Setup
Before you start, make sure you have the following:
- Node.js: The UGS CLI is a Node.js package. If you don't have Node.js installed, you'll need to install it first. https://nodejs.org/en
- A Unity Project: You'll need a Unity project with the Economy service enabled.
- Admin Access: You'll need to be an Admin on your Unity project to set up the necessary service account and roles.
Procedure
Quick start guide using Unity Gaming Services Command Line Interface [UGS CLI] with Economy to get published resources
Sections
- Installation of UGS CLI
- Getting the required data
- UGS CLI Configuration
- Setting up a service account
- Set up roles
- Get published resources from Economy using UGS CLI
- More Information
Install CLI
*Detailed instructions can be found here
If you already have Node.js you can run this command in the terminal(MAC) or command prompt(WIN) npm install -g ugs
Once complete you will have access to the UGS CLI.
Get ProjectID and Environment Name
- Find your project ID on the cloud.unity.com
- Get the project ID by copying the ID found after URL projects/XXYYZZ
- Find your Environment Name on cloud.unity.com
- Get the environment name by copying the name you use for your current environment. By default, this is production
In Terminal(MAC/LINUX) or Command Prompt(WIN)
- Configure the CLI project
ugs config set project-id YOUR_PROJECT_IDA green information message will confirm that you have successfully completed the step. - Configure the CLI environment
ugs config set environment-name YOUR_ENVIRONMENT_NAMEa green information message will confirm you successfully completed the step
Create a service Account on the dashboard
- Create a service account on the cloud.unity.com
- Go to Administration > Service Accounts > New
- Create a new Key
- Make sure to copy the KeyID, Secret, and Auth Header for future use
Service Account Roles
Set up roles for the service account so we can successfully upload files to the dashboard using the CLI
Add Organization Roles
add the following roles for the organization
- Admin > SCIM Authentication
Add Project Roles
- Admin > Unity Environment Admin
- LivOps > Economy Resources Viewer
Get Published Resources
Login To the Service Account
ugs login
Enter your Key ID and Secret when prompted. This will authenticate your CLI session with the service account credentials.
ugs economy get-published
This will return a list of all published economy resources
ugs economy get-resources
This will return a list of all published and unpublished resources
Additional Economy UGS CLI Commands:
Important Links:
Detailed installation of UGS CLI on multiple platforms
https://services.docs.unity.com/guides/ugs-cli/latest/general/get-started/install-the-cli/
Installing node https://nodejs.org/en
.