OpenCode Config শেয়ার: Default Agent, Plugin এবং Provider

canxin দ্বারা3 মিনিট পড়তে সময়


সূচিপত্র

শেয়ার

সূচিপত্র

  1. 1. বর্তমান কনফিগারেশন
  2. 2. Merge precedence
  3. 3. Top-level fields
  4. 4. default_agent = cx-local এর উৎস
  5. 5. Plugin stack (মূল অংশ)
    1. 5.1 Plugin list (npm names)
    2. 5.2 opencode-planpilot
    3. 5.3 opencode-workbench
    4. 5.4 opencode-web-preview
    5. 5.5 opencode-cx-agents
    6. 5.6 ব্যবহার পরামর্শ
  6. 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):

  1. Remote .well-known/opencode
  2. Global ~/.config/opencode/opencode.json
  3. OPENCODE_CONFIG
  4. Project opencode.json
  5. .opencode directories (agents/commands/plugins)
  6. OPENCODE_CONFIG_CONTENT

Global layer দীর্ঘমেয়াদি defaults রাখার জন্য উপযুক্ত: default_agent, model, small_model, shared providers এবং shared plugins।

3. Top-level fields

FieldCurrent valueভূমিকানোট
$schemahttps://opencode.ai/config.jsonJSON validation + autocompleteরাখা উচিত
autoupdatefalseAuto update বন্ধStability-first workflow
compaction.autotrueদীর্ঘ session auto compactRecommended
compaction.prunetrueপুরনো tool output pruneContext bloat কমায়
default_agentcx-localDefault agentPlugin দ্বারা সরবরাহিত (0.2.0 থেকে recommended)
modelopenai/gpt-5.3-codexMain modelPrimary path
small_modelopenai/gpt-5.1-codex-miniLightweight modelHelper path / কম খরচ
plugin[]4 npm pluginsCapability extensionCross-machine reuse সহজ
provider.*.optionsbaseURL + apiKeyProvider connection settingsEnvironment 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

প্রভাব:

  1. Global config compact থাকে।
  2. 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:

উপযুক্ত ব্যবহার: multi-stage দীর্ঘ task যেখানে progress tracking দরকার।

5.3 opencode-workbench

ভূমিকা: branch/worktree-ভিত্তিক parallel orchestration।
Core capabilities:

উপযুক্ত ব্যবহার: একই repo-তে একাধিক task সমান্তরালভাবে চালানো।

5.4 opencode-web-preview

ভূমিকা: local frontend preview session management।
Core capabilities:

উপযুক্ত ব্যবহার: UI পরিবর্তনের দ্রুত validation।

5.5 opencode-cx-agents

ভূমিকা: reusable preset agents এবং permission baseline সরবরাহ করা।
Core capabilities:

উপযুক্ত ব্যবহার: একাধিক repo-তে consistent agent strategy এবং risk-based write defaults রাখা।

5.6 ব্যবহার পরামর্শ

  1. safe default হিসেবে default_agent = cx-local ব্যবহার করুন।
  2. cross-directory auto-write সত্যিই প্রয়োজন হলে তবেই cx-global নিন।
  3. startup-এর পর cx-explore / cx-local / cx-global visibility verify করুন।

6. Provider এবং model routing

বর্তমান layout: এক gateway domain, provider-specific routes.

ProviderbaseURLবর্ণনা
anthropichttps://gateway.example.com/v1Anthropic-compatible route
googlehttps://gateway.example.com/v1betaGemini-compatible route
openaihttps://gateway.example.com/v1OpenAI-compatible route

মন্তব্য