| --- |
| title: Config |
| description: Using the OpenCode JSON config. |
| --- |
| |
| JSON config ํ์ผ๋ก OpenCode๋ฅผ ์ค์ ํ ์ ์์ต๋๋ค. |
|
|
| --- |
| |
| |
|
|
| OpenCode๋ **JSON**๊ณผ **JSONC**(์ฃผ์์ด ํฌํจ๋ JSON) ํ์์ ๋ชจ๋ ์ง์ํฉ๋๋ค. |
|
|
| ```jsonc title="opencode.jsonc" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "model": "anthropic/claude-sonnet-4-5", |
| "autoupdate": true, |
| "server": { |
| "port": 4096, |
| }, |
| } |
| ``` |
|
|
| --- |
| |
| |
|
|
| config ํ์ผ์ ์ฌ๋ฌ ์์น์ ๋ ์ ์์ผ๋ฉฐ, ๊ฐ ์์น์๋ ์ฐ์ ์์๊ฐ ์์ต๋๋ค. |
|
|
| :::note |
| config ํ์ผ์ **๊ต์ฒด๋์ง ์๊ณ ๋ณํฉ**๋ฉ๋๋ค. |
| ::: |
|
|
| config ํ์ผ์ ์๋ก ๋์ฒด๋๋ ๋ฐฉ์์ด ์๋๋ผ ๋ณํฉ๋ฉ๋๋ค. ์๋ config ์์น์ ์ค์ ์ด ๊ฒฐํฉ๋๋ฉฐ, ์ถฉ๋ํ๋ key์ ๋ํด์๋ง ๋์ค์ ๋ก๋๋ config๊ฐ ์์ ๊ฐ์ overrideํฉ๋๋ค. ์ถฉ๋ํ์ง ์๋ ์ค์ ์ ๋ชจ๋ ์ ์ง๋ฉ๋๋ค. |
|
|
| ์๋ฅผ ๋ค์ด, ์ ์ญ config์ `autoupdate: true`๊ฐ ์๊ณ ํ๋ก์ ํธ config์ `model: "anthropic/claude-sonnet-4-5"`๊ฐ ์์ผ๋ฉด ์ต์ข
config์๋ ์ด ์ค์ ์ด ๋ชจ๋ ํฌํจ๋ฉ๋๋ค. |
|
|
| --- |
| |
| |
|
|
| config source๋ ๋ค์ ์์๋ก ๋ก๋๋ฉ๋๋ค(๋์ค source๊ฐ ์์ source๋ฅผ override). |
|
|
| 1. **Remote config**(`.well-known/opencode`) - ์กฐ์ง ๊ธฐ๋ณธ๊ฐ |
| 2. **Global config**(`~/.config/opencode/opencode.json`) - ์ฌ์ฉ์ ๊ธฐ๋ณธ ์ค์ |
| 3. **Custom config**(`OPENCODE_CONFIG` env var) - custom override |
| 4. **Project config**(ํ๋ก์ ํธ์ `opencode.json`) - ํ๋ก์ ํธ๋ณ ์ค์ |
| 5. **`.opencode` directories** - agents, commands, plugins |
| 6. **Inline config**(`OPENCODE_CONFIG_CONTENT` env var) - ๋ฐํ์ override |
|
|
| ์ฆ, ํ๋ก์ ํธ config๋ ์ ์ญ ๊ธฐ๋ณธ๊ฐ์ overrideํ ์ ์๊ณ , ์ ์ญ config๋ ์กฐ์ง์ Remote ๊ธฐ๋ณธ๊ฐ์ overrideํ ์ ์์ต๋๋ค. |
|
|
| :::note |
| `.opencode` ๋ฐ `~/.config/opencode` ๋๋ ํ ๋ฆฌ๋ ํ์ ๋๋ ํ ๋ฆฌ์ **๋ณต์ํ ์ด๋ฆ**์ ์ฌ์ฉํฉ๋๋ค: `agents/`, `commands/`, `modes/`, `plugins/`, `skills/`, `tools/`, `themes/`. ๋จ์ํ ์ด๋ฆ(์: `agent/`)๋ ํ์ ํธํ์ฑ์ ์ํด ์ง์ํฉ๋๋ค. |
| ::: |
|
|
| --- |
| |
| |
|
|
| ์กฐ์ง์ `.well-known/opencode` endpoint๋ก ๊ธฐ๋ณธ config๋ฅผ ์ ๊ณตํ ์ ์์ต๋๋ค. ์ด๋ฅผ ์ง์ํ๋ provider๋ก ์ธ์ฆํ๋ฉด ์๋์ผ๋ก ๊ฐ์ ธ์ต๋๋ค. |
|
|
| Remote config๋ ๊ฐ์ฅ ๋จผ์ ๋ก๋๋์ด ๊ธฐ๋ณธ ๋ ์ด์ด ์ญํ ์ ํฉ๋๋ค. ์ดํ์ ๋ชจ๋ config source(์ ์ญ, ํ๋ก์ ํธ)๋ ์ด ๊ธฐ๋ณธ๊ฐ์ overrideํ ์ ์์ต๋๋ค. |
|
|
| ์๋ฅผ ๋ค์ด, ์กฐ์ง์์ ๊ธฐ๋ณธ ๋นํ์ฑํ๋ MCP ์๋ฒ๋ฅผ ์ ๊ณตํ๋ ๊ฒฝ์ฐ: |
|
|
| ```json title="Remote config from .well-known/opencode" |
| { |
| "mcp": { |
| "jira": { |
| "type": "remote", |
| "url": "https://jira.example.com/mcp", |
| "enabled": false |
| } |
| } |
| } |
| ``` |
|
|
| ๋ก์ปฌ config์์ ํน์ ์๋ฒ๋ฅผ ํ์ฑํํ ์ ์์ต๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "mcp": { |
| "jira": { |
| "type": "remote", |
| "url": "https://jira.example.com/mcp", |
| "enabled": true |
| } |
| } |
| } |
| ``` |
|
|
| --- |
| |
| |
|
|
| ์ ์ญ OpenCode config๋ `~/.config/opencode/opencode.json`์ ๋์ธ์. provider, model, permissions ๊ฐ์ ์ฌ์ฉ์ ์ ์ฒด ๊ธฐ๋ณธ ์ค์ ์ ์ ์ญ config๋ก ๊ด๋ฆฌํ์ธ์. |
|
|
| TUI ๊ด๋ จ ์ค์ ์ `~/.config/opencode/tui.json`์ ์ฌ์ฉํ์ธ์. |
|
|
| ์ ์ญ config๋ ์กฐ์ง์ Remote ๊ธฐ๋ณธ๊ฐ์ overrideํฉ๋๋ค. |
|
|
| --- |
| |
| |
|
|
| ํ๋ก์ ํธ ๋ฃจํธ์ `opencode.json`์ ์ถ๊ฐํ์ธ์. ํ๋ก์ ํธ config๋ ํ์ค config ํ์ผ ์ค ์ฐ์ ์์๊ฐ ๊ฐ์ฅ ๋์ ์ ์ญ ๋ฐ Remote config๋ฅผ ๋ชจ๋ overrideํฉ๋๋ค. |
|
|
| ํ๋ก์ ํธ๋ณ TUI ์ค์ ์ `tui.json`์ ํจ๊ป ์ถ๊ฐํ์ธ์. |
|
|
| :::tip |
| ํ๋ก์ ํธ๋ณ config๋ ํ๋ก์ ํธ ๋ฃจํธ์ ๋์ธ์. |
| ::: |
|
|
| OpenCode ์์ ์ ํ์ฌ ๋๋ ํ ๋ฆฌ์์ config ํ์ผ์ ์ฐพ๊ณ , ์์ผ๋ฉด ๊ฐ์ฅ ๊ฐ๊น์ด Git ๋๋ ํ ๋ฆฌ๊น์ง ์์๋ก ํ์ํฉ๋๋ค. |
|
|
| ์ด ํ์ผ์ Git์ ์ปค๋ฐํด๋ ์์ ํ๋ฉฐ ์ ์ญ config์ ๋์ผํ schema๋ฅผ ์ฌ์ฉํฉ๋๋ค. |
|
|
| --- |
| |
| |
|
|
| `OPENCODE_CONFIG` ํ๊ฒฝ ๋ณ์๋ก custom config ํ์ผ ๊ฒฝ๋ก๋ฅผ ์ง์ ํ์ธ์. |
|
|
| ```bash |
| export OPENCODE_CONFIG=/path/to/my/custom-config.json |
| opencode run "Hello world" |
| ``` |
|
|
| Custom config๋ ์ฐ์ ์์์ ์ ์ญ config์ ํ๋ก์ ํธ config ์ฌ์ด์์ ๋ก๋๋ฉ๋๋ค. |
|
|
| --- |
| |
| |
|
|
| `OPENCODE_CONFIG_DIR` ํ๊ฒฝ ๋ณ์๋ก custom config ๋๋ ํ ๋ฆฌ๋ฅผ ์ง์ ํ ์ ์์ต๋๋ค. ์ด ๋๋ ํ ๋ฆฌ๋ ํ์ค `.opencode` ๋๋ ํ ๋ฆฌ์ ๋์ผํ๊ฒ agents, commands, modes, plugins๋ฅผ ๊ฒ์ํ๋ฉฐ, ๋์ผํ ๊ตฌ์กฐ๋ฅผ ๋ฐ๋ผ์ผ ํฉ๋๋ค. |
|
|
| ```bash |
| export OPENCODE_CONFIG_DIR=/path/to/my/config-directory |
| opencode run "Hello world" |
| ``` |
|
|
| custom ๋๋ ํ ๋ฆฌ๋ ์ ์ญ config์ `.opencode` ๋๋ ํ ๋ฆฌ ๋ค์ ๋ก๋๋๋ฏ๋ก ํด๋น ์ค์ ์ **overrideํ ์ ์์ต๋๋ค**. |
|
|
| --- |
| |
| |
|
|
| server/runtime config schema๋ [**`opencode.ai/config.json`**](https://opencode.ai/config.json)์ ์ ์๋์ด ์์ต๋๋ค. |
|
|
| TUI config๋ [**`opencode.ai/tui.json`**](https://opencode.ai/tui.json)์ ์ฌ์ฉํฉ๋๋ค. |
|
|
| ํธ์ง๊ธฐ์์ ์ด schema๋ฅผ ๊ธฐ๋ฐ์ผ๋ก validation๊ณผ autocomplete๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค. |
|
|
| --- |
| |
| |
|
|
| TUI ๊ด๋ จ ์ค์ ์๋ ์ ์ฉ `tui.json` (๋๋ `tui.jsonc`) ํ์ผ์ ์ฌ์ฉํ์ธ์. |
|
|
| ```json title="tui.json" |
| { |
| "$schema": "https://opencode.ai/tui.json", |
| "scroll_speed": 3, |
| "scroll_acceleration": { |
| "enabled": true |
| }, |
| "diff_style": "auto" |
| } |
| ``` |
|
|
| `OPENCODE_TUI_CONFIG`๋ฅผ ์ฌ์ฉํ์ฌ ์ฌ์ฉ์ ์ง์ TUI ์ค์ ํ์ผ์ ๊ฐ๋ฆฌํฌ ์ ์์ต๋๋ค. |
|
|
| `opencode.json`์ ๊ธฐ์กด `theme`, `keybinds`, `tui` ํค๋ ๋ ์ด์ ์ฌ์ฉ๋์ง ์์ผ๋ฉฐ(deprecated) ๊ฐ๋ฅํ ๊ฒฝ์ฐ ์๋์ผ๋ก ๋ง์ด๊ทธ๋ ์ด์
๋ฉ๋๋ค. |
|
|
| [TUI ๊ตฌ์ฑ์ ๋ํด ๋ ์์๋ณด๊ธฐ](/docs/tui#configure). |
|
|
| --- |
| |
| |
|
|
| `server` ์ต์
์ผ๋ก `opencode serve`์ `opencode web` ๋ช
๋ น์ server ์ค์ ์ ๊ตฌ์ฑํ ์ ์์ต๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "server": { |
| "port": 4096, |
| "hostname": "0.0.0.0", |
| "mdns": true, |
| "mdnsDomain": "myproject.local", |
| "cors": ["http://localhost:5173"] |
| } |
| } |
| ``` |
|
|
| ์ฌ์ฉ ๊ฐ๋ฅํ ์ต์
: |
|
|
| - `port` - ์์ ํ ํฌํธ์
๋๋ค. |
| - `hostname` - ์์ ํ ํธ์คํธ๋ช
์
๋๋ค. `mdns`๊ฐ ํ์ฑํ๋์ด ์๊ณ hostname์ด ์์ผ๋ฉด ๊ธฐ๋ณธ๊ฐ์ `0.0.0.0`์
๋๋ค. |
| - `mdns` - mDNS service discovery๋ฅผ ํ์ฑํํฉ๋๋ค. ๋คํธ์ํฌ ๋ด ๋ค๋ฅธ ๊ธฐ๊ธฐ์์ OpenCode server๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค. |
| - `mdnsDomain` - mDNS service์ custom ๋๋ฉ์ธ ์ด๋ฆ์
๋๋ค. ๊ธฐ๋ณธ๊ฐ์ `opencode.local`์
๋๋ค. ๊ฐ์ ๋คํธ์ํฌ์์ ์ฌ๋ฌ ์ธ์คํด์ค๋ฅผ ์คํํ ๋ ์ ์ฉํฉ๋๋ค. |
| - `cors` - ๋ธ๋ผ์ฐ์ ๊ธฐ๋ฐ client์์ HTTP server๋ฅผ ์ฌ์ฉํ ๋ ํ์ฉํ ์ถ๊ฐ CORS origin์
๋๋ค. ๊ฐ์ ์ ์ฒด origin(scheme + host + optional port) ํ์์ด์ด์ผ ํ๋ฉฐ, ์: `https://app.example.com`. |
|
|
| [server์ ๋ํด ๋ ์์๋ณด๊ธฐ](/docs/server). |
|
|
| --- |
| |
| |
|
|
| `tools` ์ต์
์ผ๋ก LLM์ด ์ฌ์ฉํ ์ ์๋ tool์ ๊ด๋ฆฌํ ์ ์์ต๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "tools": { |
| "write": false, |
| "bash": false |
| } |
| } |
| ``` |
|
|
| [tool์ ๋ํด ๋ ์์๋ณด๊ธฐ](/docs/tools). |
|
|
| --- |
| |
| |
|
|
| OpenCode config์ `provider`, `model`, `small_model` ์ต์
์ผ๋ก ์ฌ์ฉํ provider์ model์ ์ค์ ํ ์ ์์ต๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "provider": {}, |
| "model": "anthropic/claude-sonnet-4-5", |
| "small_model": "anthropic/claude-haiku-4-5" |
| } |
| ``` |
|
|
| `small_model`์ ์ ๋ชฉ ์์ฑ ๊ฐ์ ๊ฒฝ๋ ์์
์ ์ฌ์ฉํ ๋ณ๋ model์ ์ค์ ํฉ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก OpenCode๋ provider์์ ๋ ์ ๋ ดํ model์ ์ฌ์ฉํ ์ ์์ผ๋ฉด ์ฐ์ ์ฌ์ฉํ๊ณ , ์์ผ๋ฉด ๋ฉ์ธ model๋ก fallbackํฉ๋๋ค. |
|
|
| provider ์ต์
์๋ `timeout`, `setCacheKey`๋ฅผ ํฌํจํ ์ ์์ต๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "provider": { |
| "anthropic": { |
| "options": { |
| "timeout": 600000, |
| "setCacheKey": true |
| } |
| } |
| } |
| } |
| ``` |
|
|
| - `timeout` - ์์ฒญ timeout(๋ฐ๋ฆฌ์ด, ๊ธฐ๋ณธ๊ฐ: 300000). `false`๋ก ๋นํ์ฑํํ ์ ์์ต๋๋ค. |
| - `setCacheKey` - ์ง์ ๋ provider์ ๋ํด cache key๊ฐ ํญ์ ์ค์ ๋๋๋ก ๋ณด์ฅํฉ๋๋ค. |
|
|
| [local model](/docs/models#local)๋ ์ค์ ํ ์ ์์ต๋๋ค. [๋ ์์๋ณด๊ธฐ](/docs/models). |
|
|
| --- |
| |
| |
|
|
| ์ผ๋ถ provider๋ ๊ณตํต ์ต์
์ธ `timeout`, `apiKey` ์ธ์ ์ถ๊ฐ config ์ต์
์ ์ง์ํฉ๋๋ค. |
|
|
| |
|
|
| Amazon Bedrock์ AWS ์ ์ฉ config๋ฅผ ์ง์ํฉ๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "provider": { |
| "amazon-bedrock": { |
| "options": { |
| "region": "us-east-1", |
| "profile": "my-aws-profile", |
| "endpoint": "https://bedrock-runtime.us-east-1.vpce-xxxxx.amazonaws.com" |
| } |
| } |
| } |
| } |
| ``` |
|
|
| - `region` - Bedrock์ฉ AWS ๋ฆฌ์ (`AWS_REGION` env var ๋๋ ๊ธฐ๋ณธ๊ฐ `us-east-1`) |
| - `profile` - `~/.aws/credentials`์ AWS named profile(๊ธฐ๋ณธ๊ฐ: `AWS_PROFILE` env var) |
| - `endpoint` - VPC endpoint์ฉ custom endpoint URL์
๋๋ค. AWS ์ฉ์ด๋ฅผ ์ฌ์ฉํ ์ผ๋ฐ `baseURL` ์ต์
์ ๋ณ์นญ(alias)์
๋๋ค. ๋ ๋ค ์ง์ ํ๋ฉด `endpoint`๊ฐ ์ฐ์ ํฉ๋๋ค. |
|
|
| :::note |
| Bearer token(`AWS_BEARER_TOKEN_BEDROCK` ๋๋ `/connect`)์ profile ๊ธฐ๋ฐ ์ธ์ฆ๋ณด๋ค ์ฐ์ ํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ [authentication precedence](/docs/providers#authentication-precedence)๋ฅผ ์ฐธ๊ณ ํ์ธ์. |
| ::: |
|
|
| [Amazon Bedrock config ๋ ์์๋ณด๊ธฐ](/docs/providers#amazon-bedrock). |
|
|
| --- |
| |
| |
|
|
| `tui.json`์์ UI ํ
๋ง๋ฅผ ์ค์ ํ์ธ์. |
|
|
| ```json title="tui.json" |
| { |
| "$schema": "https://opencode.ai/tui.json", |
| "theme": "tokyonight" |
| } |
| ``` |
|
|
| [๋ ์์๋ณด๊ธฐ](/docs/themes). |
|
|
| --- |
| |
| |
|
|
| `agent` ์ต์
์ผ๋ก ํน์ ์์
์ฉ ์ ๋ฌธ agent๋ฅผ ๊ตฌ์ฑํ ์ ์์ต๋๋ค. |
|
|
| ```jsonc title="opencode.jsonc" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "agent": { |
| "code-reviewer": { |
| "description": "Reviews code for best practices and potential issues", |
| "model": "anthropic/claude-sonnet-4-5", |
| "prompt": "You are a code reviewer. Focus on security, performance, and maintainability.", |
| "tools": { |
| // Disable file modification tools for review-only agent |
| "write": false, |
| "edit": false, |
| }, |
| }, |
| }, |
| } |
| ``` |
|
|
| `~/.config/opencode/agents/` ๋๋ `.opencode/agents/`์ Markdown ํ์ผ๋ก agent๋ฅผ ์ ์ํ ์๋ ์์ต๋๋ค. [๋ ์์๋ณด๊ธฐ](/docs/agents). |
|
|
| --- |
| |
| |
|
|
| `default_agent` ์ต์
์ผ๋ก ๊ธฐ๋ณธ agent๋ฅผ ์ค์ ํ ์ ์์ต๋๋ค. ๋ณ๋ ์ง์ ์ด ์์ ๋ ์ด๋ค agent๋ฅผ ์ฌ์ฉํ ์ง ๊ฒฐ์ ํฉ๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "default_agent": "plan" |
| } |
| ``` |
|
|
| ๊ธฐ๋ณธ agent๋ primary agent์ฌ์ผ ํฉ๋๋ค(subagent ๋ถ๊ฐ). `"build"`, `"plan"` ๊ฐ์ ๋ด์ฅ agent๋ ์ง์ ์ ์ํ [custom agent](/docs/agents)๋ฅผ ์ง์ ํ ์ ์์ต๋๋ค. ์ง์ ํ agent๊ฐ ์๊ฑฐ๋ subagent์ด๋ฉด OpenCode๋ ๊ฒฝ๊ณ ์ ํจ๊ป `"build"`๋ก fallbackํฉ๋๋ค. |
|
|
| ์ด ์ค์ ์ TUI, CLI(`opencode run`), ๋ฐ์คํฌํฑ ์ฑ, GitHub Action ๋ฑ ๋ชจ๋ ์ธํฐํ์ด์ค์ ์ ์ฉ๋ฉ๋๋ค. |
|
|
| --- |
| |
| |
|
|
| `share` ์ต์
์ผ๋ก [share](/docs/share) ๊ธฐ๋ฅ์ ์ค์ ํ ์ ์์ต๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "share": "manual" |
| } |
| ``` |
|
|
| ํ์ฉ ๊ฐ: |
|
|
| - `"manual"` - ๋ช
๋ น์ผ๋ก ์๋ ๊ณต์ ํ์ฉ(๊ธฐ๋ณธ๊ฐ) |
| - `"auto"` - ์ ๋ํ๋ฅผ ์๋ ๊ณต์ |
| - `"disabled"` - ๊ณต์ ๊ธฐ๋ฅ ์์ ๋นํ์ฑํ |
|
|
| ๊ธฐ๋ณธ๊ฐ์ manual ๋ชจ๋์ด๋ฉฐ, `/share` ๋ช
๋ น์ผ๋ก ๋ช
์์ ์ผ๋ก ๊ณต์ ํด์ผ ํฉ๋๋ค. |
|
|
| --- |
| |
| |
|
|
| `command` ์ต์
์ผ๋ก ๋ฐ๋ณต ์์
์ฉ custom command๋ฅผ ๊ตฌ์ฑํ ์ ์์ต๋๋ค. |
|
|
| ```jsonc title="opencode.jsonc" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "command": { |
| "test": { |
| "template": "Run the full test suite with coverage report and show any failures.\nFocus on the failing tests and suggest fixes.", |
| "description": "Run tests with coverage", |
| "agent": "build", |
| "model": "anthropic/claude-haiku-4-5", |
| }, |
| "component": { |
| "template": "Create a new React component named $ARGUMENTS with TypeScript support.\nInclude proper typing and basic structure.", |
| "description": "Create a new component", |
| }, |
| }, |
| } |
| ``` |
|
|
| `~/.config/opencode/commands/` ๋๋ `.opencode/commands/`์ Markdown ํ์ผ๋ก command๋ฅผ ์ ์ํ ์๋ ์์ต๋๋ค. [๋ ์์๋ณด๊ธฐ](/docs/commands). |
|
|
| --- |
| |
| |
|
|
| `tui.json`์์ ๋จ์ถํค๋ฅผ ์ฌ์ฉ์ ์ง์ ํ์ธ์. |
|
|
| ```json title="tui.json" |
| { |
| "$schema": "https://opencode.ai/tui.json", |
| "keybinds": {} |
| } |
| ``` |
|
|
| [๋ ์์๋ณด๊ธฐ](/docs/keybinds). |
|
|
| --- |
| |
| |
|
|
| OpenCode๋ ์์ ์ ์ ์
๋ฐ์ดํธ๋ฅผ ์๋์ผ๋ก ๋ค์ด๋ก๋ํฉ๋๋ค. `autoupdate` ์ต์
์ผ๋ก ๋นํ์ฑํํ ์ ์์ต๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "autoupdate": false |
| } |
| ``` |
|
|
| ์
๋ฐ์ดํธ๋ฅผ ์๋ ์ ์ฉํ์ง ์๊ณ ์ ๋ฒ์ ์๋ฆผ๋ง ๋ฐ๊ณ ์ถ๋ค๋ฉด `autoupdate`๋ฅผ `"notify"`๋ก ์ค์ ํ์ธ์. |
| ์ด ์ต์
์ Homebrew ๊ฐ์ ํจํค์ง ๋งค๋์ ๋ก ์ค์นํ์ง ์์ ๊ฒฝ์ฐ์๋ง ๋์ํฉ๋๋ค. |
|
|
| --- |
| |
| |
|
|
| `formatter` ์ต์
์ผ๋ก ์ฝ๋ formatter๋ฅผ ์ค์ ํ ์ ์์ต๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "formatter": { |
| "prettier": { |
| "disabled": true |
| }, |
| "custom-prettier": { |
| "command": ["npx", "prettier", "--write", "$FILE"], |
| "environment": { |
| "NODE_ENV": "development" |
| }, |
| "extensions": [".js", ".ts", ".jsx", ".tsx"] |
| } |
| } |
| } |
| ``` |
|
|
| [formatter์ ๋ํด ๋ ์์๋ณด๊ธฐ](/docs/formatters). |
|
|
| --- |
| |
| |
|
|
| ๊ธฐ๋ณธ์ ์ผ๋ก OpenCode๋ **๋ช
์์ ์น์ธ ์์ด ๋ชจ๋ ์์
์ ํ์ฉ**ํฉ๋๋ค. `permission` ์ต์
์ผ๋ก ์ด ๋์์ ๋ฐ๊ฟ ์ ์์ต๋๋ค. |
|
|
| ์๋ฅผ ๋ค์ด `edit`, `bash` tool์ด ์ฌ์ฉ์ ์น์ธ์ ์๊ตฌํ๊ฒ ํ๋ ค๋ฉด: |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "permission": { |
| "edit": "ask", |
| "bash": "ask" |
| } |
| } |
| ``` |
|
|
| [permission์ ๋ํด ๋ ์์๋ณด๊ธฐ](/docs/permissions). |
|
|
| --- |
| |
| |
|
|
| `compaction` ์ต์
์ผ๋ก context compaction ๋์์ ์ ์ดํ ์ ์์ต๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "compaction": { |
| "auto": true, |
| "prune": false, |
| "reserved": 10000 |
| } |
| } |
| ``` |
|
|
| - `auto` - context๊ฐ ๊ฐ๋ ์ฐผ์ ๋ ์ธ์
์ ์๋ compactํฉ๋๋ค(๊ธฐ๋ณธ๊ฐ: `true`). |
| - `prune` - token ์ ์ฝ์ ์ํด ์ค๋๋ tool ์ถ๋ ฅ์ ์ ๊ฑฐํฉ๋๋ค(๊ธฐ๋ณธ๊ฐ: `false`). |
| - `reserved` - compaction์ฉ token buffer์
๋๋ค. compaction ์ค overflow๊ฐ ๋์ง ์๋๋ก ์ถฉ๋ถํ window๋ฅผ ๋จ๊น๋๋ค. |
|
|
| --- |
| |
| |
|
|
| `watcher` ์ต์
์ผ๋ก ํ์ผ watcher ignore ํจํด์ ์ค์ ํ ์ ์์ต๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "watcher": { |
| "ignore": ["node_modules/**", "dist/**", ".git/**"] |
| } |
| } |
| ``` |
|
|
| ํจํด์ glob ๋ฌธ๋ฒ์ ๋ฐ๋ฆ
๋๋ค. ํ์ผ ๊ฐ์์์ ๋
ธ์ด์ฆ๊ฐ ๋ง์ ๋๋ ํ ๋ฆฌ๋ฅผ ์ ์ธํ ๋ ์ ์ฉํฉ๋๋ค. |
|
|
| --- |
| |
| |
|
|
| `mcp` ์ต์
์ผ๋ก ์ฌ์ฉํ MCP server๋ฅผ ์ค์ ํ ์ ์์ต๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "mcp": {} |
| } |
| ``` |
|
|
| [๋ ์์๋ณด๊ธฐ](/docs/mcp-servers). |
|
|
| --- |
| |
| |
|
|
| [Plugins](/docs/plugins)๋ custom tool, hook, integration์ผ๋ก OpenCode๋ฅผ ํ์ฅํฉ๋๋ค. |
|
|
| plugin ํ์ผ์ `.opencode/plugins/` ๋๋ `~/.config/opencode/plugins/`์ ๋์ธ์. `plugin` ์ต์
์ผ๋ก npm plugin์ ๋ก๋ํ ์๋ ์์ต๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "plugin": ["opencode-helicone-session", "@my-org/custom-plugin"] |
| } |
| ``` |
|
|
| [๋ ์์๋ณด๊ธฐ](/docs/plugins). |
|
|
| --- |
| |
| |
|
|
| `instructions` ์ต์
์ผ๋ก ์ฌ์ฉ ์ค์ธ model์ ์ ๊ณตํ ์ง์นจ ํ์ผ์ ์ค์ ํ ์ ์์ต๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "instructions": ["CONTRIBUTING.md", "docs/guidelines.md", ".cursor/rules/*.md"] |
| } |
| ``` |
|
|
| ์ด ์ต์
์ ์ง์นจ ํ์ผ ๊ฒฝ๋ก ๋ฐ glob ํจํด ๋ฐฐ์ด์ ๋ฐ์ต๋๋ค. [rules์ ๋ํด ๋ ์์๋ณด๊ธฐ](/docs/rules). |
|
|
| --- |
| |
| |
|
|
| `disabled_providers` ์ต์
์ผ๋ก ์๋ ๋ก๋๋๋ provider๋ฅผ ๋นํ์ฑํํ ์ ์์ต๋๋ค. credential์ด ์์ด๋ ํน์ provider๋ฅผ ๋ก๋ํ์ง ์๊ฒ ํ๊ณ ์ถ์ ๋ ์ ์ฉํฉ๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "disabled_providers": ["openai", "gemini"] |
| } |
| ``` |
|
|
| :::note |
| `disabled_providers`๋ `enabled_providers`๋ณด๋ค ์ฐ์ ํฉ๋๋ค. |
| ::: |
|
|
| `disabled_providers`๋ provider ID ๋ฐฐ์ด์ ๋ฐ์ต๋๋ค. provider๊ฐ ๋นํ์ฑํ๋๋ฉด: |
|
|
| - ํ๊ฒฝ ๋ณ์๊ฐ ์ค์ ๋์ด ์์ด๋ ๋ก๋๋์ง ์์ต๋๋ค. |
| - `/connect` ๋ช
๋ น์ผ๋ก API key๋ฅผ ์ค์ ํด๋ ๋ก๋๋์ง ์์ต๋๋ค. |
| - ํด๋น provider์ model์ model ์ ํ ๋ชฉ๋ก์ ํ์๋์ง ์์ต๋๋ค. |
|
|
| --- |
| |
| |
|
|
| `enabled_providers` ์ต์
์ผ๋ก provider allowlist๋ฅผ ์ง์ ํ ์ ์์ต๋๋ค. ์ด ๊ฐ์ ์ค์ ํ๋ฉด ์ง์ ํ provider๋ง ํ์ฑํ๋๊ณ ๋๋จธ์ง๋ ๋ฌด์๋ฉ๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "enabled_providers": ["anthropic", "openai"] |
| } |
| ``` |
|
|
| provider๋ฅผ ํ๋์ฉ ๋นํ์ฑํํ๋ ๋์ , OpenCode๊ฐ ํน์ provider๋ง ์ฌ์ฉํ๋๋ก ์ ํํ๊ณ ์ถ์ ๋ ์ ์ฉํฉ๋๋ค. |
|
|
| :::note |
| `disabled_providers`๋ `enabled_providers`๋ณด๋ค ์ฐ์ ํฉ๋๋ค. |
| ::: |
|
|
| ๋์ผ provider๊ฐ `enabled_providers`์ `disabled_providers`์ ๋ชจ๋ ์์ผ๋ฉด ํ์ ํธํ์ฑ์ ์ํด `disabled_providers`๊ฐ ์ฐ์ ํฉ๋๋ค. |
|
|
| --- |
| |
| |
|
|
| `experimental` key์๋ ํ์ฌ ํ๋ฐํ ๊ฐ๋ฐ ์ค์ธ ์ต์
์ด ํฌํจ๋ฉ๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "experimental": {} |
| } |
| ``` |
|
|
| :::caution |
| experimental ์ต์
์ ์์ ์ ์ด์ง ์์ต๋๋ค. ์๊ณ ์์ด ๋ณ๊ฒฝ๋๊ฑฐ๋ ์ ๊ฑฐ๋ ์ ์์ต๋๋ค. |
| ::: |
|
|
| --- |
| |
| |
|
|
| config ํ์ผ์์ ํ๊ฒฝ ๋ณ์์ ํ์ผ ๋ด์ฉ์ ์ฐธ์กฐํ ์ ์๋๋ก ๋ณ์ ์นํ์ ์ฌ์ฉํ ์ ์์ต๋๋ค. |
|
|
| --- |
| |
| |
|
|
| `{env:VARIABLE_NAME}` ํ์์ผ๋ก ํ๊ฒฝ ๋ณ์๋ฅผ ์นํํ ์ ์์ต๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "model": "{env:OPENCODE_MODEL}", |
| "provider": { |
| "anthropic": { |
| "models": {}, |
| "options": { |
| "apiKey": "{env:ANTHROPIC_API_KEY}" |
| } |
| } |
| } |
| } |
| ``` |
|
|
| ํ๊ฒฝ ๋ณ์๊ฐ ์ค์ ๋์ง ์์์ผ๋ฉด ๋น ๋ฌธ์์ด๋ก ์นํ๋ฉ๋๋ค. |
|
|
| --- |
| |
| |
|
|
| `{file:path/to/file}` ํ์์ผ๋ก ํ์ผ ๋ด์ฉ์ ์นํํ ์ ์์ต๋๋ค. |
|
|
| ```json title="opencode.json" |
| { |
| "$schema": "https://opencode.ai/config.json", |
| "instructions": ["./custom-instructions.md"], |
| "provider": { |
| "openai": { |
| "options": { |
| "apiKey": "{file:~/.secrets/openai-key}" |
| } |
| } |
| } |
| } |
| ``` |
|
|
| ํ์ผ ๊ฒฝ๋ก๋ ๋ค์์ ์ง์ํฉ๋๋ค. |
|
|
| - config ํ์ผ ๋๋ ํ ๋ฆฌ ๊ธฐ์ค ์๋ ๊ฒฝ๋ก |
| - `/` ๋๋ `~`๋ก ์์ํ๋ ์ ๋ ๊ฒฝ๋ก |
|
|
| ์ด ๊ธฐ๋ฅ์ ๋ค์ ์ํฉ์ ์ ์ฉํฉ๋๋ค. |
|
|
| - API key ๊ฐ์ ๋ฏผ๊ฐ ์ ๋ณด๋ฅผ ๋ณ๋ ํ์ผ๋ก ๋ถ๋ฆฌ |
| - ํฐ ์ง์นจ ํ์ผ์ config๋ฅผ ๋ณต์กํ๊ฒ ๋ง๋ค์ง ์๊ณ ํฌํจ |
| - ์ฌ๋ฌ config ํ์ผ์์ ๊ณตํต ์ค์ ์ค๋ํซ ์ฌ์ฌ์ฉ |
|
|