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:- The option on the command line, such as
--seller-id. - The option’s
XBOX_variable, such asXBOX_SELLER_ID. A blank variable counts as unset. - The value saved with
context setin the selected profile.
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:
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.
XBOX_PROFILE:
- 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--profilenames, 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 incontext.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/DeleteTitledeletes the title, andplayfab api-policy set --overwritereplaces 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--bodyor--statementsvalue, 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.
Table output
Every context command accepts--output table:
