# What's new in UGS CLI 2.0.0

> UGS CLI 2.0.0 adds Unity Hub login, Observability and Purchasing commands, and new Cloud Code, Leaderboards, Matchmaker, and Triggers commands, and removes the Economy and Game Server Hosting modules.

Discover new features and improvements in the latest version of the Unity Gaming Services (UGS) CLI. Version 2.0.0 includes breaking changes. Before you upgrade, review [Moved and removed commands](#moved-and-removed-commands) to update your scripts and CI/CD pipelines.

## Log in with Unity Hub

You can now authenticate the CLI with the account signed in to Unity Hub, as an alternative to a service account.

* Use `ugs login --unity-hub` to log in with Unity Hub. Unity Hub must be running and signed in. You can't combine `--unity-hub` with the service account options.
* Running `ugs login` without options now prompts you to choose a login method: `Unity Hub` or `Service Account`.
* Set the `UGS_CLI_USE_HUB_AUTH` environment variable to `true` to use Unity Hub authentication for a single call without logging in.

Authenticated calls use the first available credential, in this order:

1. `UGS_CLI_AUTH_TOKEN`
2. `UGS_CLI_USE_HUB_AUTH`
3. The credential saved by `ugs login`
4. `UGS_CLI_SERVICE_KEY_ID` and `UGS_CLI_SERVICE_SECRET_KEY`

`ugs status` now reports which credential source is in use and any sources it overrides. It doesn't check `UGS_CLI_USE_HUB_AUTH`, so when that variable is set, `ugs status` reports the next source in the order instead of Unity Hub. `ugs logout` now covers Unity Hub logins. Environment variable credentials still authenticate calls after you log out.

For more information, refer to [Get authenticated](/services-cli/2.0.0/manual/general/get-started/get-authenticated.md) and [Login](/services-cli/2.0.0/manual/general/base-commands/login.md).

## Configuration priority and new environment variables

Options now take priority over environment variables, and environment variables take priority over local configuration. Use the new `UGS_CLI_CONFIG_DIR` environment variable to override the directory where the CLI stores its configuration.

For more information, refer to [Configuration keys](/services-cli/2.0.0/manual/general/base-commands/configuration/configuration-keys.md).

## Deploy and fetch Lobby and In-App Purchasing configurations

`ugs deploy` and `ugs fetch` now support Lobby (`.lo`) and In-App Purchasing (`.ucat`, `.catalog.csv`) files. Economy files are no longer supported.

For more information, refer to [Deploy](/services-cli/2.0.0/manual/general/base-commands/deploy.md) and [Fetch](/services-cli/2.0.0/manual/general/base-commands/fetch.md).

## Query logs with Observability commands

Use `ugs observability logs list` (alias `obs`) to query your project's logs. Filter results with `--from`, `--to`, and `--query`, and page through them with `--offset` and `--limit`.

For more information, refer to [Observability](/services-cli/2.0.0/manual/observability.md).

## Manage IAP catalogs with Purchasing commands

Use `ugs purchasing` (alias `iap`) to manage In-App Purchasing catalogs:

* `ugs purchasing list` lists your catalog items.
* `ugs purchasing new-file <file-name>` creates a `.ucat` catalog file. Add `--csv` to create a `.catalog.csv` file instead.

For more information, refer to [Purchasing](/services-cli/2.0.0/manual/purchasing.md).

## Manage Cloud Code module and script versions

* `ugs cloud-code modules get` and `ugs cloud-code scripts get` have a new `--versions` option that lists retained versions.
* [`ugs cloud-code modules delete-version`](/services-cli/2.0.0/manual/cloud-code/commands/modules/delete-version.md) and [`ugs cloud-code scripts delete-version`](/services-cli/2.0.0/manual/cloud-code/commands/scripts/delete-version.md) delete a specific version. You can't delete `latest`, the live version, or a version assigned to a release.
* [`ugs cloud-code modules get-spec`](/services-cli/2.0.0/manual/cloud-code/commands/modules/get-spec.md) retrieves a module's specification. Use `--version` to target a specific version.

## Read and manage Leaderboards scores

New command groups let you read and manage leaderboard scores and buckets:

* `ugs leaderboards buckets list` and `ugs leaderboards buckets scores`
* `ugs leaderboards scores list`, `get`, `get-range`, `get-by-player-ids`, `delete`, and `purge`

These commands support the `--offset`, `--limit`, `--tier`, `--version`, `--range-limit`, and `--player-ids` options, depending on the command.

For more information, refer to [Leaderboards](/services-cli/2.0.0/manual/leaderboards.md).

## Create Lobby configuration files

Use [`ugs lobby new-file`](/services-cli/2.0.0/manual/lobby/commands/new-file.md) to create a `.lo` configuration file, then deploy it with `ugs deploy`. This replaces the `ugs lobby import` and `ugs lobby export` commands.

## Inspect Matchmaker configuration

New Matchmaker commands:

* [`ugs matchmaker environment-config get`](/services-cli/2.0.0/manual/matchmaker/commands/environment-config/get.md)
* [`ugs matchmaker queue list`](/services-cli/2.0.0/manual/matchmaker/commands/queue/list.md)
* [`ugs matchmaker restrictions get`](/services-cli/2.0.0/manual/matchmaker/commands/restrictions/get.md)

The `ugs matchmaker new-file` template now uses `MatchId` match hosting.

Multiplay hosting is no longer supported. `ugs deploy` skips queues that use Multiplay hosting, and `ugs fetch` displays a warning for them.

## Inspect triggers and manage the dead letter queue

* [`ugs triggers get <trigger-id>`](/services-cli/2.0.0/manual/triggers/commands/get.md) retrieves a single trigger.
* `ugs triggers dlq list`, `get`, `discard`, `discard-all`, `replay`, and `replay-all` manage failed trigger events in the dead letter queue. Filter `dlq list` results with `--limit`, `--status`, `--created-from`, `--created-to`, `--resolution-action`, and `--event-id`.
* Trigger configuration files support a new `ActionScopeType` field.

For more information, refer to [Triggers](/services-cli/2.0.0/manual/triggers.md).

## Create interval schedules

Scheduler configuration files support a new interval schedule type, in addition to recurring and one-time schedules. Use `StartAt` and `EndAt` to set when a schedule is active.

For more information, refer to [Scheduler new-file](/services-cli/2.0.0/manual/scheduler/commands/new-file.md).

## Moved and removed commands

### Access commands moved to player-policy and project-policy

Access commands are now grouped under `player-policy` and `project-policy`. The `delete` commands now take statement IDs as arguments instead of a file.

| 1.9.0 command and page                                                                                                                           | 2.0.0 replacement                                                                                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ugs access delete-player-policy-statements <player-id> <file-path>``/services-cli/1.9.0/manual/access/commands/delete-player-policy-statements` | `ugs access player-policy delete <player-id> <statement-ids>...`[`/services-cli/2.0.0/manual/access/commands/player-policy/delete`](/services-cli/2.0.0/manual/access/commands/player-policy/delete.md) |
| `ugs access get-player-policy``/services-cli/1.9.0/manual/access/commands/get-player-policy`                                                     | `ugs access player-policy list --player-id <player-id>`[`/services-cli/2.0.0/manual/access/commands/player-policy/list`](/services-cli/2.0.0/manual/access/commands/player-policy/list.md)              |
| `ugs access get-all-player-policies``/services-cli/1.9.0/manual/access/commands/get-all-player-policies`                                         | `ugs access player-policy list`[`/services-cli/2.0.0/manual/access/commands/player-policy/list`](/services-cli/2.0.0/manual/access/commands/player-policy/list.md)                                      |
| `ugs access upsert-player-policy``/services-cli/1.9.0/manual/access/commands/upsert-player-policy`                                               | `ugs access player-policy update <player-id> <file-path>`[`/services-cli/2.0.0/manual/access/commands/player-policy/update`](/services-cli/2.0.0/manual/access/commands/player-policy/update.md)        |
| `ugs access delete-project-policy-statements``/services-cli/1.9.0/manual/access/commands/delete-project-policy-statements`                       | `ugs access project-policy delete <statement-ids>...`[`/services-cli/2.0.0/manual/access/commands/project-policy/delete`](/services-cli/2.0.0/manual/access/commands/project-policy/delete.md)          |
| `ugs access get-project-policy``/services-cli/1.9.0/manual/access/commands/get-project-policy`                                                   | `ugs access project-policy list`[`/services-cli/2.0.0/manual/access/commands/project-policy/list`](/services-cli/2.0.0/manual/access/commands/project-policy/list.md)                                   |
| `ugs access new-file``/services-cli/1.9.0/manual/access/commands/new-file`                                                                       | `ugs access project-policy new-file [<file-name>]`[`/services-cli/2.0.0/manual/access/commands/project-policy/new-file`](/services-cli/2.0.0/manual/access/commands/project-policy/new-file.md)         |
| `ugs access upsert-project-policy``/services-cli/1.9.0/manual/access/commands/upsert-project-policy`                                             | Removed. Use `ugs access project-policy new-file`, then `ugs deploy`.                                                                                                                                   |

The `statementIDs` delete options schema is removed from the [Access resource definition](/services-cli/2.0.0/manual/access/resource-definition.md).

### Lobby import and export removed

| 1.9.0 command and page                                               | 2.0.0 replacement                                                                                                                                                                                |
| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ugs lobby import``/services-cli/1.9.0/manual/lobby/commands/import` | `ugs lobby new-file`, then `ugs deploy`.[`/services-cli/2.0.0/manual/lobby/commands/new-file`](/services-cli/2.0.0/manual/lobby/commands/new-file.md)                                            |
| `ugs lobby export``/services-cli/1.9.0/manual/lobby/commands/export` | `ugs fetch` downloads the remote Lobby configuration to a local `.lo` file.[`/services-cli/2.0.0/manual/general/base-commands/fetch`](/services-cli/2.0.0/manual/general/base-commands/fetch.md) |

### Economy module removed

The Economy module is decommissioned. All `ugs economy` commands are removed, and `ugs deploy` and `ugs fetch` no longer support Economy files. There's no replacement in 2.0.0.

Removed pages:

* `/services-cli/1.9.0/manual/economy`
* `/services-cli/1.9.0/manual/economy/commands/delete`
* `/services-cli/1.9.0/manual/economy/commands/get-published`
* `/services-cli/1.9.0/manual/economy/commands/get-resources`
* `/services-cli/1.9.0/manual/economy/commands/new-file`
* `/services-cli/1.9.0/manual/economy/commands/publish`

### Game Server Hosting commands removed

The Game Server Hosting (Multiplay Hosting) service is decommissioned. All `ugs game-server-hosting` commands are removed, including the build, build configuration, core dump, fleet, fleet region, machine, server, and simulator commands. There's no replacement in 2.0.0.

The pages under `/services-cli/1.9.0/manual/game-server-hosting` have no 2.0.0 equivalent.

### Schema Registry pages removed

The Schema Registry commands were never included in a released version of the CLI. The 1.9.0 pages under `/services-cli/1.9.0/manual/schema-registry` documented them by mistake, and have no 2.0.0 equivalent.
