https://github.com/workos/workos-cli
The official CLI for interacting with WorkOS APIs.
https://github.com/workos/workos-cli
cli command-line workos
Last synced: 3 months ago
JSON representation
The official CLI for interacting with WorkOS APIs.
- Host: GitHub
- URL: https://github.com/workos/workos-cli
- Owner: workos
- License: apache-2.0
- Created: 2024-07-01T17:49:00.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-02T18:43:51.000Z (3 months ago)
- Last Synced: 2025-04-02T20:50:19.393Z (3 months ago)
- Topics: cli, command-line, workos
- Language: Go
- Homepage: https://workos.com/docs
- Size: 127 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WorkOS CLI
## Installation
### MacOS (Homebrew)
#### Install
```shell
brew install workos/tap/workos-cli
```#### Upgrade
```shell
brew upgrade workos/tap/workos-cli
```## Usage
First, initialize the CLI:
```shell
workos init
```Follow the interactive prompts to configure the CLI for use with the specified environment.
The CLI can be configured to work with multiple WorkOS environments.
```shell
workos env add
```To switch between environments, use the `env switch` command and select the environment you would like to switch to:
```shell
workos env switch
```To remove a configured environment from the CLI, use the `env remove` command and select the environment you would like to remove:
```shell
workos env remove
```Once initialized, the CLI is ready to use:
```shell
workos [cmd] [args]
```### Environment Variables
WorkOS CLI support environment variables for initialization and environment management.| Environment Variable | Description | Supported Values |
|---------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|----------------------|
| WORKOS_ACTIVE_ENVIRONMENT | Sets the selected environment in your .workos.json file. Use `headless` to override environment configs with other environment variable overrides. | |
| WORKOS_ENVIRONMENTS_HEADLESS_NAME | Sets the name of the environment | |
| WORKOS_ENVIRONMENTS_HEADLESS_ENDPOINT | Sets the base endpoint for the environment | |
| WORKOS_ENVIRONMENTS_HEADLESS_API_KEY | Sets the API key for the environment | |
| WORKOS_ENVIRONMENTS_HEADLESS_TYPE | Sets the env type for the environment | Production / Sandbox |#### Examples
##### Set the active environment
```shell
export WORKOS_ACTIVE_ENVIRONMENT=local
````.workos.json`
```json
{
"environments": {
"local": {
"endpoint": "http://localhost:8001",
"apiKey": "",
"type": "Sandbox",
"name": "local"
}
}
}
```##### Headless Mode
```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
```