Cortex Code CLI Settings¶
Cortex Code CLI settings control various aspects of its behavior, including tool permissions, connections, and sessions. You can configure settings through configuration files, command-line arguments, and environment variables.
Configuration files¶
The following configuration files are used by Cortex Code CLI:
File |
Purpose |
|---|---|
|
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:
Directory/File |
Description |
|---|---|
|
Main Cortex Code CLI config directory |
|
Main settings |
|
MCP server configs |
|
Saved permissions |
|
Global hooks |
|
Command history |
|
Session files |
|
Temporary cache |
|
SQL result metadata |
|
Parquet files |
|
Log files |
|
Persistent memory |
|
Custom agents |
|
Global skills |
|
Custom commands |
|
Hook scripts |
|
Team profiles |
|
Cloned repos |
settings.json¶
~/.snowflake/cortex/settings.jsonMain settings file for Cortex Code CLI.
Example content:
{
"compactMode": true,
"autoUpdate": true,
"theme": "dark"
}
The following settings are available:
compactMode: Enable compact output formattingautoUpdate: Enable automatic updatestheme: Set CLI theme (light,dark)
permissions.json¶
~/.snowflake/cortex/permissions.jsonControls tool access permissions.
Example content:
{
"onlyAllow": ["read_file", "execute_sql"],
"defaultMode": "ask",
"dangerouslyAllowAll": false
}
The following settings are available:
onlyAllow: List of allowed tool patternsdefaultMode: Default permission mode (ask,allow,deny)dangerouslyAllowAll: Allow all tools without prompts (unsafe)
Environment variables¶
Cortex Code CLI recognizes the following environment variables for configuration:
Variable |
Description |
|---|---|
SNOWFLAKE_HOME Override |
~/.snowflake directory |
CORTEX_AGENT_MODEL |
Override model selection |
CORTEX_ENABLE_MEMORY |
Enable memory tool (true/1) |
COCO_DANGEROUS_MODE_REQUIRE_SQL_WRITE_PERMISSION |
Require confirmation for SQL writes in bypass mode |
Settings precedence¶
Settings are applied in the following order of precedence (highest to lowest):
Default values
Configuration files (
~/.snowflake/cortex/)Environment variables
Command-line arguments
In-session commands (
/plan, etc.)
Command-line overrides¶
Cortex Code CLI settings can be overridden via command-line arguments, which include the following:
Argument |
Description |
|---|---|
|
Specify connection |
|
Working directory |
|
Continue last session |
|
Resume specific session |
|
Enable planning mode |
|
Disable permission prompts (unsafe) |
Session storage¶
Conversations and settings are stored in:
Location |
Description |
|---|---|
|
Session files |
|
Permission preferences |
|
MCP configuration |