OpenCode Config শেয়ার: Default Agent, Plugin এবং Provider
canxin দ্বারা • 3 মিনিট পড়তে সময় •
সূচিপত্র
- 1. বর্তমান কনফিগারেশন
- 2. Merge precedence
- 3. Top-level fields
- 4. default_agent = cx-local এর উৎস
- 5. Plugin stack (মূল অংশ)
- 6. Provider এবং model routing
1. বর্তমান কনফিগারেশন
{
"$schema": "https://opencode.ai/config.json",
"autoupdate": false,
"compaction": {
"auto": true,
"prune": true
},
"default_agent": "cx-local",
"model": "openai/gpt-5.3-codex",
"small_model": "openai/gpt-5.1-codex-mini",
"plugin": [
"opencode-planpilot",
"opencode-workbench",
"opencode-web-preview",
"opencode-cx-agents"
],
"provider": {
"anthropic": {
"options": {
"apiKey": "{env:CLAUDE_API_KEY}",
"baseURL": "https://gateway.example.com/v1"
}
},
"google": {
"options": {
"apiKey": "{env:GEMINI_API_KEY}",
"baseURL": "https://gateway.example.com/v1beta"
}
},
"openai": {
"options": {
"apiKey": "{env:OPENAI_API_KEY}",
"baseURL": "https://gateway.example.com/v1",
"setCacheKey": true
}
}
}
}2. Merge precedence
OpenCode precedence (low -> high):
- Remote
.well-known/opencode - Global
~/.config/opencode/opencode.json OPENCODE_CONFIG- Project
opencode.json .opencodedirectories (agents/commands/plugins)OPENCODE_CONFIG_CONTENT
Global layer দীর্ঘমেয়াদি defaults রাখার জন্য উপযুক্ত: default_agent, model, small_model, shared providers এবং shared plugins।
3. Top-level fields
| Field | Current value | ভূমিকা | নোট |
|---|---|---|---|
$schema | https://opencode.ai/config.json | JSON validation + autocomplete | রাখা উচিত |
autoupdate | false | Auto update বন্ধ | Stability-first workflow |
compaction.auto | true | দীর্ঘ session auto compact | Recommended |
compaction.prune | true | পুরনো tool output prune | Context bloat কমায় |
default_agent | cx-local | Default agent | Plugin দ্বারা সরবরাহিত (0.2.0 থেকে recommended) |
model | openai/gpt-5.3-codex | Main model | Primary path |
small_model | openai/gpt-5.1-codex-mini | Lightweight model | Helper path / কম খরচ |
plugin[] | 4 npm plugins | Capability extension | Cross-machine reuse সহজ |
provider.*.options | baseURL + apiKey | Provider connection settings | Environment variables ব্যবহার |
4. default_agent = cx-local এর উৎস
cx-local নিবন্ধিত হয় opencode-cx-agents plugin দিয়ে; local config-এ manual agent block প্রয়োজন হয় না।
এই plugin-এর canonical agents: cx-explore, cx-local, cx-global।
প্রভাব:
- Global config compact থাকে।
- Plugin load ব্যর্থ হলে default agent register হয় না।
5. Plugin stack (মূল অংশ)
5.1 Plugin list (npm names)
"plugin": [
"opencode-planpilot",
"opencode-workbench",
"opencode-web-preview",
"opencode-cx-agents"
]GitHub repositories:
5.2 opencode-planpilot
ভূমিকা: complex task-এর জন্য structured execution।
Core capabilities:
- unified model:
plan -> step -> goal ai / humanexecutor split- next executor
aiহলে auto-continue
উপযুক্ত ব্যবহার: multi-stage দীর্ঘ task যেখানে progress tracking দরকার।
5.3 opencode-workbench
ভূমিকা: branch/worktree-ভিত্তিক parallel orchestration।
Core capabilities:
- session-to-worktree explicit binding
- worktree অনুযায়ী task routing
- branch/task context traceability
উপযুক্ত ব্যবহার: একই repo-তে একাধিক task সমান্তরালভাবে চালানো।
5.4 opencode-web-preview
ভূমিকা: local frontend preview session management।
Core capabilities:
- available preview session খুঁজে পাওয়া
- local preview host start/stop
- preview status check
উপযুক্ত ব্যবহার: UI পরিবর্তনের দ্রুত validation।
5.5 opencode-cx-agents
ভূমিকা: reusable preset agents এবং permission baseline সরবরাহ করা।
Core capabilities:
- canonical agents:
cx-explore,cx-local,cx-global - write permission tiers:
cx-local: workspace-first,external_directory: askcx-global: cross-directory writes,external_directory: allow
opencode-planpilot,opencode-workbench, এবংopencode-web-preview-এর সাথে tool visibility বজায় রেখে কাজ করা
উপযুক্ত ব্যবহার: একাধিক repo-তে consistent agent strategy এবং risk-based write defaults রাখা।
5.6 ব্যবহার পরামর্শ
- safe default হিসেবে
default_agent = cx-localব্যবহার করুন। - cross-directory auto-write সত্যিই প্রয়োজন হলে তবেই
cx-globalনিন। - startup-এর পর
cx-explore / cx-local / cx-globalvisibility verify করুন।
6. Provider এবং model routing
বর্তমান layout: এক gateway domain, provider-specific routes.
| Provider | baseURL | বর্ণনা |
|---|---|---|
anthropic | https://gateway.example.com/v1 | Anthropic-compatible route |
google | https://gateway.example.com/v1beta | Gemini-compatible route |
openai | https://gateway.example.com/v1 | OpenAI-compatible route |
মন্তব্য