Download packages/web/src/content/docs/ko/tools.mdx from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 8.69 kB
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/web/src/content/docs/ko/tools.mdx
- Command line
-
hf download hf://SaylorTwift/opencode/packages/web/src/content/docs/ko/tools.mdx
-
curl -L -o tools.mdx https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/web/src/content/docs/ko/tools.mdx
8.69 kB
| title: ๋๊ตฌ | |
| description: LLM์ด ์ฌ์ฉํ ์ ์๋ ๋๊ตฌ๋ฅผ ๊ด๋ฆฌํฉ๋๋ค. | |
| ๋๊ตฌ๋ LLM์ ์ฌ์ฉํ์ฌ ์ฝ๋๋ฒ ์ด์ค์์ ์์ ์ ์ํ ํ ์ ์์ต๋๋ค. opencode๋ ๋ด์ฅ ๋๊ตฌ ์ธํธ๋ก ์ ๊ณต๋์ง๋ง, [custom tools](/docs/custom-tools) ๋๋ [MCP ์๋ฒ](/docs/mcp-servers)๋ก ํ์ฅํ ์ ์์ต๋๋ค. | |
| ๊ธฐ๋ณธ์ ์ผ๋ก ๋ชจ๋ ๋๊ตฌ๋**enabled**์ด๋ฉฐ, ์คํํ ๊ถํ์ด ์์ต๋๋ค. [permissions](/docs/permissions)๋ฅผ ํตํด ๊ณต๊ตฌ ๋์์ ์ ์ดํ ์ ์์ต๋๋ค. | |
| ## ๊ตฌ์ฑ | |
| `permission` ํ๋๋ฅผ ์ฌ์ฉํ์ฌ ๋๊ตฌ ๋์์ ์ ์ดํฉ๋๋ค. ๊ฐ ๋๊ตฌ์ ๋ํ ์น์ธ์ด ํ์ํ ์ ์์ต๋๋ค. | |
| ```json title="opencode.json" | |
| { | |
| "$schema": "https://opencode.ai/config.json", | |
| "permission": { | |
| "edit": "deny", | |
| "bash": "ask", | |
| "webfetch": "allow" | |
| } | |
| } | |
| ``` | |
| ํ ๋ฒ์ ์ฌ๋ฌ ๋๊ตฌ๋ฅผ ์ ์ด ํ ์์ผ๋ ์นด๋๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด, MCP ์๋ฒ์ ๋ชจ๋ ๋๊ตฌ์ ๋ํ ์น์ธ์ ์๊ตฌํฉ๋๋ค. | |
| ```json title="opencode.json" | |
| { | |
| "$schema": "https://opencode.ai/config.json", | |
| "permission": { | |
| "mymcp_*": "ask" | |
| } | |
| } | |
| ``` | |
| [Learn more](/docs/permissions) configuring ๊ถํ์ ๋ํด. | |
| ## ๋ด์ฅ | |
| ๋ค์์ opencode์์ ์ฌ์ฉํ ์์๋ ๋ชจ๋ ๋ด์ฅ ๋๊ตฌ์ ๋๋ค. | |
| ###### bash | |
| ํ๋ก์ ํธ ํ๊ฒฝ์์ shell ๋ช ๋ น์ ์คํํฉ๋๋ค. | |
| ```json title="opencode.json" {4} | |
| { | |
| "$schema": "https://opencode.ai/config.json", | |
| "permission": { | |
| "bash": "allow" | |
| } | |
| } | |
| ``` | |
| ์ด ๋๊ตฌ๋ `npm install`, `git status` ๋๋ ๋ค๋ฅธ shell ๋ช ๋ น๊ณผ ๊ฐ์ terminal ๋ช ๋ น์ ์คํํ๋ LLM์ ํ์ฉํฉ๋๋ค. | |
| ### edit | |
| ์ ํํ ๋ฌธ์์ด ๊ต์ฒด๋ฅผ ์ฌ์ฉํ์ฌ ๊ธฐ์กด ํ์ผ์ ์์ ํฉ๋๋ค. | |
| ```json title="opencode.json" {4} | |
| { | |
| "$schema": "https://opencode.ai/config.json", | |
| "permission": { | |
| "edit": "allow" | |
| } | |
| } | |
| ``` | |
| ์ด ๋๊ตฌ๋ ์ ํํ ํ ์คํธ ์ผ์น๋ฅผ ๋์ฒดํ์ฌ ํ์ผ์ ์ ํํ ํธ์ง์ ์ํํฉ๋๋ค. LLM์ ์ฝ๋๋ฅผ modifyํ๋ ์ฃผ์ ๋ฐฉ๋ฒ์ ๋๋ค. | |
| ### write | |
| ์๋ก์ด ํ์ผ์ ๋ง๋ค๊ฑฐ๋ ๊ธฐ์กด์ ๊ฒ์ ๋ฎ์ด์ฐ๊ธฐ. | |
| ```json title="opencode.json" {4} | |
| { | |
| "$schema": "https://opencode.ai/config.json", | |
| "permission": { | |
| "edit": "allow" | |
| } | |
| } | |
| ``` | |
| LLM์ ์ฌ์ฉํ์ฌ ์ ํ์ผ์ ๋ง๋ญ๋๋ค. ์ด๋ฏธ ์กด์ฌํ๋ ๊ฒฝ์ฐ ๊ธฐ์กด ํ์ผ์ ๋ฎ์ด์ฐ๊ฒ ์ต๋๋ค. | |
| :::note | |
| `write` ๊ณต๊ตฌ๋ ๋ชจ๋ ํ์ผ ์์ (`edit`, `write`, `patch`)๋ฅผ ํฌํจํ๋ `edit` ํ๊ฐ์ ์ํด ํต์ ๋ฉ๋๋ค. | |
| ::: | |
| ### read | |
| codebase์์ ํ์ผ ๋ด์ฉ์ ์ฝ์ผ์ญ์์ค. | |
| ```json title="opencode.json" {4} | |
| { | |
| "$schema": "https://opencode.ai/config.json", | |
| "permission": { | |
| "read": "allow" | |
| } | |
| } | |
| ``` | |
| ์ด ๋๊ตฌ๋ ํ์ผ์ ์ฝ๊ณ ๋ด์ฉ์ ๋ฐํํฉ๋๋ค. ํฐ ํ์ผ์ ๋ํ ํน์ ๋ผ์ธ ๋ฒ์๋ฅผ ์ฝ์ ์ ์์ต๋๋ค. | |
| #### grep | |
| ์ ๊ท ํํ์์ ์ฌ์ฉํ์ฌ ํ์ผ ๋ด์ฉ์ ๊ฒ์ํฉ๋๋ค. | |
| ```json title="opencode.json" {4} | |
| { | |
| "$schema": "https://opencode.ai/config.json", | |
| "permission": { | |
| "grep": "allow" | |
| } | |
| } | |
| ``` | |
| Codebase์์ ๋น ๋ฅธ ์ฝํ ์ธ ๊ฒ์. ์ ์ฒด regex ๋ฌธ๋ฒ ๋ฐ ํ์ผ ํจํด ํํฐ๋ง ์ง์. | |
| #### glob | |
| ํจํด ๋งค์นญ์ผ๋ก ํ์ผ ์ฐพ๊ธฐ. | |
| ```json title="opencode.json" {4} | |
| { | |
| "$schema": "https://opencode.ai/config.json", | |
| "permission": { | |
| "glob": "allow" | |
| } | |
| } | |
| ``` | |
| `**/*.js` ๋๋ `src/**/*.ts`์ ๊ฐ์ glob ํจํด์ ์ฌ์ฉํ์ฌ ํ์ผ ๊ฒ์. ์์ ์๊ฐ์ ์ํด ์ ๋ ฌ ๋ ํ์ผ ๊ฒฝ๋ก ๋ฐํ. | |
| ### lsp (์คํ์ ) | |
| ์ ์, ์ฐธ๊ณ , hover info ๋ฐ ํธ์ถ hierarchy์ ๊ฐ์ ์ฝ๋ ์ธํ ๋ฆฌ์ ์ค ๊ธฐ๋ฅ์ ์ป๊ธฐ ์ํด ๊ตฌ์ฑ ๋ LSP ์๋ฒ์ ์ธํฐ๋ํธ. | |
| :::note | |
| ์ด ๋๊ตฌ๋ `OPENCODE_EXPERIMENTAL_LSP_TOOL=true` (๋๋ `OPENCODE_EXPERIMENTAL=true`) ๋๋ง ์ ํจํฉ๋๋ค. | |
| ::: | |
| ```json title="opencode.json" {4} | |
| { | |
| "$schema": "https://opencode.ai/config.json", | |
| "permission": { | |
| "lsp": "allow" | |
| } | |
| } | |
| ``` | |
| ์ง์๋ ๊ฐ๋์ `goToDefinition`, `findReferences`, `hover`, `documentSymbol`, `workspaceSymbol`, `goToImplementation`, `prepareCallHierarchy`, `incomingCalls` ๋ฐ `outgoingCalls`๋ฅผ ํฌํจํฉ๋๋ค. | |
| LSP ์๋ฒ๊ฐ ํ๋ก์ ํธ์ ์ฌ์ฉํ ์ ์๋ ๊ตฌ์ฑํ๋ ค๋ฉด [LSP Servers](/docs/lsp)๋ฅผ ์ฐธ์กฐํ์ญ์์ค. | |
| ## patch | |
| ํ์ผ์ ํจ์น๋ฅผ ์ ์ฉํฉ๋๋ค. | |
| ```json title="opencode.json" {4} | |
| { | |
| "$schema": "https://opencode.ai/config.json", | |
| "permission": { | |
| "edit": "allow" | |
| } | |
| } | |
| ``` | |
| ์ด ๋๊ตฌ๋ ์ฝ๋๋ฒ ์ด์ค์ ํจ์น ํ์ผ์ ์ ์ฉํฉ๋๋ค. ๋ค์ํ ์์ค์์ diffs ๋ฐ Patch๋ฅผ ์ ์ฉํ๋ ๋ฐ ์ ์ฉํฉ๋๋ค. | |
| :::note | |
| `patch` ๊ณต๊ตฌ๋ ๋ชจ๋ ํ์ผ ์์ (`edit`, `write`, `patch`)๋ฅผ ํฌํจํ๋ `edit` ํ๊ฐ์ ์ํด ํต์ ๋ฉ๋๋ค. | |
| ::: | |
| ### skill | |
| [skill](/docs/skills) (`SKILL.md` ํ์ผ)์๋ก๋ํ๊ณ ๋ํ์ ๋ด์ฉ์ ๋ฐํํฉ๋๋ค. | |
| ```json title="opencode.json" {4} | |
| { | |
| "$schema": "https://opencode.ai/config.json", | |
| "permission": { | |
| "skill": "allow" | |
| } | |
| } | |
| ``` | |
| ## todowrite | |
| ์ฝ๋ฉ ์ธ์ ์ค์ todo ๋ชฉ๋ก์ ๊ด๋ฆฌํฉ๋๋ค. | |
| ```json title="opencode.json" {4} | |
| { | |
| "$schema": "https://opencode.ai/config.json", | |
| "permission": { | |
| "todowrite": "allow" | |
| } | |
| } | |
| ``` | |
| ๋ณต์กํ ์์ ์ค์ ์งํ ์ํฉ์ ์ถ์ ํ๊ธฐ ์ํด ์์ ๋ชฉ๋ก์ ๋ง๋ค๊ณ ์ ๋ฐ์ดํธํฉ๋๋ค. LLM์ ๋ฉํฐ ๋จ๊ณ ์์ ์ ๊ตฌ์ฑํ๊ธฐ ์ํด ์ด๊ฒ์ ์ฌ์ฉํฉ๋๋ค. | |
| :::note | |
| ์ด ๋๊ตฌ๋ ๊ธฐ๋ณธ์ผ๋ก ์์ฝ์ ๋นํ์ฑํํ์ง๋ง ์๋์ผ๋ก ํ์ฑํ ํ ์ ์์ต๋๋ค. [๋ ์์๋ณด๊ธฐ](/docs/agents/#permissions) | |
| ::: | |
| #### webfetch | |
| Fetch ์น ์ฝํ ์ธ . | |
| ```json title="opencode.json" {4} | |
| { | |
| "$schema": "https://opencode.ai/config.json", | |
| "permission": { | |
| "webfetch": "allow" | |
| } | |
| } | |
| ``` | |
| LLM์ fetch ๋ฐ ์น ํ์ด์ง๋ฅผ ์ฝ์ ์ ์์ต๋๋ค. ์จ๋ผ์ธ ๋ฆฌ์์ค๋ฅผ ์ฐพ๋ ๋ฐ ๋์์ด ๋๋ ๋ฌธ์ ๋๋ ์ฐ๊ตฌ | |
| #### websearch | |
| ์น ๊ฒ์ | |
| :::note | |
| ์ด ๋๊ตฌ๋ opencode ์ ๊ณต ์ ์ฒด ๋๋ `OPENCODE_ENABLE_EXA` ํ๊ฒฝ ๋ณ์๊ฐ ๋ชจ๋ ์ง์ค ๊ฐ (์ : `true` ๋๋ `1`)๋ก ์ค์ ํ ๋๋ง ์ฌ์ฉํ ์ ์์ต๋๋ค. | |
| opencode๋ฅผ ์คํํ ๋ ํ์ฑํ: | |
| ```bash | |
| OPENCODE_ENABLE_EXA=1 opencode | |
| ``` | |
| ::: | |
| ```json title="opencode.json" {4} | |
| { | |
| "$schema": "https://opencode.ai/config.json", | |
| "permission": { | |
| "websearch": "allow" | |
| } | |
| } | |
| ``` | |
| Exa AI๋ฅผ ์ฌ์ฉํ์ฌ ์น ๊ฒ์์ ์ํํ์ฌ ๊ด๋ จ ์ ๋ณด๋ฅผ ์จ๋ผ์ธ์ผ๋ก ์ฐพ์ผ์ญ์์ค. ์ฐ๊ตฌ ์ฃผ์ ์ ์ ์ฉํ, ํ์ฌ ์ด๋ฒคํธ๋ฅผ ์ฐพ๋, ๋๋ ํ๋ จ ๋ฐ์ดํฐ ์ฐจ๋จ์ ๋์ด ์ ๋ณด๋ฅผ ์์ง. | |
| API ํค๊ฐ ํ์ํ์ง ์์ต๋๋ค - ๋๊ตฌ๋ ์ธ์ฆ์์ด Exa AI์ ํธ์คํ MCP ์๋น์ค์ ์ง์ ์ฐ๊ฒฐ๋ฉ๋๋ค. | |
| :::tip | |
| `websearch`๋ฅผ ์ฌ์ฉํ๋ฉด ํน์ URL (retrieval)์์ ์ฝํ ์ธ ๋ฅผ ๊ฒ์ํด์ผํฉ๋๋ค. | |
| ::: | |
| ### question | |
| ์คํ ์ค์ ์ฌ์ฉ์์ ์ง๋ฌธ ์์ฒญ. | |
| ```json title="opencode.json" {4} | |
| { | |
| "$schema": "https://opencode.ai/config.json", | |
| "permission": { | |
| "question": "allow" | |
| } | |
| } | |
| ``` | |
| ์ด ๋๊ตฌ๋ ์์ ์ค์ LLM์ ์์ฒญํ ์ ์์ต๋๋ค. ๊ทธ๊ฒ์ ์ ์ฉํฉ๋๋ค: | |
| - ์ฌ์ฉ์ ์ ํธ๋ ๋๋ ์๊ตฌ ์ฌํญ ๋ณ๊ฒฝ | |
| - ์ฃผ์ ์ง์นจ | |
| - ๊ตฌํ ์ ํ์ ๋ํ ๊ฒฐ์ | |
| - ์ด๋ค ๋ฐฉํฅ์ ๋ํ ์ ํ ์ ๊ณต | |
| ๊ฐ ์ง๋ฌธ์๋ ํค๋, ์ง๋ฌธ ํ ์คํธ ๋ฐ ์ต์ ๋ชฉ๋ก์ด ํฌํจ๋์ด ์์ต๋๋ค. ์ฌ์ฉ์๋ ์ ๊ณต๋ ์ ํ๊ถ์์ ์ ํํ๊ฑฐ๋ ์ฃผ๋ฌธ ๋๋ต์ ํ์๋ฅผ ์ ์์ต๋๋ค. ์ฌ๋ฌ ์ง๋ฌธ์ด ์์ ๋, ์ฌ์ฉ์๋ ๋ชจ๋ ๋ต๋ณ์ ์ ์ถํ๊ธฐ ์ ์ ๊ทธ๋ค ์ฌ์ด์์ ํ์ ํ ์ ์์ต๋๋ค. | |
| ## ์ฌ์ฉ์ ์ ์ ๋๊ตฌ | |
| ์ฌ์ฉ์ ์ ์ ๋๊ตฌ๋ LLM์ด ํธ์ถ ํ ์์๋ ์์ ์ ๊ธฐ๋ฅ์ ์ ์ ํ ์ ์์ต๋๋ค. config ํ์ผ์ ์ ์๋์ด arbitrary ์ฝ๋๋ฅผ ์คํํ ์ ์์ต๋๋ค. | |
| [Learn more](/docs/custom-tools) ์ฌ์ฉ์ ์ ์ ๋๊ตฌ ๋ง๋ค๊ธฐ. | |
| ## MCP ์๋ฒ | |
| MCP(Model Context Protocol) ์๋ฒ๋ ์ธ๋ถ ๋๊ตฌ์ ์๋น์ค๋ฅผ ํตํฉํ ์ ์์ต๋๋ค. ์ด ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ก์ธ์ค, API ํตํฉ ๋ฐ ํ์ฌ ์๋น์ค๊ฐ ํฌํจ๋์ด ์์ต๋๋ค. | |
| MCP ์๋ฒ ๊ตฌ์ฑ์ ๋ํ [Learn more](/docs/mcp-servers). | |
| ## ๋ด๋ถ | |
| ๋ด๋ถ, ๋๊ตฌ `grep` ๊ทธ๋ฆฌ๊ณ `glob` ์ฌ์ฉ [ripgrep](https://github.com/BurntSushi/ripgrep) ํ๋ ์๋์. ๊ธฐ๋ณธ์ ์ผ๋ก ripgrep์ `.gitignore` ํจํด์ ์กด์คํ๋ฉฐ `.gitignore`์ ๋์ด๋ ํ์ผ ๋ฐ ๋๋ ํ ๋ฆฌ๋ฅผ ๊ฒ์ ๋ฐ ๋ชฉ๋ก์์ ์ ์ธ๋ฉ๋๋ค. | |
| #### Ignore ํจํด | |
| ์ผ๋ฐ์ ์ผ๋ก ๋ฌด์๋๋ ํ์ผ์ ํฌํจํ๋ ค๋ฉด ํ๋ก์ ํธ ๋ฃจํธ์ `.ignore` ํ์ผ์ ๋ง๋ญ๋๋ค. ์ด ํ์ผ์ ๋ช ์์ ์ผ๋ก ํน์ ๊ฒฝ๋ก๋ฅผ ํ์ฉ ํ ์ ์์ต๋๋ค. | |
| ```text title=".ignore" | |
| !node_modules/ | |
| !dist/ | |
| !build/ | |
| ``` | |
| ์๋ฅผ ๋ค์ด,์ด `.ignore` ํ์ผ์ `node_modules/`, `dist/` ๋ฐ `build/` ๋๋ ํ ๋ฆฌ ๋ด์์ ๊ฒ์ ํ ์ ์์ต๋๋ค. `.gitignore`. | |