Skip to content

Environment Variables

kortex-cli supports environment variables for configuring default behavior.

KORTEX_CLI_DEFAULT_RUNTIME

Sets the default runtime to use when registering a workspace with the init command.

Usage:

export KORTEX_CLI_DEFAULT_RUNTIME=fake
kortex-cli init /path/to/project --agent claude

Priority:

The runtime is determined in the following order (highest to lowest priority):

  1. --runtime flag (if specified)
  2. KORTEX_CLI_DEFAULT_RUNTIME environment variable (if set)
  3. Error if neither is set (runtime is required)

Example:

# Set the default runtime for the current shell session
export KORTEX_CLI_DEFAULT_RUNTIME=fake

# Register a workspace using the environment variable
kortex-cli init /path/to/project --agent claude

# Override the environment variable with the flag
kortex-cli init /path/to/another-project --agent claude --runtime podman

Notes:

  • The runtime parameter is mandatory when registering workspaces
  • If neither the flag nor the environment variable is set, the init command will fail with an error
  • Supported runtime types depend on the available runtime implementations
  • Setting this environment variable is useful for automation scripts or when you consistently use the same runtime

KORTEX_CLI_DEFAULT_AGENT

Sets the default agent to use when registering a workspace with the init command.

Usage:

export KORTEX_CLI_DEFAULT_AGENT=claude
kortex-cli init /path/to/project --runtime fake

Priority:

The agent is determined in the following order (highest to lowest priority):

  1. --agent flag (if specified)
  2. KORTEX_CLI_DEFAULT_AGENT environment variable (if set)
  3. Error if neither is set (agent is required)

Example:

# Set the default agent for the current shell session
export KORTEX_CLI_DEFAULT_AGENT=claude

# Register a workspace using the environment variable
kortex-cli init /path/to/project --runtime fake

# Override the environment variable with the flag
kortex-cli init /path/to/another-project --runtime fake --agent goose

Notes:

  • The agent parameter is mandatory when registering workspaces
  • If neither the flag nor the environment variable is set, the init command will fail with an error
  • Supported agent types depend on the available agent configurations in the runtime
  • Agent names must contain only alphanumeric characters or underscores (e.g., claude, goose, my_agent)
  • Setting this environment variable is useful for automation scripts or when you consistently use the same agent

KORTEX_CLI_STORAGE

Sets the default storage directory where kortex-cli stores its data files.

Usage:

export KORTEX_CLI_STORAGE=/custom/path/to/storage
kortex-cli init /path/to/project --runtime fake --agent claude

Priority:

The storage directory is determined in the following order (highest to lowest priority):

  1. --storage flag (if specified)
  2. KORTEX_CLI_STORAGE environment variable (if set)
  3. Default: $HOME/.kortex-cli

Example:

# Set a custom storage directory
export KORTEX_CLI_STORAGE=/var/lib/kortex

# All commands will use this storage directory
kortex-cli init /path/to/project --runtime fake --agent claude
kortex-cli list

# Override the environment variable with the flag
kortex-cli list --storage /tmp/kortex-storage