Download packages/web/src/content/docs/ko/index.mdx from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 9.03 kB
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/web/src/content/docs/ko/index.mdx
- Command line
-
hf download hf://SaylorTwift/opencode/packages/web/src/content/docs/ko/index.mdx
-
curl -L -o index.mdx https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/web/src/content/docs/ko/index.mdx
9.03 kB
| --- | |
| title: ์๊ฐ | |
| description: OpenCode๋ฅผ ์์ํด ๋ณด์ธ์. | |
| --- | |
| import { Tabs, TabItem } from "@astrojs/starlight/components" | |
| import config from "../../../../config.mjs" | |
| export const console = config.console | |
| [**OpenCode**](/)๋ ์คํ ์์ค AI coding agent์ ๋๋ค. ํฐ๋ฏธ๋ ๊ธฐ๋ฐ ์ธํฐํ์ด์ค, ๋ฐ์คํฌํฑ ์ฑ, IDE ํ์ฅ์ผ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค. | |
|  | |
| ๋ฐ๋ก ์์ํด ๋ณด๊ฒ ์ต๋๋ค. | |
| --- | |
| #### ์ฌ์ ์ค๋น | |
| ํฐ๋ฏธ๋์์ OpenCode๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ๋ค์์ด ํ์ํฉ๋๋ค. | |
| 1. ๋ค์๊ณผ ๊ฐ์ ์ต์ ํฐ๋ฏธ๋ ์๋ฎฌ๋ ์ดํฐ | |
| - [WezTerm](https://wezterm.org), ํฌ๋ก์ค ํ๋ซํผ | |
| - [Alacritty](https://alacritty.org), ํฌ๋ก์ค ํ๋ซํผ | |
| - [Ghostty](https://ghostty.org), Linux ๋ฐ macOS | |
| - [Kitty](https://sw.kovidgoyal.net/kitty/), Linux ๋ฐ macOS | |
| 2. ์ฌ์ฉํ LLM ์ ๊ณต์์ API ํค | |
| --- | |
| ## ์ค์น | |
| OpenCode๋ฅผ ์ค์นํ๋ ๊ฐ์ฅ ์ฌ์ด ๋ฐฉ๋ฒ์ ์ค์น ์คํฌ๋ฆฝํธ๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ ๋๋ค. | |
| ```bash | |
| curl -fsSL https://opencode.ai/install | bash | |
| ``` | |
| ๋ค์ ๋ช ๋ น์ผ๋ก๋ ์ค์นํ ์ ์์ต๋๋ค. | |
| - **Node.js ์ฌ์ฉ** | |
| <Tabs> | |
| <TabItem label="npm"> | |
| ```bash | |
| npm install -g opencode-ai | |
| ``` | |
| </TabItem> | |
| <TabItem label="Bun"> | |
| ```bash | |
| bun install -g opencode-ai | |
| ``` | |
| </TabItem> | |
| <TabItem label="pnpm"> | |
| ```bash | |
| pnpm install -g opencode-ai | |
| ``` | |
| </TabItem> | |
| <TabItem label="Yarn"> | |
| ```bash | |
| yarn global add opencode-ai | |
| ``` | |
| </TabItem> | |
| </Tabs> | |
| - **macOS/Linux์์ Homebrew ์ฌ์ฉ** | |
| ```bash | |
| brew install anomalyco/tap/opencode | |
| ``` | |
| > ์ต์ ๋ฆด๋ฆฌ์ค๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด OpenCode tap ์ฌ์ฉ์ ๊ถ์ฅํฉ๋๋ค. ๊ณต์ `brew install opencode` formula๋ Homebrew ํ์ด ๊ด๋ฆฌํ๋ฉฐ ์ ๋ฐ์ดํธ ์ฃผ๊ธฐ๊ฐ ๋ ๊น๋๋ค. | |
| - **Arch Linux์ ์ค์น** | |
| ```bash | |
| sudo pacman -S opencode # Arch Linux (Stable) | |
| paru -S opencode-bin # Arch Linux (Latest from AUR) | |
| ``` | |
| #### Windows | |
| :::tip[๊ถ์ฅ: WSL ์ฌ์ฉ] | |
| Windows์์๋ [Windows Subsystem for Linux (WSL)](/docs/windows-wsl) ์ฌ์ฉ์ ๊ถ์ฅํฉ๋๋ค. ์ฑ๋ฅ์ด ๋ ์ข๊ณ OpenCode ๊ธฐ๋ฅ๊ณผ์ ์์ ํ ํธํ์ฑ์ ์ ๊ณตํฉ๋๋ค. | |
| ::: | |
| - **Chocolatey ์ฌ์ฉ** | |
| ```bash | |
| choco install opencode | |
| ``` | |
| - **Scoop ์ฌ์ฉ** | |
| ```bash | |
| scoop install opencode | |
| ``` | |
| - **NPM ์ฌ์ฉ** | |
| ```bash | |
| npm install -g opencode-ai | |
| ``` | |
| - **Mise ์ฌ์ฉ** | |
| ```bash | |
| mise use -g github:anomalyco/opencode | |
| ``` | |
| - **Docker ์ฌ์ฉ** | |
| ```bash | |
| docker run -it --rm ghcr.io/anomalyco/opencode | |
| ``` | |
| ํ์ฌ Windows์์ Bun์ ์ฌ์ฉํ OpenCode ์ค์น ์ง์์ ์ค๋น ์ค์ ๋๋ค. | |
| [Releases](https://github.com/anomalyco/opencode/releases)์์ ๋ฐ์ด๋๋ฆฌ๋ฅผ ์ง์ ๋ฐ์ ์ค์นํ ์๋ ์์ต๋๋ค. | |
| --- | |
| ## ๊ตฌ์ฑ | |
| OpenCode๋ API ํค๋ฅผ ์ค์ ํ๋ฉด ์ํ๋ LLM ์ ๊ณต์๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค. | |
| LLM ์ ๊ณต์๋ฅผ ์ฒ์ ์ฌ์ฉํ๋ค๋ฉด [OpenCode Zen](/docs/zen) ์ฌ์ฉ์ ๊ถ์ฅํฉ๋๋ค. | |
| OpenCode ํ์ด ํ ์คํธํ๊ณ ๊ฒ์ฆํ ๋ชจ๋ธ ๋ชฉ๋ก์ ๋๋ค. | |
| 1. TUI์์ `/connect` ๋ช ๋ น์ ์คํํ๊ณ `opencode`๋ฅผ ์ ํํ ๋ค์ [opencode.ai/auth](https://opencode.ai/auth)๋ก ์ด๋ํฉ๋๋ค. | |
| ```txt | |
| /connect | |
| ``` | |
| 2. ๋ก๊ทธ์ธํ๊ณ ๊ฒฐ์ ์ ๋ณด๋ฅผ ์ถ๊ฐํ ๋ค API ํค๋ฅผ ๋ณต์ฌํฉ๋๋ค. | |
| 3. API ํค๋ฅผ ๋ถ์ฌ ๋ฃ์ต๋๋ค. | |
| ```txt | |
| โ API key | |
| โ | |
| โ | |
| โ enter | |
| ``` | |
| ๋๋ ๋ค๋ฅธ ์ ๊ณต์ ์ค ํ๋๋ฅผ ์ ํํ ์๋ ์์ต๋๋ค. [๋ ์์๋ณด๊ธฐ](/docs/providers#directory). | |
| --- | |
| ## ์ด๊ธฐํ | |
| ์ด์ ์ ๊ณต์ ๊ตฌ์ฑ์ ๋ง์ณค์ผ๋ ์์ ํ๋ ค๋ ํ๋ก์ ํธ๋ก ์ด๋ํฉ๋๋ค. | |
| ```bash | |
| cd /path/to/project | |
| ``` | |
| ๊ทธ๋ฆฌ๊ณ OpenCode๋ฅผ ์คํํฉ๋๋ค. | |
| ```bash | |
| opencode | |
| ``` | |
| ๋ค์ ๋ช ๋ น์ ์คํํด ํ๋ก์ ํธ์์ OpenCode๋ฅผ ์ด๊ธฐํํฉ๋๋ค. | |
| ```bash frame="none" | |
| /init | |
| ``` | |
| ์ด ๋ช ๋ น์ ์คํํ๋ฉด OpenCode๊ฐ ํ๋ก์ ํธ๋ฅผ ๋ถ์ํ๊ณ ํ๋ก์ ํธ ๋ฃจํธ์ `AGENTS.md` ํ์ผ์ ์์ฑํฉ๋๋ค. | |
| :::tip | |
| ํ๋ก์ ํธ์ `AGENTS.md` ํ์ผ์ Git์ ์ปค๋ฐํ๋ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค. | |
| ::: | |
| ์ด๋ ๊ฒ ํ๋ฉด OpenCode๊ฐ ํ๋ก์ ํธ ๊ตฌ์กฐ์ ์ฌ์ฉ ์ค์ธ ์ฝ๋ฉ ํจํด์ ๋ ์ ์ดํดํ ์ ์์ต๋๋ค. | |
| --- | |
| ## ์ฌ์ฉ๋ฒ | |
| ์ด์ OpenCode๋ก ํ๋ก์ ํธ ์์ ์ ์์ํ ์ค๋น๊ฐ ๋์์ต๋๋ค. ๋ฌด์์ด๋ ๋ฌผ์ด๋ณด์ธ์. | |
| AI coding agent๋ฅผ ์ฒ์ ์ฌ์ฉํ๋ค๋ฉด ๋์์ด ๋ ์ ์๋ ์์๋ฅผ ์๊ฐํฉ๋๋ค. | |
| --- | |
| ### ์ง๋ฌธํ๊ธฐ | |
| OpenCode์ ์ฝ๋๋ฒ ์ด์ค ์ค๋ช ์ ์์ฒญํ ์ ์์ต๋๋ค. | |
| :::tip | |
| ํ๋ก์ ํธ ํ์ผ์ `@` ํค๋ก ํผ์ง ๊ฒ์ํ ์ ์์ต๋๋ค. | |
| ::: | |
| ```txt frame="none" "@packages/functions/src/api/index.ts" | |
| How is authentication handled in @packages/functions/src/api/index.ts | |
| ``` | |
| ์ด ๋ฐฉ๋ฒ์ ์ง์ ์์ ํ์ง ์์ ์ฝ๋ ์์ญ์ ์ดํดํ ๋ ์ ์ฉํฉ๋๋ค. | |
| --- | |
| ### ๊ธฐ๋ฅ ์ถ๊ฐ | |
| OpenCode์ ํ๋ก์ ํธ์ ์ ๊ธฐ๋ฅ ์ถ๊ฐ๋ฅผ ์์ฒญํ ์ ์์ต๋๋ค. ๋ค๋ง ๋จผ์ ๊ณํ์ ๋ง๋ค๋๋ก ์์ฒญํ๋ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค. | |
| 1. **๊ณํ ๋ง๋ค๊ธฐ** | |
| OpenCode์๋ ๋ณ๊ฒฝ ์์ ๊ธฐ๋ฅ์ ๋นํ์ฑํํ๊ณ ๊ธฐ๋ฅ์ ๊ตฌํํ ๋ฐฉ๋ฒ๋ง ์ ์ํ๋ *Plan mode*๊ฐ ์์ต๋๋ค. | |
| **Tab** ํค๋ฅผ ๋๋ฌ ์ ํํ์ธ์. ํ๋ฉด ์ค๋ฅธ์ชฝ ์๋์์ ๋ชจ๋ ํ์๋ฅผ ํ์ธํ ์ ์์ต๋๋ค. | |
| ```bash frame="none" title="Switch to Plan mode" | |
| <TAB> | |
| ``` | |
| ์ด์ ์ํํ๊ธธ ์ํ๋ ์์ ์ ์ค๋ช ํด ๋ณด๊ฒ ์ต๋๋ค. | |
| ```txt frame="none" | |
| When a user deletes a note, we'd like to flag it as deleted in the database. | |
| Then create a screen that shows all the recently deleted notes. | |
| From this screen, the user can undelete a note or permanently delete it. | |
| ``` | |
| OpenCode๊ฐ ์ํ๋ ์์ ์ ์ดํดํ ์ ์๋๋ก ์ถฉ๋ถํ ์ธ๋ถ ์ ๋ณด๋ฅผ ์ ๊ณตํด์ผ ํฉ๋๋ค. ํ์ ์ฃผ๋์ด ๊ฐ๋ฐ์์๊ฒ ๋งํ๋ฏ์ด ์ค๋ช ํ๋ฉด ๋์์ด ๋ฉ๋๋ค. | |
| :::tip | |
| OpenCode๊ฐ ์ํ๋ ์์ ์ ์ดํดํ๋๋ก ์ถฉ๋ถํ ๋งฅ๋ฝ๊ณผ ์์๋ฅผ ์ ๊ณตํ์ธ์. | |
| ::: | |
| 2. **๊ณํ ๋ค๋ฌ๊ธฐ** | |
| ๊ณํ์ด ๋์ค๋ฉด ํผ๋๋ฐฑ์ ์ฃผ๊ฑฐ๋ ์ธ๋ถ ์ฌํญ์ ๋ ์ถ๊ฐํ ์ ์์ต๋๋ค. | |
| ```txt frame="none" | |
| We'd like to design this new screen using a design I've used before. | |
| [Image #1] Take a look at this image and use it as a reference. | |
| ``` | |
| :::tip | |
| ์ด๋ฏธ์ง๋ฅผ ํฐ๋ฏธ๋์ ๋๋๊ทธ ์ค ๋๋กญํด prompt์ ์ถ๊ฐํ์ธ์. | |
| ::: | |
| OpenCode๋ ์ ๊ณตํ ์ด๋ฏธ์ง๋ฅผ ์ค์บํด prompt์ ์ถ๊ฐํ ์ ์์ต๋๋ค. ์ด๋ฏธ์ง๋ฅผ ํฐ๋ฏธ๋์ ๋๋๊ทธ ์ค ๋๋กญํ๋ฉด ๋ฉ๋๋ค. | |
| 3. **๊ธฐ๋ฅ ๊ตฌํ** | |
| ๊ณํ์ด ์ถฉ๋ถํ ๋ง์์ ๋ค๋ฉด **Tab** ํค๋ฅผ ๋ค์ ๋๋ฌ *Build mode*๋ก ์ ํํ์ธ์. | |
| ```bash frame="none" | |
| <TAB> | |
| ``` | |
| ๊ทธ๋ฆฌ๊ณ ๋ณ๊ฒฝ์ ์ ์ฉํด ๋ฌ๋ผ๊ณ ์์ฒญํ์ธ์. | |
| ```bash frame="none" | |
| Sounds good! Go ahead and make the changes. | |
| ``` | |
| --- | |
| ### ๋ฐ๋ก ๋ณ๊ฒฝํ๊ธฐ | |
| ๋น๊ต์ ๊ฐ๋จํ ๋ณ๊ฒฝ์ ๊ณํ์ ๋จผ์ ๊ฒํ ํ์ง ์๊ณ ๋ฐ๋ก ๊ตฌํํ๋๋ก ์์ฒญํ ์ ์์ต๋๋ค. | |
| ```txt frame="none" "@packages/functions/src/settings.ts" "@packages/functions/src/notes.ts" | |
| We need to add authentication to the /settings route. Take a look at how this is | |
| handled in the /notes route in @packages/functions/src/notes.ts and implement | |
| the same logic in @packages/functions/src/settings.ts | |
| ``` | |
| OpenCode๊ฐ ์ฌ๋ฐ๋ฅธ ๋ณ๊ฒฝ์ ํ๋๋ก ์ถฉ๋ถํ ์ธ๋ถ ์ ๋ณด๋ฅผ ์ ๊ณตํด์ผ ํฉ๋๋ค. | |
| --- | |
| ### ๋ณ๊ฒฝ ๋๋๋ฆฌ๊ธฐ | |
| ์๋ฅผ ๋ค์ด OpenCode์ ๋ณ๊ฒฝ์ ์์ฒญํ๋ค๊ณ ํด๋ณด๊ฒ ์ต๋๋ค. | |
| ```txt frame="none" "@packages/functions/src/api/index.ts" | |
| Can you refactor the function in @packages/functions/src/api/index.ts? | |
| ``` | |
| ๊ทธ๋ฐ๋ฐ ์ํ๋ ๊ฒฐ๊ณผ๊ฐ ์๋์๋ค๋ฉด `/undo` ๋ช ๋ น์ผ๋ก ๋ณ๊ฒฝ์ **๋๋๋ฆด ์** ์์ต๋๋ค. | |
| ```bash frame="none" | |
| /undo | |
| ``` | |
| OpenCode๊ฐ ๋ฐฉ๊ธ ์ ์ฉํ ๋ณ๊ฒฝ์ ๋๋๋ฆฌ๊ณ ์๋ ๋ฉ์์ง๋ฅผ ๋ค์ ๋ณด์ฌ์ค๋๋ค. | |
| ```txt frame="none" "@packages/functions/src/api/index.ts" | |
| Can you refactor the function in @packages/functions/src/api/index.ts? | |
| ``` | |
| ์ฌ๊ธฐ์์ prompt๋ฅผ ์์ ํด ๋ค์ ์์ฒญํ ์ ์์ต๋๋ค. | |
| :::tip | |
| `/undo`๋ ์ฌ๋ฌ ๋ฒ ์ฐ์์ผ๋ก ์คํํ ์ ์์ต๋๋ค. | |
| ::: | |
| ๋๋ `/redo` ๋ช ๋ น์ผ๋ก ๋ณ๊ฒฝ์ **๋ค์ ์ ์ฉ**ํ ์ ์์ต๋๋ค. | |
| ```bash frame="none" | |
| /redo | |
| ``` | |
| --- | |
| ## ๊ณต์ | |
| OpenCode์์ ๋ํ๋ [ํ๊ณผ ๊ณต์ ](/docs/share)ํ ์ ์์ต๋๋ค. | |
| ```bash frame="none" | |
| /share | |
| ``` | |
| ์ด ๋ช ๋ น์ ์คํํ๋ฉด ํ์ฌ ๋ํ ๋งํฌ๋ฅผ ์์ฑํ๊ณ ํด๋ฆฝ๋ณด๋์ ๋ณต์ฌํฉ๋๋ค. | |
| :::note | |
| ๋ํ๋ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ๊ณต์ ๋์ง ์์ต๋๋ค. | |
| ::: | |
| ๋ค์์ OpenCode [๋ํ ์์](https://opencode.ai/s/4XP1fce5)์ ๋๋ค. | |
| --- | |
| ## ์ฌ์ฉ์ ์ง์ | |
| ์ด์ OpenCode ์ฌ์ฉ๋ฒ์ ์ตํ์ต๋๋ค. | |
| ์ํ๋ ๋ฐฉ์์ ๋ง์ถ๋ ค๋ฉด [ํ ๋ง ์ ํ](/docs/themes), [ํค๋ฐ์ธ๋ ์ฌ์ฉ์ ์ง์ ](/docs/keybinds), [์ฝ๋ formatter ์ค์ ](/docs/formatters), [custom command ๋ง๋ค๊ธฐ](/docs/commands), [OpenCode config ์ค์ ](/docs/config)์ ๊ถ์ฅํฉ๋๋ค. | |