Skip to main content
xbox context saves default values for the seller, PlayFab title, XBOX title, and sandbox, so you don’t have to pass them to every command. This page also describes where a command gets these values when you don’t pass them. Context is local: these commands change nothing in Partner Center or PlayFab.

Commands

Keys

A key is the name of the option it fills in: No other option takes a saved value or a variable. title-id is an XBOX title ID in hexadecimal, such as 1234ABCD, not a PlayFab title ID. The xbl commands use it to find the title’s service configuration identifier (SCID), and ignore it when you pass --scid. See Title targeting.

How commands use saved values

When a command takes one of these options, it uses the first value it finds:
  1. The option on the command line, such as --seller-id.
  2. The option’s XBOX_ variable, such as XBOX_SELLER_ID. A blank variable counts as unset.
  3. The value saved with context set in the selected profile.
A value from a variable or saved context is checked like a typed one, and an error names where it came from, such as XBOX_SELLER_ID: --seller-id must be a positive numeric value. If nothing supplies a value that a command needs, it says how to set one. Commands where the seller is optional, xbl and test-account, use your only authorized seller. A command that changes something writes each value it filled in, and where it came from, to stderr, even with --confirm. With --verbose, every command does:
Known issues describes two problems that make game and sandbox commands use a different seller from the one chosen this way.

Profiles

A profile is a named set of saved values, such as one for a test title and one for production. Commands use the profile --profile names, else the one XBOX_PROFILE names, else default.
To use a profile for every command in a shell, set XBOX_PROFILE:
To list your profiles:
To delete a profile and every value saved in it:
  • Saving the first value to a profile creates it. Names are letters, digits, and hyphens, up to 64 characters, and aren’t case-sensitive.
  • A profile that doesn’t exist, such as a misspelled one, fails rather than falling back to default.
  • A profile doesn’t borrow values from default.
  • XBOX_ variables still win over a profile. When one wins over the profile --profile names, the command says so, even if it changes nothing:
  • The CLI doesn’t remember a profile between commands, so choosing one never changes what another terminal or agent uses.

Where values are saved

Saved values are in context.json in the CLI’s state directory: Each value belongs to the account that saved it, so another account doesn’t pick it up. auth logout keeps saved values, and signing back in as the same account restores them.

Arguments and options

Behavior

get returns the signed-in account, the profile, and a values array of key and value, with null for a key that isn’t saved. It shows what’s saved, not what a command would use; run the command with --verbose to see that. Signed out, get shows no values and says how to sign in. set, unset, and the profile commands need a signed-in account. set doesn’t check the value with the service, so a seller you can’t use fails on the first command that sends it. A service principal has no saved context. In a service-principal mode, commands that sign in refuse --profile and XBOX_PROFILE, and every context command except key list fails. Pass each value with its option or XBOX_ variable instead. See Automation (service principal) authentication.

Values that don’t come from the command line

Saved context is shared by every terminal and agent your OS user runs, and environment variables don’t appear on the command line. So besides naming each value it filled in:
  • An operation whose target is the context value itself must have it on the command line. /Admin/DeleteTitle deletes the title, and playfab api-policy set --overwrite replaces its whole API access policy, so each refuses a title from saved context or a variable, and prints the command to run instead:
    The printed command leaves out an inline --body or --statements value, because a request body can hold secrets. Put the value back in place of <body> or <statements>.
  • If another account signs in while a command that uses saved values runs, for example while it waits for confirmation, the command stops before it sends anything. Run it again.
See Safety and destructive operations for the confirmation rules.

Table output

Every context command accepts --output table:

Examples

List the keys you can save:
Save a seller and a PlayFab title, and check what’s saved:
Run commands that use the saved values, and see where the title came from:
Remove one saved value:
Remove every value saved in the selected profile:
See Configuration for settings, which context doesn’t change.
Last modified on November 18, 2026