# xbox/cli architecture

> Architecture diagram of the GitHub repository xbox/cli, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xbox/cli
- Repository: https://github.com/xbox/cli

## Overview

XBOX CLI is a terminal tool for building, releasing, and operating Xbox games, with a separate set of PlayFab title-management commands. The main user workflow is to sign in, choose a saved Partner Center seller context, then run game or operational commands; results are rendered in terminal, table, or JSON formats. The graph preserves the README’s Xbox and PlayFab capabilities. Several command factories were not sampled, so their detailed internal calls are omitted; edges reflect only documented workflows or indexed source references.

Main entry points: [`src/XboxDevCLI/Program.cs`](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Program.cs) (CLI entry), [`src/XboxDevCLI/Services/PlayFabApiClient.cs`](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Services/PlayFabApiClient.cs) (PlayFab API client), [`src/XboxDevCLI/Services/AuthenticationService.cs`](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Services/AuthenticationService.cs) (Authentication), [`src/XboxDevCLI/Services/XboxPartnerClient.cs`](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Services/XboxPartnerClient.cs) (Partner Center client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry and output"]
  node_program["CLI entry<br/>[Program.cs]"]
  node_metadata["Command metadata<br/>[CommandMetadata.cs]"]
  node_output["Output formatting<br/>[OutputOptions.cs]"]
  node_terminal["Terminal views<br/>[TerminalView.cs]"]
end

subgraph group_identity["Identity and context"]
  node_authcmd["Auth commands"]
  node_auth["Authentication"]
  node_context["Saved context<br/>[ContextResolver.cs]"]
end

subgraph group_xbox["Xbox operations"]
  node_xboxcmd["Xbox game and account commands"]
  node_sandbox["Sandbox and PC commands"]
  node_testaccount["Test account commands"]
  node_playtest["Playtest commands"]
  node_xbl["Xbox services configuration"]
end

subgraph group_playfab["PlayFab operations"]
  node_playfabcmd["PlayFab commands"]
end

subgraph group_services["Service access"]
  node_partner["Partner Center client"]
  node_playfabapi["PlayFab API client"]
  node_partnerapi(("Partner Center"))
  node_playfabservice(("PlayFab service"))
  node_telemetry["Invocation telemetry"]
end

node_user(("Terminal user"))

node_user -->|"runs commands"| node_program
node_program -.->|"offers login"| node_authcmd
node_authcmd -.->|"authenticates"| node_auth
node_user -->|"sets seller"| node_context
node_user -->|"lists games"| node_xboxcmd
node_user -->|"manages sandboxes"| node_sandbox
node_user -->|"manages batches"| node_testaccount
node_user -->|"reviews playtests"| node_playtest
node_user -->|"publishes configuration"| node_xbl
node_user -->|"runs title commands"| node_playfabcmd
node_partner -.->|"sends requests"| node_partnerapi
node_playfabapi -.->|"sends API calls"| node_playfabservice
node_playfabcmd -.->|"uses client"| node_playfabapi
node_partner -->|"acquires tokens"| node_auth
node_playfabapi -->|"acquires tokens"| node_auth
node_program -->|"resolves commands"| node_metadata
node_output -->|"reads declarations"| node_metadata
node_terminal -->|"renders tables"| node_output
node_program -->|"starts invocation"| node_telemetry

click node_program "https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Program.cs"
click node_metadata "https://github.com/xbox/cli/blob/main/src/XboxDevCLI/CommandLine/CommandMetadata.cs"
click node_output "https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Output/OutputOptions.cs"
click node_terminal "https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Terminal/TerminalView.cs"
click node_authcmd "https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Commands/AuthCommandFactory.cs"
click node_auth "https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Services/AuthenticationService.cs"
click node_context "https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Services/ContextResolver.cs"
click node_xboxcmd "https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Commands/GameCommandFactory.cs"
click node_sandbox "https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Commands/SandboxCommandFactory.cs"
click node_testaccount "https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Commands/TestAccountCommandFactory.cs"
click node_playtest "https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Commands/PlaytestCommandFactory.cs"
click node_xbl "https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Commands/XboxLiveCommandFactory.cs"
click node_playfabcmd "https://github.com/xbox/cli/blob/main/src/XboxDevCLI/PlayFab/Commands/PlayFabCommandFactory.cs"
click node_partner "https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Services/XboxPartnerClient.cs"
click node_playfabapi "https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Services/PlayFabApiClient.cs"
click node_telemetry "https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Telemetry/TelemetryRecorder.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_program,node_metadata,node_output,node_terminal,node_user toneBlue
class node_authcmd,node_auth,node_context toneAmber
class node_xboxcmd,node_sandbox,node_testaccount,node_playtest,node_xbl toneMint
class node_playfabcmd toneRose
class node_partner,node_playfabapi,node_partnerapi,node_playfabservice,node_telemetry toneIndigo
```

## Components

### CLI entry and output

- [CLI entry](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Program.cs): `src/XboxDevCLI/Program.cs`
- [Command metadata](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/CommandLine/CommandMetadata.cs): `src/XboxDevCLI/CommandLine/CommandMetadata.cs`
- [Output formatting](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Output/OutputOptions.cs): `src/XboxDevCLI/Output/OutputOptions.cs`
- [Terminal views](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Terminal/TerminalView.cs): `src/XboxDevCLI/Terminal/TerminalView.cs`

### Identity and context

- [Auth commands](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Commands/AuthCommandFactory.cs): `src/XboxDevCLI/Commands/AuthCommandFactory.cs`
- [Authentication](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Services/AuthenticationService.cs): `src/XboxDevCLI/Services/AuthenticationService.cs`
- [Saved context](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Services/ContextResolver.cs): `src/XboxDevCLI/Services/ContextResolver.cs`

### Xbox operations

- [Xbox game and account commands](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Commands/GameCommandFactory.cs): `src/XboxDevCLI/Commands/GameCommandFactory.cs`
- [Sandbox and PC commands](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Commands/SandboxCommandFactory.cs): `src/XboxDevCLI/Commands/SandboxCommandFactory.cs`
- [Test account commands](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Commands/TestAccountCommandFactory.cs): `src/XboxDevCLI/Commands/TestAccountCommandFactory.cs`
- [Playtest commands](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Commands/PlaytestCommandFactory.cs): `src/XboxDevCLI/Commands/PlaytestCommandFactory.cs`
- [Xbox services configuration](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Commands/XboxLiveCommandFactory.cs): `src/XboxDevCLI/Commands/XboxLiveCommandFactory.cs`

### PlayFab operations

- [PlayFab commands](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/PlayFab/Commands/PlayFabCommandFactory.cs): `src/XboxDevCLI/PlayFab/Commands/PlayFabCommandFactory.cs`

### Service access

- [Partner Center client](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Services/XboxPartnerClient.cs): `src/XboxDevCLI/Services/XboxPartnerClient.cs`
- [PlayFab API client](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Services/PlayFabApiClient.cs): `src/XboxDevCLI/Services/PlayFabApiClient.cs`
- **Partner Center**
- **PlayFab service**
- [Invocation telemetry](https://github.com/xbox/cli/blob/main/src/XboxDevCLI/Telemetry/TelemetryRecorder.cs): `src/XboxDevCLI/Telemetry/TelemetryRecorder.cs`

### Other components

- **Terminal user**

## Connections

- Terminal user → CLI entry: runs commands (evidence: `README.md`)
- CLI entry → Auth commands: offers login (evidence: `src/XboxDevCLI/Program.cs`)
- Auth commands → Authentication: authenticates
- Terminal user → Saved context: sets seller (evidence: `README.md`)
- Terminal user → Xbox game and account commands: lists games (evidence: `README.md`)
- Terminal user → Sandbox and PC commands: manages sandboxes (evidence: `README.md`)
- Terminal user → Test account commands: manages batches (evidence: `README.md`)
- Terminal user → Playtest commands: reviews playtests (evidence: `README.md`)
- Terminal user → Xbox services configuration: publishes configuration (evidence: `README.md`)
- Terminal user → PlayFab commands: runs title commands (evidence: `README.md`)
- Partner Center client → Partner Center: sends requests
- PlayFab API client → PlayFab service: sends API calls
- PlayFab commands → PlayFab API client: uses client
- Partner Center client → Authentication: acquires tokens (evidence: `src/XboxDevCLI/Services/XboxPartnerClient.cs`)
- PlayFab API client → Authentication: acquires tokens (evidence: `src/XboxDevCLI/Services/PlayFabApiClient.cs`)
- CLI entry → Command metadata: resolves commands (evidence: `src/XboxDevCLI/Program.cs`)
- Output formatting → Command metadata: reads declarations (evidence: `src/XboxDevCLI/Output/OutputOptions.cs`)
- Terminal views → Output formatting: renders tables (evidence: `src/XboxDevCLI/Terminal/TerminalView.cs`)
- CLI entry → Invocation telemetry: starts invocation (evidence: `src/XboxDevCLI/Program.cs`)
