Using Cline CLI
Use this skill to run Cline effectively from the CLI, keep commands safe under sandboxing, and pick inference providers/models.
Core Concepts
- •Roles: System/dev instructions set guardrails; user asks; you execute within sandboxed shell unless approved otherwise.
- •Sandbox: Default
workspace-write; writing outside writable roots or network installs needs approval (escalated run). - •Approvals: Destructive ops (
rm -rf,git reset --hard), networked installs, GUI apps, or writes outside roots requiresandbox_permissions: require_escalated+ short justification in tool call. - •Tools:
Executeruns shell commands; keepworkdirexplicit; preferrgfor search; avoidcdchains—setworkdirinstead. - •Memory/Context: Keep responses concise; reference paths with backticks; no raw URLs unless asked; cite sources when web-searching.
Quick Commands
- •List files:
ls,ls -la. - •Search text fast:
rg pattern path. - •View file:
sed -n '1,160p' file. - •Edit file: use
apply_patchfor targeted edits; avoid for autogenerated files. - •Run tests/linters:
npm test,pytest, etc.—ensure workdir set; mention if sandbox blocks writes.
Provider / Model Selection
- •Prefer repository or skill-specified model; fall back to default if unavailable.
- •If switching providers (e.g., OpenAI ↔ Anthropic ↔ local), note token/env var needs; avoid changing unless requested.
- •Be explicit when using non-default model; mention trade-offs (speed vs. quality) briefly.
Working with Tabs and Files
- •Respect active/open tabs context; address the active file first when relevant.
- •Reference files as
path:line(no ranges, no URIs). - •Don’t dump large files; show relevant slices.
Safety Rules
- •Never run destructive git commands unless explicitly asked.
- •Do not revert user changes you didn’t make.
- •For commands that fail due to sandbox, retry with approval parameters instead of asking first.
- •No network installs unless required and approved.
Common Workflows
Edit flow
- •Inspect file (
sed -n), 2) Plan change (brief), 3)apply_patch, 4) Re-open snippet to verify.
Search flow
- •
rg 'pattern' src/, 2) narrow withrg -n, 3) edit.
Run/check flow
- •
npm test/pytestwithworkdirset, 2) summarize failures, 3) propose fixes.
Troubleshooting
- •Command not found: ensure correct shell, check PATH; if missing tool, note and propose install (needs approval).
- •Permission denied / sandbox: rerun with
sandbox_permissions: require_escalated+ justification; keep scope minimal. - •Large outputs: truncate (
| head -n 200); summarize rather than paste. - •Model mismatch: if instructions require a model not available, state fallback used.
Agent Etiquette
- •Be concise; avoid redundant summaries.
- •Suggest next steps only when natural (tests, commits).
- •Keep citations outside code fences; cite up-to-date info when web searching.