Cline-style plan and act workflow for OpenCode - Now with official Cline prompts!
A plugin for OpenCode that brings authentic Cline experience to your AI coding sessions by dynamically fetching prompts from the official Cline repository. Separate planning from execution for more controlled and predictable development.
- π― Official Cline Prompts - Dynamically fetches the latest prompts from cline/cline repository
- π¦ Plan Mode - Analyze and create detailed implementation plans without making changes (pure read-only)
- β‘ Act Mode - Execute approved plans step by step with progress tracking
- π Automatic Tool Mapping - Seamlessly converts Cline tool names to OpenCode equivalents
- π‘οΈ Smart Adaptation - Removes unsupported features and provides alternatives
- π Zero Config - Works out of the box with sensible defaults
- π Strict Permission Control - Plan mode is truly read-only
- π― Full Official Prompts: Now includes
system-prompt/index.tsfor complete official Cline prompt structure - π Improved Plan Accuracy: Removed custom mode intros to let official Cline planning methodology work exactly as intended
- π§ Minimal Overrides: Only adds OpenCode integration notes without overriding official prompt logic
- β Native Experience: Plan mode now matches native Cline behavior exactly
- π― YOLO Mode: Auto-approve plans and automatically switch to ACT MODE
- π Enhanced Plan Mode: Added
needs_more_explorationparameter for iterative planning - π§ Better Tool Mapping: Fixed ask_followup_question mapping and improved tool organization
- π State Management: Session-based state tracking for better workflow control
- π Simplified Workflow: Removed plan approval mechanism - switch directly from plan to act mode
- π Native Cline Behavior: No longer requires
/approve-plan- just switch agents - π§Ή Code Cleanup: Removed unused plan status management
- Dynamic Prompt Fetching: Automatically fetches the latest prompts from Cline's official GitHub repository on startup
- Tool Name Mapping: Intelligent conversion of Cline tool names (e.g.,
read_fileβread) - MCP Removal: Automatically removes MCP-related content not supported by OpenCode
- Alternative Suggestions: Provides OpenCode alternatives for unsupported Cline features
- Startup Validation: Ensures prompts are fetched successfully before plugin initialization
npm install -g opencode-cline-modeThen add to your OpenCode config (~/.config/opencode/opencode.json):
{
"plugin": ["opencode-cline-mode"]
}Clone this repository and symlink to your OpenCode plugins directory:
git clone https://github.com/trry-hub/opencode-cline-mode.git
cd opencode-cline-mode
npm install
npm run build
ln -s $(pwd) ~/.config/opencode/plugins/opencode-cline-modeImportant: When using local installation via symlink, do NOT add "opencode-cline-mode" to the plugin array.
This plugin registers two independent agents in OpenCode:
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
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
-
Start with Planning (
cline-plan):- Describe what you want to build
- Review the detailed plan created by the AI
- Ask for modifications if needed
-
Switch to Execution (
cline-act):- Press
Taband selectcline-act - The AI implements the plan step by step
- Watch as changes are made to your codebase
- Press
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,
"plan_temperature": 0.1,
"act_temperature": 0.3,
"enable_execute_command": true,
"yolo_mode": false,
"enable_task_progress": false
}| Option | Type | Default | Description |
|---|---|---|---|
replace_default_agents |
boolean | true |
If true, removes OpenCode's default agents |
default_agent |
string | "cline-plan" |
Which agent to use by default |
plan_model |
string | null |
Model for cline-plan agent |
act_model |
string | null |
Model for cline-act agent |
plan_temperature |
number | 0.1 |
Temperature for plan mode (0-1) |
act_temperature |
number | 0.3 |
Temperature for act mode (0-1) |
enable_execute_command |
boolean | true |
Enable /start-act command |
show_completion_toast |
boolean | true |
Show toast notification when plan completes |
yolo_mode |
boolean | false |
Enable YOLO mode (auto-approve and auto-switch to act mode) |
enable_task_progress |
boolean | false |
Enable task progress tracking |
- Fetch Prompts: On plugin initialization, fetches the latest prompt files from
cline/clinerepository - Adapt Content: Extracts prompt content from TypeScript files and adapts them for OpenCode
- Map Tools: Converts Cline tool names to OpenCode equivalents using
config/tool-mapping.json - Remove Unsupported: Removes MCP and other unsupported features
- Build Agents: Creates
cline-planandcline-actagents with adapted prompts
The plugin automatically maps Cline tool names to OpenCode equivalents:
| Cline Tool | OpenCode Tool |
|---|---|
read_file |
read |
write_to_file |
write |
list_files |
glob |
search_files |
grep |
list_code_definitions |
grep |
replace_in_file |
edit |
execute_command |
bash |
Some Cline features are not available in OpenCode. The plugin provides alternatives:
| Cline Feature | Alternative |
|---|---|
browser_action |
Use remote-browser or browser-use skill |
Note: ask_followup_question and plan_mode_respond are natively supported as custom tools.
If the plugin cannot fetch prompts from GitHub (network issues, rate limits, etc.), it will:
- Display a clear error message with the specific issue
- Provide troubleshooting steps
- Fail to start - ensuring you're aware of the problem
This strict approach ensures you always use the latest official Cline prompts.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Cline Mode Plugin - Failed to Fetch Prompts β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β The plugin could not fetch prompts from Cline's official β
β GitHub repository. β
β β
β Error: Network timeout β
β β
β Solutions: β
β 1. Check your internet connection β
β 2. Try again in a few minutes β
β 3. If rate limited, wait until the reset time β
β 4. Check GitHub's status: https://status.github.com β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Node.js >= 18.0.0
- npm >= 9.0.0
- Internet connection (for fetching prompts)
git clone https://github.com/trry-hub/opencode-cline-mode.git
cd opencode-cline-mode
npm installnpm run buildnpm test # Run tests
npm run typecheck # Type checking
npm run lint # Linting
npm run validate # Full validationopencode-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
β βββ prompt-fetcher.ts # GitHub prompt fetcher
β βββ prompt-adapter.ts # Prompt adaptation
β βββ tool-mapper.ts # Tool name mapping
β βββ utils/
β βββ github-api.ts # GitHub API client
β βββ cache.ts # Prompt caching
βββ config/
β βββ tool-mapping.json # Tool mapping configuration
βββ dist/ # Compiled output
βββ package.json
Contributions are welcome! Please feel free to submit a Pull Request.
MIT Β© trry
- Prompts from Cline - The official Cline VS Code extension
- Built for OpenCode - The open source AI coding agent
- Thanks to the OpenCode and Cline communities
- Cline - The original Cline VS Code extension
- OpenCode - The open source AI coding agent
- awesome-opencode - Curated list of OpenCode resources
Found a bug? Have a feature request? Please open an issue.
Made with β€οΈ for the OpenCode community