opencode-cline-mode
v2.1.0
Published
Cline-style plan and act workflow for OpenCode - dynamically fetches latest prompts from Cline's official repository with smart caching and automatic tool name mapping
Maintainers
Readme
opencode-cline-mode
Cline-style plan and act workflow for OpenCode
A plugin for OpenCode that brings Cline-style structured workflow to your AI coding sessions. Separate planning from execution for more controlled and predictable development.
✨ Features
- 🎯 Plan Mode - Analyze and create detailed implementation plans without making changes
- ⚡ Act Mode - Execute approved plans step by step with progress tracking
- 🔗 Automatic Plan Inheritance - Plans are automatically passed from plan mode to act mode (no copy-paste needed!)
- 🔄 Clean Agent List - Only shows
cline-planandcline-act, removes default agents - 📝 Structured Output - Clear, actionable plans with risk assessment and verification steps
- 🚀 Quick Execute Command - Type
/start-actto quickly switch from plan to act mode - 🌐 Dynamic Cline Integration - Fetch latest prompts from Cline's official repository (NEW in v2.0!)
- 💾 Smart Caching - Cache prompts locally to reduce network requests (NEW in v2.0!)
- 🔧 Flexible Configuration - Choose between local, GitHub, or auto mode (NEW in v2.0!)
- 🎨 Zero Config - Works out of the box with sensible defaults
🔒 Permission Control
cline-plan (Read-Only):
- ✅ Read files
- ✅ Search codebase
- ❌ Edit files (denied)
- ❌ Execute bash commands (denied)
cline-act (Full Access):
- ✅ Edit files (allowed)
- ⚠️ Execute bash commands (asks for permission)
- ✅ All other tools
Note: When replace_default_agents: true (default), OpenCode's default agents (plan, build, etc.) are completely removed from the agent list. You will only see cline-plan and cline-act agents. This ensures a focused Cline-style workflow without any confusion.
This ensures you can safely plan without accidentally modifying code.
📦 Installation
From npm (Recommended)
npm install -g opencode-cline-modeThen add to your OpenCode config:
{
"plugin": ["opencode-cline-mode"]
}From local files
Clone this repository and symlink to your OpenCode plugins directory:
git clone https://github.com/trry-hub/opencode-cline-mode.git
ln -s $(pwd)/opencode-cline-mode ~/.config/opencode/plugins/opencode-cline-modeImportant: When using local installation via symlink, do NOT add "opencode-cline-mode" to the plugin array in opencode.json. OpenCode automatically loads plugins from the ~/.config/opencode/plugins/ directory.
❌ Wrong (will cause installation error):
{
"plugin": ["opencode-cline-mode"]
}✅ Correct (no plugin array entry needed):
{
"plugin": []
}The plugin will be loaded automatically from the symlink.
🚀 Usage
This plugin registers two independent agents in OpenCode:
1. cline-plan Agent - Planning Mode
Start a new session with the plan agent:
opencode --agent cline-planOr switch to it in TUI by pressing Tab and selecting cline-plan.
In plan mode, the AI will:
- ✅ Analyze your codebase
- ✅ Create detailed step-by-step plans
- ✅ Assess risks and suggest alternatives
- ❌ NOT make any code changes
- ❌ NOT execute any commands
2. cline-act Agent - Execution Mode
Start a new session with the act agent:
opencode --agent cline-actOr switch to it in TUI by pressing Tab and selecting cline-act.
In act mode, the AI will:
- ✅ Execute plans step by step
- ✅ Make code changes as specified
- ✅ Run verification commands
- ✅ Report progress after each step
- ⚠️ Stop and ask for guidance on errors
Switching Between Agents
In the OpenCode TUI:
- Press
Tabto see available agents - You will only see:
cline-plan- Planning modecline-act- Execution mode
- Select the agent you want to use
- New in v1.2.0: When switching from
cline-plantocline-act, your plan is automatically inherited - no need to copy and paste!
Plan Approval Workflow
When enable_plan_approval is enabled (default), plans must be approved before execution:
- Create a plan using
cline-planagent - Review the plan
- Approve it:
/approve-plan - Execute it:
/start-act
Available commands:
/approve-plan- Approve the current plan/reject-plan- Reject the current plan with optional reason/start-act- Switch to execution mode (requires approval if enabled)
To disable approval workflow:
{
"enable_plan_approval": false
}Typical Workflow
Start with Planning (
cline-plan):- Describe what you want to build
- Review the detailed plan created by the AI
- Approve or request modifications
Switch to Execution (
cline-act):- Press
Taband selectcline-act - The plan is automatically passed to the execution agent
- Watch as the AI implements the plan step by step
- Approve each change or provide feedback
- Press
Note: This plugin completely replaces OpenCode's default agents (plan, build, etc.) to provide a focused Cline-style workflow. The default agents are removed from the agent list, ensuring only cline-plan and cline-act are available. If you want to use default agents alongside Cline agents, see Configuration below.
⚙️ Configuration
Optional Configuration File
Create ~/.config/opencode/opencode-cline-mode.json or .opencode/opencode-cline-mode.json in your project:
{
"replace_default_agents": true,
"default_agent": "cline-plan",
"plan_model": null,
"act_model": null
}Configuration Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| replace_default_agents | boolean | true | If true, removes OpenCode's default agents. If false, adds Cline agents alongside defaults. |
| default_agent | string | "cline-plan" | Which agent to use by default ("cline-plan" or "cline-act") |
| plan_model | string | null | Model for cline-plan agent. If null, uses default model from opencode.json |
| act_model | string | null | Model for cline-act agent. If null, uses default model from opencode.json |
| plan_temperature | number | 0.1 | Temperature for plan mode (lower = more focused, 0-1) |
| act_temperature | number | 0.3 | Temperature for act mode (0-1) |
| show_completion_toast | boolean | true | Show toast notification when plan is complete |
| enable_execute_command | boolean | true | Enable /start-act command for quick switching from plan to act mode |
| enable_plan_approval | boolean | true | Enable plan approval workflow. Plans must be approved using /approve-plan before execution |
| prompt_source | string | "auto" | Prompt source: "local" (use local files), "github" (fetch from Cline repo), "auto" (cache → github → local) |
| cline_version | string | "latest" | Cline version to use: "latest" or specific version/branch (e.g., "main", "v1.2.3") |
| cache_ttl | number | 24 | Cache time-to-live in hours |
| fallback_to_local | boolean | true | Fallback to local prompts if GitHub fetch fails |
Example: Keep Default Agents
If you want to use Cline agents alongside OpenCode's default agents:
{
"replace_default_agents": false
}Then you'll see all agents when pressing Tab:
cline-plancline-actplan(OpenCode default)build(OpenCode default)- etc.
Example: Use Different Models
{
"replace_default_agents": true,
"plan_model": "anthropic/claude-opus-4",
"act_model": "anthropic/claude-sonnet-4"
}Example: Use Latest Cline Prompts from GitHub
{
"prompt_source": "github",
"cline_version": "latest",
"cache_ttl": 24,
"fallback_to_local": true
}This will:
- Fetch the latest prompts from Cline's GitHub repository
- Cache them for 24 hours
- Automatically fall back to local prompts if GitHub is unavailable
Example: Use Specific Cline Version
{
"prompt_source": "github",
"cline_version": "main",
"cache_ttl": 168
}This will use prompts from Cline's main branch and cache for 7 days (168 hours).
Example: Always Use Local Prompts
{
"prompt_source": "local"
}This disables GitHub fetching and always uses the local prompt files.
🌐 Prompt Source Modes
The plugin supports three prompt source modes:
local- Always use local prompt files (fastest, no network required)github- Always fetch from Cline's GitHub repository (always up-to-date)auto(default) - Smart mode: cache → github → local- First checks cache
- If cache expired, fetches from GitHub
- If GitHub fails, falls back to local
Recommendation: Use auto mode for the best balance of performance and freshness.
🚀 Quick Execute Command
After planning is complete, you'll see a prompt with options:
📋 Plan Complete!
✅ Quick Execute: Use /start-act tool to switch to cline-act
✏️ Modify: Tell me which step to change
❌ Cancel: Type "cancel" to abort
Important: Use the /start-act tool (not a command) by:
- Typing
/start-actin chat - Or pressing Tab and typing
/start-act
Example: Disable Quick Command
If you prefer not to have the /start-act command:
{
"enable_execute_command": false
}📖 Example Workflow
# 1. Start with planning (default mode)
opencode
# Describe your feature:
# "Add soft delete functionality to the notes system"
# AI creates a detailed plan with:
# - Impact scope (files to modify/create)
# - Step-by-step implementation
# - Risk assessment
# - Verification steps
# 2. Review the plan, ask questions, iterate
# "Can you also add a trash view to show deleted notes?"
# 3. Once satisfied, switch to act mode
# Press Tab, select cline-act
# 4. Execute the plan
# AI executes step by step:
# ✅ Step 1/8: Update Note Model
# ✅ Step 2/8: Create Database Migration
# ✅ Step 3/8: Modify Delete API
# ...🎨 Plan Mode Output Format
Plans include:
- 📊 Overview - What will be done and why
- 📁 Impact Scope - Files modified/created/deleted
- 📝 Detailed Plan - Step-by-step implementation
- ⚠️ Risk Warnings - Potential issues and mitigation
- 🔄 Alternative Approaches - Different implementation options
⚡ Act Mode Execution
Execution includes:
- Progress Tracking - Clear indication of current step
- Verification - Automatic verification after each step
- Error Handling - Stops on errors with suggested solutions
- Rollback Support - Can undo changes if needed
🔧 Development
Prerequisites
- Node.js >= 18.0.0
- npm >= 9.0.0
Setup
git clone https://github.com/trry-hub/opencode-cline-mode.git
cd opencode-cline-mode
npm installBuild
npm run buildTest
npm test # Run tests
npm run test:watch # Watch mode
npm run test:coverage # With coverageProject Structure
opencode-cline-mode/
├── src/
│ ├── index.ts # Main plugin entry
│ ├── types.ts # TypeScript definitions
│ ├── logger.ts # Unified logging
│ ├── config-validator.ts # Config validation
│ ├── config-loader.ts # Config loading
│ ├── path-resolver.ts # Path resolution
│ ├── agent-builder.ts # Agent configuration
│ └── message-transformer.ts # Message processing
├── prompts/
│ ├── plan.md # Plan mode prompt
│ └── act.md # Act mode prompt
├── dist/ # Compiled output
├── docs/ # Documentation
└── package.json🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📄 License
MIT © trry
🙏 Acknowledgments
📚 Documentation
For detailed information, please visit:
📚 Related Projects
- OpenCode - The open source AI coding agent
- oh-my-opencode - Advanced OpenCode plugin harness
- awesome-opencode - Curated list of OpenCode resources
🐛 Issues
Found a bug? Have a feature request? Please open an issue.
📮 Contact
- GitHub: @trry
- Issues: GitHub Issues
Made with ❤️ for the OpenCode community
