# Unity Gaming Services（Unity 游戏服务）CLI

> Manage UGS configuration from the command line.

[Unity Gaming Services（Unity 游戏服务）(UGS) CLI](https://services.docs.unity.com/guides/ugs-cli/latest/general/overview) 是一个命令行界面，其中提供了各种工具来管理、测试和部署 Unity Gaming Services（Unity 游戏服务）配置。此 CLI 为 Unity Dashboard 提供了一种可扩展且可自动化的替代方案，可以改进团队的工作流程和提高其效率。

## 开始使用##get-started

要开始使用 UGS CLI，请参阅以下文档：

* 按照[入门文档](https://services.docs.unity.com/guides/ugs-cli/latest/general/get-started/install-the-cli)安装和使用 UGS CLI。
* 浏览有关如何使用 Deployments 的[示例](https://github.com/Unity-Technologies/unity-gaming-services-cli/blob/main/Samples/Deploy/instructions.md)。
* 如何将 UGS CLI 集成到 CI/CD 工具中的示例：
  * [Unity Build Automation](https://services.docs.unity.com/guides/ugs-cli/latest/general/samples/ci-cd-pipeline-usage/unity-build-automation/)
  * [GitHub Actions](https://services.docs.unity.com/guides/ugs-cli/latest/general/samples/ci-cd-pipeline-usage/github-actions)
  * [Jenkins](https://services.docs.unity.com/guides/ugs-cli/latest/general/samples/ci-cd-pipeline-usage/jenkins)
  * [Docker](https://services.docs.unity.com/guides/ugs-cli/latest/general/samples/ci-cd-pipeline-usage/docker)

如需查看完整文档，请参阅 [UGS CLI](https://services.docs.unity.com/guides/ugs-cli/latest/general/overview) 文档。

## 支持的服务和用例##supported-services-and-use-cases

### 部署##deployments

Deployments 为 UGS 引入了 Config as Code 工作流程。您可以在 CLI 中使用 deploy 命令来部署文件配置，从而实现集成到自动构建管线 (CI/CD) 中。

Unity 编辑器还通过包括 [Remote Config](https://forum.unity.com/threads/remote-config-authoring-tool-from-the-editor-pre-release.1353494/) 和 [Cloud Code](https://forum.unity.com/threads/cloud-code-js-authoring-tool-from-the-editor-pre-release.1353491/) 在内的资源包支持 Deployments 功能。此 CLI 为与引擎无关的开发者启用 Deployments 功能并实现自动化构建工作流程。

通过 Deployments 可以：

* 使用 Cloud Code 和 Remote Config 的本地配置。
* 跟随游戏客户端代码添加服务配置。
* 将类似 git 的工作流程应用于服务配置，例如分支、合并、差异比较、标签。
* 将 [Unity 环境](./service-environments.md)映射到代码仓库分支并独立工作。
* 通过 CLI 或 [Deployment（部署）窗口](https://docs.unity3d.com/Packages/com.unity.services.deployment@latest/index.html?subfolder=/manual/deployment_window.html)手动部署文件配置。
* 向您的 CI/CD 管线添加部署步骤以实现自动部署。

### Deployments 支持的服务##supported-services-for-deployments

* [Cloud Code 脚本](https://github.com/Unity-Technologies/unity-gaming-services-cli/blob/main/Samples/Deploy/instructions.md#deploy-cloud-code-script)
* [Cloud Code C# 模块](https://github.com/Unity-Technologies/unity-gaming-services-cli/blob/main/Samples/Deploy/instructions.md#deploy-cloud-code-module)
* [Remote Config](https://github.com/Unity-Technologies/unity-gaming-services-cli/blob/main/Samples/Deploy/instructions.md#deploy-remote-config)
* [Economy](https://github.com/Unity-Technologies/unity-gaming-services-cli/blob/main/Samples/Deploy/instructions.md#deploy-economy)
* [Leaderboards](https://github.com/Unity-Technologies/unity-gaming-services-cli/blob/main/Samples/Deploy/instructions.md#deploy-leaderboards)
* [Triggers](https://github.com/Unity-Technologies/unity-gaming-services-cli/blob/main/Samples/Deploy/instructions.md#deploy-triggers)
* [访问路径](https://github.com/Unity-Technologies/unity-gaming-services-cli/blob/main/Samples/Deploy/instructions.md#deploy-access)
* [Matchmaker](https://github.com/Unity-Technologies/unity-gaming-services-cli/blob/main/Samples/Deploy/instructions.md#deploy-matchmaker)

### CLI 支持的服务##supported-services-for-cli

* [访问路径](https://services.docs.unity.com/guides/ugs-cli/latest/access/Access%20Command%20Line/overview/)

* [Cloud Code](https://services.docs.unity.com/guides/ugs-cli/latest/cloud-code/Cloud%20Code%20Command%20Line/overview)

* [Economy](https://services.docs.unity.com/guides/ugs-cli/latest/economy/Economy%20Command%20Line/overview/)

* [Leaderboards](https://services.docs.unity.com/guides/ugs-cli/latest/leaderboards/Leaderboards%20Command%20Line/overview)

* [Lobby](https://services.docs.unity.com/guides/ugs-cli/latest/lobby/Lobby%20Command%20Line/overview)

* [Matchmaker](https://services.docs.unity.com/guides/ugs-cli/latest/general/base-commands/deploy/)

* [Player/Unity Authentication](https://services.docs.unity.com/guides/ugs-cli/latest/player/Player%20Command%20Line/overview/)

* [Remote Config](https://services.docs.unity.com/guides/ugs-cli/latest/remote-config/Remote%20Config%20Command%20Line/overview)

* [Triggers](https://services.docs.unity.com/guides/ugs-cli/latest/triggers/Triggers%20Command%20Line/overview/)

* [环境](https://services.docs.unity.com/guides/ugs-cli/latest/general/base-commands/environment/add)

* [Cloud Save](https://services.docs.unity.com/guides/ugs-cli/latest/cloud-save/Cloud%20Save%20Command%20Line/overview/)

* [Multiplay Hosting](https://services.docs.unity.com/guides/ugs-cli/latest/game-server-hosting/Game%20Server%20Hosting%20Command%20Line/overview/)

* [Scheduler](https://services.docs.unity.com/guides/ugs-cli/latest/scheduler/Scheduler%20Command%20Line/overview/)
