Cline CLI Cheat Sheet: Commands, Flags & Shortcuts

Cline CLI quick reference for shell commands, slash commands, keyboard shortcuts, model options, sessions, MCP servers, scheduling, and headless automation.

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

CommandAction
clineOpen 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 falseTurn 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 authConfigure a model provider and credentials.
cline historyBrowse saved sessions.
cline configOpen configuration settings.
cline mcpManage MCP servers.
cline doctorDiagnose CLI problems.
cline updateCheck for and install updates.
cline --versionCheck the installed CLI version.
cline --helpShow top-level commands and options.
cline <command> --helpShow options for a particular command.

Cline TUI Slash Commands

Type / in an interactive session to browse commands.

Slash commandAction
/settingsOpen agent configuration. /config is an accepted alias.
/modelChoose a model or provider and adjust the model’s reasoning setting.
/themeChange the terminal color theme.
/accountView your Cline account and switch accounts.
/mcpOpen MCP server management.
/pluginsOpen plugin settings.
/skillsBrowse skills and workflows.
/compactCompact the current working context to reduce context usage.
/forkCreate and switch to a fork of the current session. Available after the session contains messages.
/undoChoose a previous checkpoint to restore. This can roll back file changes.
/clearStart a new session.
/historyBrowse 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.
/helpShow interactive help, including keyboard shortcuts.
/quitExit 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

ShortcutAction
TabToggle Plan/Act when no autocomplete menu or queued-prompt selection is active.
Shift+TabToggle auto-approve all tools when no autocomplete menu is active.
EnterSubmit a prompt or accept the selected autocomplete entry. During a run, a new prompt is queued.
Shift+EnterInsert a newline. Ctrl+Enter and Alt+Enter also insert newlines when the terminal sends those keys.
Ctrl+SSend the text currently in the input as steering while an agent is running.
Ctrl+POpen the command palette while idle. In autocomplete, move to the previous suggestion.
Opt+KOpen the built-in TUI help and shortcut reference on terminals that deliver this key combination.
Up / DownNavigate suggestions, input history, or queued prompts, depending on the active UI state.
Tab in autocompleteAccept the selected suggestion.
Tab on a selected queued promptEdit that queued prompt.
Enter on a selected queued promptPromote that prompt for immediate handling.

Cancel, Restore, and Exit

ShortcutAction
EscClose autocomplete or cancel queued-prompt editing. With the main input active during a run, abort the running turn.
Esc twiceOpen checkpoint restoration while idle, with no menu or queued-prompt selection active. Press twice quickly.
Ctrl+CAbort a running turn. When idle, clear the input or request exit; press again to exit.
Ctrl+DExit while idle with an empty prompt.
Ctrl+LStart a new conversation while idle. During a run, clear the displayed transcript.

Transcript Navigation

ShortcutAction
Page Up / Page DownScroll the transcript by one page.
Ctrl+Alt+B / Ctrl+Alt+FScroll up or down by one page.
Ctrl+Alt+U / Ctrl+Alt+DScroll up or down by half a page.
Ctrl+GJump to the first message.
Ctrl+Alt+GJump 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

FlagPurpose
-p, --planStart in Plan mode. Use it to investigate and plan before implementation.
-i, --tuiExplicitly 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, --yoloRun unattended with a limited tool set. Teams are unavailable in this mode. Use an isolated environment.
-z, --zenSend a task to the background hub and exit. Unattended execution. Cannot be used with --tui or --data-dir.
--acpStart the Agent Client Protocol interface for an editor or another ACP client.
--worktreeCreate a detached Git worktree under ~/.cline/worktrees/ and run the task there. Requires a Git repository.
--kanbanLaunch the Kanban app. Equivalent entry point: cline kanban.

Provider, Model, and Reasoning

FlagPurpose
-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

FlagPurpose
-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

FlagPurpose
--jsonFor agent runs, emit newline-delimited JSON. Management commands can use different JSON structures.
-v, --verboseShow 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, --helpShow command help.
-V, --versionPrint the CLI version. cline version is another entry point.
--updateCheck 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.

CommandAction
cline history --json --limit 10Print up to 10 recent sessions as a JSON array.
cline history export <id> -o session.htmlExport 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 --json

