Cortex Code CLI Settings¶
Cortex Code CLI settings control tool permissions, connections, and session behavior. You can configure settings using managed policy (if provided by your organization), configuration files, environment variables, and command-line arguments.
Configuration files¶
The following configuration files are used by Cortex Code CLI:
File |
Purpose |
|---|---|
|
Organization-managed policy file (optional). For OS-specific locations, see Managed settings (organization policy). |
|
Main Cortex Code CLI settings file. |
|
Permission preferences. |
|
MCP server configuration (see Model Context Protocol (MCP)). |
|
Snowflake connections (see Cortex Code CLI). Shared with Snowflake CLI. |
The full layout of the main configuration directory is:
Settings precedence¶
Settings are applied in the following order of precedence (highest to lowest):
Managed settings (system-managed policy file, if present). See Managed settings (organization policy).
In-session commands (
/plan, etc.)Command-line arguments
Environment variables
Configuration files (
~/.snowflake/cortex/)Default values embedded in the Cortex Code CLI
settings.json¶
~/.snowflake/cortex/settings.jsonMain settings file for Cortex Code CLI.
Example content:
The following settings are available:
compactMode: Enables compact output formatting.autoUpdate: Enables automatic updates.theme: Sets the CLI theme (lightordark).
permissions.json¶
~/.snowflake/cortex/permissions.jsonControls tool access permissions.
Example content:
The following settings are available:
onlyAllow: List of allowed tool patterns.defaultMode: Default permission mode (ask,allow,deny).dangerouslyAllowAll: Allows all tools without prompts (unsafe).
Managed settings (organization policy)¶
Managed settings allow IT administrators to enforce organization-wide policies for Cortex Code CLI. For example, administrators can restrict which tools or accounts can be used, enforce minimum CLI versions, and disable bypass capabilities.
These settings are typically deployed through enterprise configuration management tools (such as MDM or SCCM). Users generally cannot modify managed settings unless they have administrator/root privileges.
File locations¶
The managed settings file is stored at a system-level path:
Platform |
Path |
|---|---|
macOS |
|
Linux and WSL |
|
Configuration schema¶
The managed settings file uses JSON with the following structure:
Permissions¶
The permissions section can restrict what users can access. For example, you can allow or deny tool patterns and account patterns.
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
— |
Allowlist of patterns. If set, only matching items are allowed. |
|
|
— |
Denylist of patterns. Deny takes precedence over allow. |
|
|
|
Behavior when no rule matches. |
|
|
|
Controls whether bypass mode is allowed. |
Settings¶
The settings section enforces runtime behavior:
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Force no conversation history persistence. |
|
|
|
Force sandbox to always be enabled. |
|
|
— |
Force a specific sandbox mode. |
Required¶
The required section can enforce minimum versions:
Field |
Type |
Description |
|---|---|---|
|
|
Minimum CLI version. Older versions display an error and exit. |
Defaults¶
The defaults section provides default values. Users can override these defaults only if allowed by policy.
Field |
Type |
Description |
|---|---|---|
|
|
Default Snowflake connection name. |
|
|
Default profile to load. |
|
|
Default UI theme (for example, |
UI¶
The ui section controls user interface presentation:
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Display a banner indicating managed state. |
|
|
— |
Custom text for the managed banner. |
|
|
|
Hide dangerous options from help and UI. |
Examples¶
Basic corporate setup¶
Allow default functionality but disable bypass mode and show a managed banner.
Restrict to specific Snowflake accounts¶
Only allow connections to production and staging accounts.
Environment variables¶
Cortex Code CLI recognizes the following configuration environment variables:
Variable |
Description |
|---|---|
|
Overrides the default |
|
Overrides model selection. |
|
Enables the memory tool (set to |
|
Requires confirmation for SQL write operations in bypass mode. |
Note
For additional permission-related environment variables, see Security.
Command-line overrides¶
Cortex Code CLI settings can be overridden via command-line arguments, which include the following:
Example |
Description |
|---|---|
|
Specifies the connection. |
|
Sets the working directory. |
|
Continues the last session. |
|
Resumes a specific session. |
|
Enables planning mode. |
|
Disables permission prompts (unsafe). |
Session storage¶
Conversations and settings are stored in:
Location |
Description |
|---|---|
|
Session files. |
|
Permission preferences. |
|
MCP configuration. |