Skip to content

Appendix E: Cline Quick Reference

This appendix serves as a quick-reference manual for Cline, a community-driven fork of Aider that offers bleeding-edge features and faster iteration. Cline (aka cecli) is an experimental alternative for users who want the latest capabilities.

When to use Cline: - You want bleeding-edge features not yet in mainline Aider - You need autonomous agent mode for more complex tasks - You're comfortable with less battle-tested software - You want to experiment with the latest AI assistant capabilities


1. Installation & Setup

1.1 Install Cline (cecli)

# Install via pip (recommended)
pip install cecli-dev

# Or from source (for latest features)
git clone https://github.com/opencode-ai/cecli
cd cecli
pip install -e .

# Verify installation
cecli --version

# Upgrade to latest version
pip install --upgrade cecli-dev

1.2 Environment Configuration

Cline uses the same environment variables as Aider:

# Create your .env file
cp .env.example .env

# Add your API keys
# DEEPSEEK_API_KEY=sk-...
# QWEN_API_KEY=sk-...
# OPENAI_API_KEY=sk-...

1.3 Configuration File

Create .cecli.yml in your repository root:

# .cecli.yml - Cline Configuration

# Tier 2: Default Editor
model: qwen-2.5-coder

# Tier 1: Architect
architect-model: deepseek-chat

# Agent Mode (Cline-specific feature)
agent:
  enabled: true
  max_steps: 10
  auto_approve: false

# Context Files
context:
  files:
    - AGENTS.md
    - AI_CONTEXT.md
    - README.md

# Git Workflow
git:
  auto_commit: true
  commit_prompt: true

# Validation
validation:
  command: make validate
  auto_fix: true

# RAG (Cline-specific feature)
rag:
  enabled: true
  index_path: .rag_index

2. Core Commands

Cline is designed to be a drop-in replacement for Aider with additional features:

Basic Commands

# Start a session (identical to Aider)
cecli docs/03-iac-using-ai.md

# With context files
cecli --read AGENTS.md --read AI_CONTEXT.md docs/03-iac-using-ai.md

# Specific model
cecli --model deepseek-chat docs/03-iac-using-ai.md

# Agent mode (Cline-specific)
cecli --agent --message "Improve this chapter" docs/03-iac-using-ai.md

Interactive Commands

Command Description
/help Show all commands
/add <file> Add file to session
/read <file> Read file (read-only)
/drop <file> Remove file
/commit Commit changes
/undo Revert last change
/diff Show changes
/model <name> Switch model
/agent Toggle agent mode
/explore Start autonomous exploration (agent mode)
/run <command> Run shell command
/exit Exit session

3. Key Features (Cline vs. Aider)

Feature Aider Cline (cecli)
Agent Mode ✅ Semi-autonomous exploration and execution
RAG Context Discovery ✅ Finds relevant files automatically
Enhanced Repo Map Good Excellent (more accurate AST analysis)
TUI Improvements Standard Enhanced (better UX, colors, formatting)
Faster Updates Slower (core developer bottleneck) Faster (community-driven)
Stability Very stable Less battle-tested
Edit Formats 10+ strategies Includes all Aider formats + experimental ones

4. The 3-Tier Strategy in Cline

Tier Selection Guide

Tier Model Command Use Case
Tier 1: Architect deepseek-chat cecli --model deepseek-chat Complex reasoning, structural reviews
Tier 2: Editor qwen-2.5-coder cecli --model qwen-2.5-coder Default: editing (80% of tasks)
Tier 3: Sovereign ollama/qwen2.5-coder cecli --model ollama/qwen2.5-coder NV1/Government, sensitive data

How to Switch Tiers

# Start with Tier 2 Editor (default)
cecli docs/03-iac-using-ai.md

# Switch to Tier 1 Architect
/model deepseek-chat

# Start directly with Sovereign
cecli --model ollama/qwen2.5-coder docs/03-iac-using-ai.md

5. Common Workflows

5.1 Improving a Chapter (Tier 2 Editor)

# Using the Makefile
make improve-chapter-cecli CHAPTER=03

# Or manually
cecli --model qwen-2.5-coder \
  --read AGENTS.md \
  --read AI_CONTEXT.md \
  --message "Improve this chapter following AGENTS.md rules." \
  docs/03-iac-using-ai.md

5.2 Agent Mode Exploration

# Let Cline explore and improve autonomously
cecli --agent \
  --message "Explore this repository and identify opportunities for improvement." \
  docs/

# With explicit boundaries
cecli --agent \
  --max-steps 5 \
  --message "Improve documentation readability." \
  docs/

5.3 RAG Context Discovery

# Build RAG index first
cecli --rag-build

# Then run with RAG context
cecli --rag-enable --message "Improve this chapter" docs/03-iac-using-ai.md

6. Cline vs. Aider Decision Matrix

If you need... Use... Reason
Maximum stability Aider Battle-tested, 35 months of development
Bleeding-edge features Cline Faster iteration, community-driven
Autonomous agent mode Cline Aider doesn't have this
RAG context discovery Cline Aider doesn't have this
Production-critical workflows Aider More stable, better tested
Experimentation Cline New features, rapid iteration
Model compatibility Aider 100+ models via LiteLLM
Performance/startup OpenCode Rust-native, minimal overhead

7. Troubleshooting

Issue Solution
"Command not found" Reinstall: pip install --upgrade cecli-dev
"API key missing" Set environment variables
Agent mode stuck Reduce max_steps or disable auto-approve
RAG index outdated Rebuild: cecli --rag-build
Git conflict Commit or stash changes before session

8. Integration with Makefile

Add these targets to your Makefile:

# ==================== Cline Workflows ====================
improve-chapter-cecli:
    @echo "🔄 Improving chapter with Cline..."
    @cecli --model qwen-2.5-coder \
        --read AGENTS.md \
        --read AI_CONTEXT.md \
        --message "Improve this chapter following AGENTS.md rules." \
        docs/$(CHAPTER).md

agent-improve:
    @echo "🤖 Agent mode improving $*..."
    @cecli --agent --max-steps 5 \
        --message "Improve $* following guidelines." \
        $(TARGET)

rag-improve:
    @echo "🔍 RAG-enabled improvement..."
    @cecli --rag-enable \
        --model qwen-2.5-coder \
        --message "Improve this using RAG context." \
        $(TARGET)

# ==================== Switch Tool ====================
# To switch between Aider, Cline, and OpenCode:
# The Make abstraction makes this seamless.
# Just update the AI_TOOL variable below.

AI_TOOL ?= aider  # Options: aider, cecli, opencode
AI_MODEL ?= qwen-2.5-coder

improve-tool:
    @echo "🔄 Improving with $(AI_TOOL)..."
    @$(AI_TOOL) --model $(AI_MODEL) \
        --read AGENTS.md \
        --read AI_CONTEXT.md \
        --message "Improve this following guidelines." \
        $(TARGET)