docs/cline-cli/configuration.mdx
Cline CLI provides multiple ways to configure settings, from the interactive cline config command to environment variables for automation.
Launch the configuration interface:
cline config
This opens an interactive view with tabs for different configuration categories.
Navigate between tabs using arrow keys.
View and edit global and workspace-specific settings:
Manage Cline rules that guide AI behavior:
.clinerules files: Project-specific rules in your workspaceRules help Cline understand your project's conventions, coding standards, and preferences.
View and manage workflows:
Configure hooks for custom logic integration:
Manage skills that extend Cline's capabilities:
Cline stores configuration in ~/.cline/data/:
~/.cline/
├── data/ # Configuration directory
│ ├── globalState.json # Global settings
│ ├── secrets.json # API keys (encrypted)
│ ├── settings/ # Settings files
│ │ └── cline_mcp_settings.json # MCP server configuration
│ ├── workspace/ # Workspace-specific state
│ └── tasks/ # Task history and data
└── log/ # Log files
For debugging, view the log file:
cline dev log
This opens the log file in your default editor.
Override the default configuration directory:
export CLINE_DIR=/custom/path/to/cline
cline "your task"
When set, all Cline data is stored in this directory instead of ~/.cline/data/.
Use cases:
Restrict which shell commands Cline can execute:
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *"], "deny": ["rm -rf *"]}'
Format:
{
"allow": ["pattern1", "pattern2"],
"deny": ["pattern3"],
"allowRedirects": true
}
Fields:
| Field | Type | Description |
|---|---|---|
allow | string[] | Glob patterns for allowed commands. If set, only matching commands are permitted. |
deny | string[] | Glob patterns for denied commands. Deny rules take precedence over allow. |
allowRedirects | boolean | Whether to allow shell redirects (>, >>, <). Default: false |
Examples:
# Allow only npm and git commands
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *"]}'
# Allow dev commands but deny dangerous ones
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *", "node *"], "deny": ["rm -rf *", "sudo *"]}'
# Allow file operations with redirects
export CLINE_COMMAND_PERMISSIONS='{"allow": ["cat *", "echo *"], "allowRedirects": true}'
Run Cline with a custom configuration directory:
cline --config /path/to/custom/config "your task"
This is useful for:
Example: Multiple configurations
# Work configuration
cline --config ~/.cline-work "review this PR"
# Personal projects
cline --config ~/.cline-personal "help me with this side project"
Cline CLI supports MCP (Model Context Protocol) servers, giving you access to external tools and data sources directly from the terminal. The CLI uses the same MCP configuration format as the VS Code extension.
You can add MCP servers from the CLI:
# STDIO server
cline mcp add kanban -- kanban mcp
# Remote HTTP server
cline mcp add linear https://mcp.linear.app/mcp --type http
These commands update:
~/.cline/data/settings/cline_mcp_settings.json
You can still edit this file directly. It uses the same JSON format as the VS Code extension:
{
"mcpServers": {
"my-server": {
"command": "node",
"args": ["/path/to/server.js"],
"env": {
"API_KEY": "your_api_key"
},
"alwaysAllow": ["tool1", "tool2"],
"disabled": false
}
}
}
For the full configuration reference including STDIO and SSE transport types, see Adding and Configuring MCP Servers.
<Note> The CLI does not yet have a `/mcp` slash command for interactive management inside the terminal UI. Use `cline mcp add` or edit `cline_mcp_settings.json` directly. </Note>If you use the CLINE_DIR environment variable or --config flag, the MCP settings file will be located at <your-config-dir>/data/settings/cline_mcp_settings.json instead.
Configure context window size for Ollama:
# In settings or via config
cline config
# Navigate to Settings tab, find ollama-api-options-ctx-num
Or set via environment:
# Set context window to 32K tokens
cline -m ollama/llama3 "your task"
Configure max tokens for LM Studio:
cline config
# Navigate to Settings tab, find lm-studio-max-tokens
If you use the Cline VS Code extension, the CLI automatically detects and can share some settings. However, the CLI maintains its own configuration for terminal-specific features.
See Installation & Setup for importing configurations from:
Use the default configuration with workspace-specific rules:
# Add project-specific rules
echo "Use TypeScript strict mode" > .clinerules/typescript.md
Use environment variables and --yolo mode:
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm test", "npm run build"]}'
cline -y "run tests and fix any failures"
Share configuration via version control:
# Commit .clinerules/ to your repo
git add .clinerules/
git commit -m "Add Cline rules for team"
~/.cline/data/CLINE_DIR isn't set to a read-only locationexport CLINE_DIR=/pathCLINE_COMMAND_PERMISSIONSTo start fresh, remove the configuration directory:
rm -rf ~/.cline/data/
cline auth # Re-authenticate