### WorkOS Configuration File Example (.workos.json) Source: https://github.com/workos/workos-cli/blob/main/README.md An example JSON structure for the `.workos.json` file, illustrating how to define multiple WorkOS environments with their respective endpoint, API key, type, and name. ```json { "environments": { "local": { "endpoint": "http://localhost:8001", "apiKey": "", "type": "Sandbox", "name": "local" } } } ``` -------------------------------- ### Initialize WorkOS CLI Source: https://github.com/workos/workos-cli/blob/main/README.md Initializes the WorkOS CLI for use. This command guides the user through interactive prompts to configure the CLI for a specific WorkOS environment. ```shell workos init ``` -------------------------------- ### Example: Set Active WorkOS Environment Source: https://github.com/workos/workos-cli/blob/main/README.md An example demonstrating how to set the active WorkOS environment using an environment variable. This is useful for switching contexts or for CI/CD pipelines. ```shell export WORKOS_ACTIVE_ENVIRONMENT=local ``` -------------------------------- ### Install WorkOS CLI via Homebrew Source: https://github.com/workos/workos-cli/blob/main/README.md Installs the WorkOS CLI using the Homebrew package manager on macOS. This is the primary method for obtaining the latest version of the CLI. ```shell brew install workos/tap/workos-cli ``` -------------------------------- ### Example: Configure WorkOS CLI in Headless Mode Source: https://github.com/workos/workos-cli/blob/main/README.md Demonstrates how to configure the WorkOS CLI for headless operation using environment variables. This method bypasses the need for a `.workos.json` file and is ideal for automated environments. ```shell export WORKOS_ACTIVE_ENVIRONMENT=headless export WORKOS_ENVIRONMENTS_HEADLESS_NAME=local export WORKOS_ENVIRONMENTS_HEADLESS_ENDPOINT=http://localhost:8001 export WORKOS_ENVIRONMENTS_HEADLESS_API_KEY= export WORKOS_ENVIRONMENTS_HEADLESS_TYPE=Sandbox ``` -------------------------------- ### WorkOS CLI Configuration via Environment Variables Source: https://github.com/workos/workos-cli/blob/main/README.md Documentation for environment variables that can be used to configure the WorkOS CLI, especially for headless operations or overriding local configurations. These variables allow for programmatic setup and management of WorkOS environments. ```APIDOC Environment Variables: WORKOS_ACTIVE_ENVIRONMENT Description: Sets the selected environment in your .workos.json file. Use `headless` to override environment configs with other environment variable overrides. Supported Values: WORKOS_ENVIRONMENTS_HEADLESS_NAME Description: Sets the name of the environment for headless configuration. Supported Values: WORKOS_ENVIRONMENTS_HEADLESS_ENDPOINT Description: Sets the base endpoint URL for the environment in headless mode. Supported Values: WORKOS_ENVIRONMENTS_HEADLESS_API_KEY Description: Sets the API key for the environment in headless mode. Supported Values: WORKOS_ENVIRONMENTS_HEADLESS_TYPE Description: Sets the environment type (e.g., Production, Sandbox) for headless configuration. Supported Values: Production / Sandbox ``` -------------------------------- ### Upgrade WorkOS CLI via Homebrew Source: https://github.com/workos/workos-cli/blob/main/README.md Upgrades an existing WorkOS CLI installation to the latest version using Homebrew. This command ensures you have the most recent features and bug fixes. ```shell brew upgrade workos/tap/workos-cli ``` -------------------------------- ### WorkOS CLI General Usage Source: https://github.com/workos/workos-cli/blob/main/README.md The general command structure for using the WorkOS CLI after initialization. It allows execution of various commands and arguments to interact with WorkOS services. ```shell workos [cmd] [args] ``` -------------------------------- ### Manage WorkOS Environments Source: https://github.com/workos/workos-cli/blob/main/README.md Commands for managing multiple WorkOS environments. This includes adding new environments, switching between configured environments, and removing existing ones. ```shell workos env add ``` ```shell workos env switch ``` ```shell workos env remove ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.