AgentSkillsCN

using-cline-cli

安全操作Cline CLI:掌握核心概念、沙箱规则、提供商与模型的选择、审批流程以及常见工作流。

SKILL.md
--- frontmatter
name: using-cline-cli
description: "Operate Cline CLI safely: core concepts, sandbox rules, provider/model selection, approvals, and common workflows"
when_to_use: when setting up or driving Cline from the CLI, switching models/providers, handling sandbox/approvals, or troubleshooting blocked commands
version: 1.0.0
allowed-tools: [Read, Write, Execute, Search]
compatibility:
  runtimes: [Codex CLI]
  notes: assumes workspace-write sandbox; approvals required for escalated commands or network installs

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 require sandbox_permissions: require_escalated + short justification in tool call.
  • Tools: Execute runs shell commands; keep workdir explicit; prefer rg for search; avoid cd chains—set workdir instead.
  • 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_patch for 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

  1. Inspect file (sed -n), 2) Plan change (brief), 3) apply_patch, 4) Re-open snippet to verify.

Search flow

  1. rg 'pattern' src/, 2) narrow with rg -n, 3) edit.

Run/check flow

  1. npm test / pytest with workdir set, 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.