CLI

Configuration

How the CLI resolves configuration, where it stores state, and how to control telemetry.

The CLI resolves each setting in this order, highest wins:

  1. CLI flags, for example --workspace, --api-key, --output, --timeout.
  2. Environment variables, the POLYLANE_* set plus the standard NO_COLOR and DO_NOT_TRACK.
  3. The config file at ~/.polylane/config.json.
  4. Built-in defaults: domain api.polylane.com, timeout 300 seconds, output text in a terminal and json when piped.

Config file

~/.polylane/config.json is written with file mode 0600 and accepts six keys: domain, workspace_id, api_key, output, timeout, and telemetry. Manage it through the CLI:

Terminal
polylane config show
polylane config set --key output --value json
polylane config set --key workspace_id --value ws_0f3a9c2e5b7d4816a2c9e0f4b6d8a1c3

config show prints the resolved configuration, the auth method in use, and the config file path. API keys are masked in the output.

Workspace IDs must match ws_ followed by 32 lowercase letters and digits. To set the default workspace by slug instead of ID, use workspace use:

Terminal
polylane workspace use acme-inc

OAuth credentials live separately in ~/.polylane/credentials.json, also mode 0600, and refresh automatically when the access token nears expiry. See Authentication.

Environment variables

  • POLYLANE_API_KEY: authenticate without storing a key on disk.
  • POLYLANE_WORKSPACE_ID: set the workspace for the current shell.
  • POLYLANE_API_DOMAIN: point at a different API hostname. Hostname only, no protocol.
  • POLYLANE_OUTPUT: force text or json output.
  • POLYLANE_TIMEOUT: request timeout in seconds.
  • POLYLANE_VERBOSE: enable verbose logging.
  • POLYLANE_TELEMETRY=0: disable telemetry for this environment.
  • DO_NOT_TRACK=1: the universal telemetry opt-out. Overrides every other telemetry setting, including the config file.
  • NO_COLOR: disable ANSI colors.

Telemetry

Anonymous usage telemetry is on by default. It records the command name, flag names but never their values, the count of positional arguments but never their values, exit code and error category, durations, CLI and Node versions, operating system details, an anonymous per-install identifier, and the workspace ID. It never records credentials, user IDs, emails, file paths, command output, or full error messages.

Terminal
polylane telemetry status      # exactly what gets sent, and where
polylane telemetry disable     # persistent opt-out, written to the config file
polylane telemetry enable

Precedence for the telemetry decision: DO_NOT_TRACK, then POLYLANE_TELEMETRY, then the config file, then the default of on. There is no per-invocation flag; telemetry is a per-install choice.

Files on disk

Everything the CLI stores lives under ~/.polylane (directory mode 0700):

FileContents
config.jsonSaved settings: domain, workspace, API key, output, timeout, telemetry
credentials.jsonOAuth tokens
telemetry.jsonAnonymous install ID and run counters
update-state.jsonUpdate check state

Delete the directory to reset the CLI completely. A fresh install ID is generated on the next run.