跳到正文
FunCoding

搜索

搜索文档、文章、Skill 和 MCP

Config

Understand where Cline stores configuration and how global and project config work together.

Cline configuration lives in two scopes:

  • Global configuration in ~/.cline/ (applies globally across all Cline applications, including IDE, CLI, and SDK)
  • Project configuration in .cline/ (applies only to the current workspace)

Configuration Directory Layout

Cline stores shared configuration across a few well-known locations. The primary root is ~/.cline/, with structured app state under ~/.cline/data/:

~/.cline/
  data/
    settings/
      providers.json           # API keys and provider configuration
      global-settings.json     # Global settings
      cline_mcp_settings.json  # MCP settings
    teams/                     # Team state
    sessions/                  # One folder of messages per session
    db/                        # SQLite databases (sessions.db, cron.db, ...)
    logs/                      # CLI and hub logs
  rules/                       # Global rules
  workflows/                   # Global workflows
  hooks/                       # Global hooks
  skills/                      # Global skills
  agents/                      # Global agent definitions
  plugins/                     # Global plugins (.js, .ts)
  cron/                        # Global cron specs

Additional global search paths supported by the code:

~/Documents/Cline/
  Rules/                       # Additional global rules
  Hooks/                       # Additional global hooks
  Plugins/                     # Additional global plugins
  Workflows/                   # Additional global workflows

Project-level configuration lives in .cline/ at your repository root:

.cline/
  rules/                       # Project rules
  workflows/                   # Project workflows
  skills/                      # Project skills
  hooks/                       # Lifecycle hooks
  agents/                      # Project agent definitions
  plugins/                     # Project plugins

Notes:

  • Global provider settings, global settings, and MCP settings are stored under ~/.cline/data/settings/.
  • Global rules, workflows, hooks, skills, agents, plugins, and cron specs resolve directly under ~/.cline/.
  • Rules, hooks, plugins, and workflows may also be discovered from ~/Documents/Cline/ for compatibility.
  • In a project, Cline also reads the older .clinerules/ layout (rules, plus its workflows/, skills/ and hooks/ folders), AGENTS.md at the project root, and skills in .agents/skills/. Globally, it also reads ~/.agents/AGENTS.md and skills in ~/.agents/skills/.

What Goes Where?

  • Use global (~/.cline/) for defaults shared across all Cline applications (IDE, CLI, SDK) on your machine.
  • Use project (.cline/) for team-shared behavior that should travel with the repo.

Commit .cline/ files you want to share with your team. Keep secrets out of the repo.

Configure Through the CLI

Use the interactive config UI:

cline config

From there, you can view/edit:

  • Settings (global + workspace)
  • Rules
  • Skills
  • Hooks

Useful Configuration Commands

Use a custom configuration directory:

cline --config /path/to/custom/config "your task"

Or via environment variable:

export CLINE_DIR=/path/to/custom/config
cline "your task"

Open the CLI log file (~/.cline/data/logs/cline.log, or the file CLINE_LOG_PATH names) when troubleshooting:

cline doctor log

Environment Variables

VariableDescription
CLINE_DIRCustom configuration directory (replaces ~/.cline/), like --config
CLINE_DATA_DIRCustom data directory (replaces ~/.cline/data/)
CLINE_HUB_PORTPort of the local hub (default: 25463)
CLINE_HUB_ADDRESSHub address for cline schedule commands, like their --address option
CLINE_SESSION_BACKEND_MODEForce backend mode (local, hub, remote, auto)
CLINE_SANDBOXEnable sandbox mode
CLINE_SANDBOX_DATA_DIRSandbox session storage directory
CLINE_HOOKS_DIRAdditional hooks directory
CLINE_LOG_PATHCLI log file (default: ~/.cline/data/logs/cline.log). cline doctor log opens it

CLINE_DATA_DIR

export CLINE_DATA_DIR=/custom/path/to/cline
cline "your task"

Security Notes

Only use rules, hooks, skills, and plugins from sources you trust.

Hooks and plugins can execute code. Review them like any other executable artifact before adding them globally or to a project.