Configuration and Instruction Paths

PathPurpose
~/.cline/data/settings/providers.jsonSaved provider configuration and credentials. Keep this file private.
~/.cline/data/settings/global-settings.jsonGlobal application settings.
~/.cline/data/settings/cline_mcp_settings.jsonCLI MCP server configuration.
~/.cline/data/sessions/Saved session messages.
~/.cline/data/db/sessions.dbSQLite index of sessions.
~/.cline/data/logs/cline.logCLI runtime log.
~/.cline/rules/Global instruction files.
.cline/rules/Project instruction files.
AGENTS.mdProject-root instructions Cline can read.
.cline/skills/<name>/SKILL.mdA 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

SyntaxAction
@path/to/fileMention a workspace file in the TUI prompt. Type @ to browse matching paths.
@./screenshot.pngAttach 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

VariableMeaning
CLINE_DIROverride the configuration root, normally ~/.cline.
CLINE_DATA_DIROverride the local state directory, normally ~/.cline/data.
CLINE_MCP_SETTINGS_PATHOverride the CLI MCP settings file path.
CLINE_HOOKS_DIRAdd a hooks directory.
CLINE_LOG_PATHChoose the CLI log file opened by cline doctor log.
CLINE_HUB_PORTSet the local hub port. Default: 25463.
CLINE_HUB_ADDRESSSet the hub address for scheduling commands.
CLINE_SESSION_BACKEND_MODEForce a session backend: local, hub, remote, or auto.
CLINE_SANDBOXEnable Cline’s sandbox mode. Do not assume this supplies OS-level filesystem isolation.
CLINE_SANDBOX_DATA_DIRSet 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:

CommandAction
cline config mcpPrint 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/project

For 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 --yes

Skills and Plugins

CommandAction
cline skill add <owner/repo>Install skills from a repository.
cline skill listList installed skills.
cline skill removeOpen 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 flagPurpose
--npmInterpret the source as an npm package.
--gitInterpret the source as a Git repository.
--forceReplace an existing installation from the same source.
--cwd <path>Install into that project’s .cline/plugins/ directory.
--jsonPrint 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.

CommandAction
cline config hooksInspect configured hooks.
cline hookRead 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.

CommandAction
cline schedule create "NAME" [options]Create a schedule. Requires --cron, --prompt, and --workspace.
cline schedule listList schedules.
cline schedule get <id>Show one schedule.
cline schedule upcomingPreview upcoming executions.
cline schedule activeShow 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 flagPurpose
--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.
--disabledCreate the schedule paused.
--jsonPrint 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.

CommandAction
cline hub statusCheck whether the hub is running.
cline hub ensureStart the hub if needed and print its URL. start is an alias.
cline hub stopStop the hub and its running sessions.
cline hub drainRefuse new work while accepted runs finish. Add --off to accept new work again.
cline hub upgradeDrain and restart the hub. This does not wait for Zen or scheduled tasks.
cline hub dashboardOpen 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 flagPurpose
--host <host>Choose the bind host. Default: 127.0.0.1.
--port <port>Choose the HTTP/WebSocket port. Default: 8787.
--no-openPrint 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.

CommandAction
cline connectOpen the connector setup wizard.
cline connect <channel> --helpShow 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 --acpLet an ACP client communicate with Cline over stdin/stdout. Configure the editor to launch this command.
cline kanbanOpen 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 text

Run 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 --disabled

JSON 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 typeMeaning
agent_eventAn agent event in event, such as content, usage, completion, or an error.
hook_eventA lifecycle hook event.
team_eventAn agent-team event in event.
run_resultFinal result with text, finishReason, usage, model, iterations, and duration. An interrupted run can have finishReason: "aborted".
run_abortedAn interruption notice following the final result.

Troubleshooting

CommandAction
cline doctorDiagnose configuration problems.
cline doctor logOpen the CLI runtime log, including a custom CLINE_LOG_PATH.
cline doctor fixKill 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.

Official Sources

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest & top AI tools sent directly to your email.

Subscribe now to explore the latest & top AI tools and resources, all in one convenient newsletter. No spam, we promise!