Cline CLI runs coding tasks directly from your terminal. Open an interactive session with cline, submit a task directly from the shell, or pipe input into a headless run for scripts and automation.
Shell commands control how a run starts, while slash commands and keyboard shortcuts control the interactive terminal session.
Use this Cline CLI cheat sheet to find the exact syntax for everyday commands, approval settings, saved sessions, MCP servers, and scheduled tasks.
Cline CLI Cheat Sheet: Commands, Flags & Shortcuts
Common Cline CLI Commands
| Command | Action |
|---|---|
cline | Open an interactive terminal session. |
cline "TASK" | Run one task in Act mode and exit. Tool auto-approval is on by default. |
cline -i "TASK" | Open an interactive TUI session with a starting task. |
cline -p "TASK" | Start a task in Plan mode. |
cline --auto-approve false | Turn off all-tool auto-approval. Safe tools can still run automatically, while other actions prompt. |
cline --id <session-id> | Resume a saved session. |
cline --json "TASK" | Run a task with newline-delimited JSON output. |
cline auth | Configure a model provider and credentials. |
cline history | Browse saved sessions. |
cline config | Open configuration settings. |
cline mcp | Manage MCP servers. |
cline doctor | Diagnose CLI problems. |
cline update | Check for and install updates. |
cline --version | Check the installed CLI version. |
cline --help | Show top-level commands and options. |
cline <command> --help | Show options for a particular command. |
Cline TUI Slash Commands
Type / in an interactive session to browse commands.
| Slash command | Action |
|---|---|
/settings | Open agent configuration. /config is an accepted alias. |
/model | Choose a model or provider and adjust the model’s reasoning setting. |
/theme | Change the terminal color theme. |
/account | View your Cline account and switch accounts. |
/mcp | Open MCP server management. |
/plugins | Open plugin settings. |
/skills | Browse skills and workflows. |
/compact | Compact the current working context to reduce context usage. |
/fork | Create and switch to a fork of the current session. Available after the session contains messages. |
/undo | Choose a previous checkpoint to restore. This can roll back file changes. |
/clear | Start a new session. |
/history | Browse and resume saved sessions. |
/team <prompt> | Ask a coordinating agent to handle the task with an agent team. Teams must be enabled and are unavailable in YOLO mode. |
/help | Show interactive help, including keyboard shortcuts. |
/quit | Exit Cline. |
Cline Keyboard Shortcuts
These shortcuts apply inside the TUI. Autocomplete menus and queued prompts take priority over some bindings. Open /help to check your installed version.
Modes, Input, and Approvals
| Shortcut | Action |
|---|---|
Tab | Toggle Plan/Act when no autocomplete menu or queued-prompt selection is active. |
Shift+Tab | Toggle auto-approve all tools when no autocomplete menu is active. |
Enter | Submit a prompt or accept the selected autocomplete entry. During a run, a new prompt is queued. |
Shift+Enter | Insert a newline. Ctrl+Enter and Alt+Enter also insert newlines when the terminal sends those keys. |
Ctrl+S | Send the text currently in the input as steering while an agent is running. |
Ctrl+P | Open the command palette while idle. In autocomplete, move to the previous suggestion. |
Opt+K | Open the built-in TUI help and shortcut reference on terminals that deliver this key combination. |
Up / Down | Navigate suggestions, input history, or queued prompts, depending on the active UI state. |
Tab in autocomplete | Accept the selected suggestion. |
Tab on a selected queued prompt | Edit that queued prompt. |
Enter on a selected queued prompt | Promote that prompt for immediate handling. |
Cancel, Restore, and Exit
| Shortcut | Action |
|---|---|
Esc | Close autocomplete or cancel queued-prompt editing. With the main input active during a run, abort the running turn. |
Esc twice | Open checkpoint restoration while idle, with no menu or queued-prompt selection active. Press twice quickly. |
Ctrl+C | Abort a running turn. When idle, clear the input or request exit; press again to exit. |
Ctrl+D | Exit while idle with an empty prompt. |
Ctrl+L | Start a new conversation while idle. During a run, clear the displayed transcript. |
Transcript Navigation
| Shortcut | Action |
|---|---|
Page Up / Page Down | Scroll the transcript by one page. |
Ctrl+Alt+B / Ctrl+Alt+F | Scroll up or down by one page. |
Ctrl+Alt+U / Ctrl+Alt+D | Scroll up or down by half a page. |
Ctrl+G | Jump to the first message. |
Ctrl+Alt+G | Jump to the last message. |
Cline CLI Flags
Basic syntax: cline [options] [command] [prompt]. Flag names are case-sensitive. Put task options before the quoted prompt, and check subcommand help before reusing a top-level option.
Execution Modes and Permissions
| Flag | Purpose |
|---|---|
-p, --plan | Start in Plan mode. Use it to investigate and plan before implementation. |
-i, --tui | Explicitly request the interactive terminal interface. |
--auto-approve <boolean> | Toggle approval of all tools without prompts. When off, safe tools can still be auto-approved. Default: true (ACP default: false). |
-y, --yolo | Run unattended with a limited tool set. Teams are unavailable in this mode. Use an isolated environment. |
-z, --zen | Send a task to the background hub and exit. Unattended execution. Cannot be used with --tui or --data-dir. |
--acp | Start the Agent Client Protocol interface for an editor or another ACP client. |
--worktree | Create a detached Git worktree under ~/.cline/worktrees/ and run the task there. Requires a Git repository. |
--kanban | Launch the Kanban app. Equivalent entry point: cline kanban. |
Provider, Model, and Reasoning
| Flag | Purpose |
|---|---|
-P, --provider <id> | Select the provider for a run. Default provider: cline. |
-m, --model <model-id> | Choose a model from the selected provider. |
-k, --key <api-key> | Supply a key for the run and save it as that provider’s key. |
--thinking <level> | Set reasoning effort: none, low, medium, high, or xhigh. Model support varies. |
--compaction <mode> | Choose agentic, basic, or off for context compaction. Default: agentic. |
-s, --system <system-prompt> | Replace the default system prompt. |
Workspace, State, and Session
| Flag | Purpose |
|---|---|
-c, --cwd <path> | Set the working directory. |
--id <session-id> | Load an existing session by ID. |
--config <path> | Choose the configuration root. Default: ~/.cline. |
--data-dir <path> | Use isolated local state (default ~/.cline/data) and enable sandbox mode. |
--hooks-dir <path> | Use an additional directory of runtime hooks. Global hooks live in ~/.cline/hooks. |
Output, Limits, Help, and Updates
| Flag | Purpose |
|---|---|
--json | For agent runs, emit newline-delimited JSON. Management commands can use different JSON structures. |
-v, --verbose | Show additional diagnostic output. |
-t, --timeout <seconds> | Stop a run after the specified positive number of seconds. With no timeout configured, there is no time limit. |
--retries <count> | Set the maximum consecutive mistakes before exiting. Default: 3. |
-h, --help | Show command help. |
-V, --version | Print the CLI version. cline version is another entry point. |
--update | Check for an update and install it when available. Also available as cline update. |
Sessions, Configuration, and Context
Session History
cline history opens a session picker in an interactive terminal. When output is redirected, it prints the session list. cline h is its alias. The default history limit is 50, newest first.
| Command | Action |
|---|---|
cline history --json --limit 10 | Print up to 10 recent sessions as a JSON array. |
cline history export <id> -o session.html | Export a saved session to a standalone HTML file. --output is the long form of -o. |
cline history delete --session-id <id> | Delete a saved session. |
cline history update --session-id <id> --title "TITLE" | Rename a saved session. The update command also accepts --prompt and --metadata <json>. |
Configuration Lookup
Run cline config to open the configuration view. For a printed result, name a target: workflows, rules, skills, agents, plugins, hooks, mcp, or tools. Add --json for structured output.
cline config rules
cline config tools --jsonConfiguration and Instruction Paths
| Path | Purpose |
|---|---|
~/.cline/data/settings/providers.json | Saved provider configuration and credentials. Keep this file private. |
~/.cline/data/settings/global-settings.json | Global application settings. |
~/.cline/data/settings/cline_mcp_settings.json | CLI MCP server configuration. |
~/.cline/data/sessions/ | Saved session messages. |
~/.cline/data/db/sessions.db | SQLite index of sessions. |
~/.cline/data/logs/cline.log | CLI runtime log. |
~/.cline/rules/ | Global instruction files. |
.cline/rules/ | Project instruction files. |
AGENTS.md | Project-root instructions Cline can read. |
.cline/skills/<name>/SKILL.md | A project skill’s instructions and metadata. |
.cline/workflows/ | Project workflows available through the command system. |
.cline/hooks/ | Project lifecycle hooks. |
.cline/plugins/ | Project plugins. |
.cline/agents/ | Project agent definitions. |
File and Image Context
| Syntax | Action |
|---|---|
@path/to/file | Mention a workspace file in the TUI prompt. Type @ to browse matching paths. |
@./screenshot.png | Attach an image in a task prompt. Use a model that accepts images. |
git diff | cline "TASK" | Pass diff text into a headless task through stdin. |
Environment Variables
| Variable | Meaning |
|---|---|
CLINE_DIR | Override the configuration root, normally ~/.cline. |
CLINE_DATA_DIR | Override the local state directory, normally ~/.cline/data. |
CLINE_MCP_SETTINGS_PATH | Override the CLI MCP settings file path. |
CLINE_HOOKS_DIR | Add a hooks directory. |
CLINE_LOG_PATH | Choose the CLI log file opened by cline doctor log. |
CLINE_HUB_PORT | Set the local hub port. Default: 25463. |
CLINE_HUB_ADDRESS | Set the hub address for scheduling commands. |
CLINE_SESSION_BACKEND_MODE | Force a session backend: local, hub, remote, or auto. |
CLINE_SANDBOX | Enable Cline’s sandbox mode. Do not assume this supplies OS-level filesystem isolation. |
CLINE_SANDBOX_DATA_DIR | Set the sandbox session storage directory. |
Advanced Cline Commands
MCP Servers
cline mcp opens a menu for adding, editing, enabling, disabling, authorizing, and deleting servers. These shell commands provide direct lookup and management:
| Command | Action |
|---|---|
cline config mcp | Print configured MCP servers. Add --json for structured output. |
cline mcp add <name> [url] | Add a server through a prefilled wizard. install is an alias for add. |
cline mcp remove <name> | Delete a server definition. uninstall is an alias for remove. |
For a local stdio server, put its executable and arguments after --. --yes saves the definition without the add wizard. The filesystem example grants access to the specified directory.
cline mcp add files --yes -- npx -y @modelcontextprotocol/server-filesystem /path/to/projectFor a hosted server, use its real endpoint and transport. Replace the example URL before running this command.
cline mcp add docs https://example.com/mcp --transport http --yesSkills and Plugins
| Command | Action |
|---|---|
cline skill add <owner/repo> | Install skills from a repository. |
cline skill list | List installed skills. |
cline skill remove | Open skill removal. |
cline plugin install <source> | Install from an npm package, Git repository, file URL, or local path. i is an alias for install. |
The following flags apply to cline plugin install:
| Plugin flag | Purpose |
|---|---|
--npm | Interpret the source as an npm package. |
--git | Interpret the source as a Git repository. |
--force | Replace an existing installation from the same source. |
--cwd <path> | Install into that project’s .cline/plugins/ directory. |
--json | Print the installation result as JSON. |
Hooks
Hooks run at agent lifecycle events. PreToolUse can reject a tool invocation before execution, including a run_commands call. Configure an appropriate hook when you need command restrictions.
| Command | Action |
|---|---|
cline config hooks | Inspect configured hooks. |
cline hook | Read and handle a hook payload from stdin. This is a hook execution entry point, not a hook creation wizard. |
Scheduled Tasks
cline schedule opens the schedule manager. Schedules run through the local hub, which starts automatically when needed. Cron times use your device’s local time zone. Scheduled runs approve their own tool calls because no interactive approver is present. To deliver results to a chat, keep the relevant connector running.
| Command | Action |
|---|---|
cline schedule create "NAME" [options] | Create a schedule. Requires --cron, --prompt, and --workspace. |
cline schedule list | List schedules. |
cline schedule get <id> | Show one schedule. |
cline schedule upcoming | Preview upcoming executions. |
cline schedule active | Show running executions. |
cline schedule trigger <id> | Run a schedule immediately. |
cline schedule pause <id> | Pause future executions. |
cline schedule resume <id> | Resume a paused schedule. |
cline schedule update <id> [options] | Change a schedule, such as its cron expression. |
cline schedule history <id> | Show execution history. |
cline schedule stats <id> | Show run statistics. |
cline schedule delete <id> | Delete a schedule. |
cline schedule export <id> --to <file> | Export a schedule to a file. |
cline schedule import <file> | Import a saved schedule. |
Schedule Creation Flags
| Schedule flag | Purpose |
|---|---|
--cron "EXPRESSION" | Required five-field cron expression. |
--prompt "TASK" | Required task instructions. |
--workspace <path> | Required working directory. |
--provider <id> / --model <id> | Choose the provider and model. Omitted values use the last-used selection. |
--mode <mode> | Choose act, plan, or yolo. Default: yolo. All scheduled modes approve their own tool calls. |
--timeout <seconds> | Limit each run’s duration. |
--max-parallel <n> | Limit simultaneous runs for this schedule. Default: 1. Due runs wait when busy. |
--system-prompt "TEXT" | Replace the system prompt for scheduled runs. |
--tags <list> | Attach comma-separated tags. |
--delivery-adapter <channel> | Send the run result to a connector, such as telegram. |
--delivery-thread <id> | Choose the destination chat or thread for delivery. |
--delivery-bot <name> | Select the bot when more than one is connected to the channel. |
--disabled | Create the schedule paused. |
--json | Print the created schedule as JSON. |
Hub and Background Sessions
The hub is a local daemon that coordinates background sessions and scheduled work. Running cline hub alone shows help.
| Command | Action |
|---|---|
cline hub status | Check whether the hub is running. |
cline hub ensure | Start the hub if needed and print its URL. start is an alias. |
cline hub stop | Stop the hub and its running sessions. |
cline hub drain | Refuse new work while accepted runs finish. Add --off to accept new work again. |
cline hub upgrade | Drain and restart the hub. This does not wait for Zen or scheduled tasks. |
cline hub dashboard | Open the session dashboard in a browser. The command stays running until interrupted. |
The dashboard defaults to 127.0.0.1:8787, a different port from the hub daemon. Dashboard access permits session control and hub restarts. Use --room-secret <secret> when binding to a nonlocal host.
| Dashboard flag | Purpose |
|---|---|
--host <host> | Choose the bind host. Default: 127.0.0.1. |
--port <port> | Choose the HTTP/WebSocket port. Default: 8787. |
--no-open | Print the URL without launching a browser. |
--room-secret <secret> | Set the invitation secret required for a nonlocal bind. |
--public-url <url> | Set the public URL for LAN or tunnel access. |
Connectors, ACP, and Kanban
Connector channels include telegram, slack, discord, gchat, whatsapp, and linear. Put --stop or --restart before the channel name. Options after the channel are passed to that connector.
| Command | Action |
|---|---|
cline connect | Open the connector setup wizard. |
cline connect <channel> --help | Show setup options for one channel. |
cline connect --stop <channel> | Stop one channel’s connector. Omit the channel to stop all connectors. |
cline connect --restart <channel> | Restart a connector. Supply the same options used at startup. |
cline --acp | Let an ACP client communicate with Cline over stdin/stdout. Configure the editor to launch this command. |
cline kanban | Open the Kanban app for task-board workflows. |
Cline CLI Examples
Plan a Change with Approval Control
Open the interactive TUI in Plan mode with global tool auto-approval off. Inspect the plan, then use Tab to switch to Act when you are ready.
cline -i -p --auto-approve false "Plan pagination for the existing API. Identify affected routes and tests."Continue a Saved Task
Find the session ID, then pass it back with a follow-up prompt. Replace SESSION_ID before running the second command.
cline history --json --limit 5
cline --id SESSION_ID "Continue with the tests from the approved plan."Review a Git Diff
Run this from the repository. Piped stdin activates headless mode. The prompt requests a review without edits, but that instruction is not an enforced filesystem restriction.
git diff | cline -p "Review this diff for regressions. Report file paths, issues, and suggested tests. Do not modify files."Extract the Final Answer from JSON
For Bash/zsh with jq installed, filter for the final run_result object. Do not parse every event as a completed answer.
cline --json "Summarize the setup steps in README.md" | jq -r 'select(.type == "run_result") | .text'PowerShell equivalent:
cline --json "Summarize the setup steps in README.md" |
ForEach-Object { $_ | ConvertFrom-Json } |
Where-Object { $_.type -eq "run_result" } |
Select-Object -ExpandProperty textRun a Bounded Automation Task
This headless task can edit files and execute commands without approval prompts. The timeout limits its duration, while --retries limits consecutive mistakes.
cline --json --auto-approve true --timeout 600 --retries 3 "Run the project tests and fix failing tests. Summarize the changes."Create a Weekday Schedule
This single-line command creates a paused schedule for 9 a.m. on weekdays in the machine’s local time zone. Replace the workspace path. Review it before resuming it with cline schedule resume <id>.
cline schedule create "Project summary" --cron "0 9 * * MON-FRI" --prompt "Summarize open work and recent commits. Do not edit files." --workspace "/path/to/project" --mode plan --disabledJSON Output Reference
Agent runs with --json emit one object per line, with a type and timestamp ts. cline history --json emits a session array, and cline config <target> --json emits that target’s entries.
| JSON type | Meaning |
|---|---|
agent_event | An agent event in event, such as content, usage, completion, or an error. |
hook_event | A lifecycle hook event. |
team_event | An agent-team event in event. |
run_result | Final result with text, finishReason, usage, model, iterations, and duration. An interrupted run can have finishReason: "aborted". |
run_aborted | An interruption notice following the final result. |
Troubleshooting
| Command | Action |
|---|---|
cline doctor | Diagnose configuration problems. |
cline doctor log | Open the CLI runtime log, including a custom CLINE_LOG_PATH. |
cline doctor fix | Kill all running Cline processes. Save or stop active work before using it. |
A Command or Shortcut Is Missing
Check cline --version and cline <command> --help. Use /help in the TUI for its shortcuts. The official Cline CLI reference is the reference for current command syntax. Run cline update when your installation needs an update.
Cline Is Not Asking Before Acting
Launch with --auto-approve false to disable approval of every tool without prompting. Safe tools can still be auto-approved. Check tool settings in /settings, or use Shift+Tab to toggle all-tool auto-approval in the TUI. Scheduled runs approve their own calls, while ACP sessions start with all-tool auto-approval off unless explicitly enabled.
The Interactive UI Disappears in a Script
Piped stdin, redirected output, and --json activate headless behavior. Run cline directly in an interactive terminal for the TUI. Keep JSON parsing specific to the command’s output shape.
Authentication or Model Selection Fails
Run cline auth to check the saved provider and model. Confirm that the model ID belongs to the selected provider and that the account has access. Top-level provider selection uses -P, while cline auth uses -p. Inspect the runtime log for the actual provider error.










