Skip to main content

workspace login

workspace login will initiate a device flow login request to SteamHarness Server, open the browser authorization page, and wait for the user to write the CLI dedicated API Key to the local workflow-auth.json after approval on the Web side. The CLI saves its own credentials and does not require manual token entry.

Command Format​

pnpm exec steamharness workspace login --server <url>

Parameter​

ParameterDescription
--server <url>Required. SteamHarness Server address.

Verification method​

StepsDescription
Create Device CodeCLI calls POST /api/auth/device/start.
Open the browserAutomatically open verificationUriComplete; output URL and user code without browser.
Polling ResultsCLI polls POST /api/auth/device/token until successful, denied, expired, or throttled.
Write ConfigurationAfter success, write to workflow-auth.json, and save the server, API key, expiration time, and user information.

Configuration file​

ConfigurationDescription
File nameworkflow-auth.json
macOS Default Directory~/Library/Application Support/steamharness
Windows Default Directory%APPDATA%/steamharness
Linux Default Directory$XDG_CONFIG_HOME/steamharness or ~/.config/steamharness
Custom CatalogSettings STEAMHARNESS_CLI_AUTH_DIR

Output​

SituationOutput
Login successful{ errCode: 0, errMessage: "", data: { loggedIn: true, serverUrl, user, expiresAt, apiKeyPrefix } }
Authorization denied or expiredOutput the error response returned by the server with the exit code 1.
Parameter missingOutput error message with exit code 1.

Example​

pnpm exec steamharness workspace login --server http://localhost:7126
GoalCommand
View login statusstatus
Clear Logon Statuslogout
Check Service Healthhealth