| --- |
| title: Web |
| description: ๋ธ๋ผ์ฐ์ ์์ OpenCode ์ฌ์ฉํ๊ธฐ. |
| --- |
| |
| opencode๋ ๋ธ๋ผ์ฐ์ ์์ ์น ์์ฉ ํ๋ก๊ทธ๋จ์ ์คํํ ์ ์์ผ๋ฉฐ terminal์ ํ์๋กํ์ง ์๊ณ ๋์ผํ ๊ฐ๋ ฅํ AI ์ฝ๋ฉ ๊ฒฝํ์ ์ ๊ณตํฉ๋๋ค. |
|
|
|  |
|
|
| |
|
|
| ์คํํ์ฌ ์น ์ธํฐํ์ด์ค๋ฅผ ์์: |
|
|
| ```bash |
| opencode web |
| ``` |
|
|
| `127.0.0.1`์ ๋ก์ปฌ ์๋ฒ๋ฅผ ๋๋ค ์ฌ์ฉ ๊ฐ๋ฅํ ํฌํธ๋ก ์์ํ๊ณ ๊ธฐ๋ณธ ๋ธ๋ผ์ฐ์ ์์ opencode๋ฅผ ์๋์ผ๋ก ์ฝ๋๋ค. |
|
|
| :::caution |
| `OPENCODE_SERVER_PASSWORD`๊ฐ ์ค์ ๋์ง ์์ ๊ฒฝ์ฐ ์๋ฒ๊ฐ ์ค๋จ๋์ง ์์ต๋๋ค. ์ด๊ฒ์ ๋ก์ปฌ ์ฌ์ฉ์์ํ ๊ด์ฐฎ์ง๋ง ๋คํธ์ํฌ ์ก์ธ์ค๋ฅผ ์ค์ ํด์ผํฉ๋๋ค. |
| ::: |
|
|
| :::tip[Windows ์ฌ์ฉ์] |
| ์ต๊ณ ์ ๊ฒฝํ์ ์ํด์๋ PowerShell๋ณด๋ค `opencode web`๋ฅผ ์คํํ์ญ์์ค. ์ ์ ํ ํ์ผ ์์คํ
์ก์ธ์ค ๋ฐ terminal ํตํฉ์ ๋ณด์ฅํฉ๋๋ค. |
| ::: |
|
|
| --- |
| |
| |
|
|
| ๋ช
๋ น์ค ํ๋๊ทธ ๋๋ [config file](/docs/config)์์ ์น ์๋ฒ๋ฅผ ๊ตฌ์ฑํ ์ ์์ต๋๋ค. |
|
|
| |
|
|
| ๊ธฐ๋ณธ์ ์ผ๋ก opencode๋ ์ฌ์ฉํ ์ ์๋ ํฌํธ๋ฅผ ์ ํํฉ๋๋ค. ํฌํธ๋ฅผ ์ง์ ํ ์ ์์ต๋๋ค: |
|
|
| ```bash |
| opencode web --port 4096 |
| ``` |
|
|
| |
|
|
| ๊ธฐ๋ณธ์ ์ผ๋ก ์๋ฒ๋ `127.0.0.1` (localhost only)์ ๋ฐ์ธ๋ฉํฉ๋๋ค. ๋คํธ์ํฌ์์ opencode๋ฅผ ์ฌ์ฉํ ์ ์๋๋ก: |
|
|
| ```bash |
| opencode web --hostname 0.0.0.0 |
| ``` |
|
|
| `0.0.0.0`๋ฅผ ์ฌ์ฉํ ๋, opencode๋ ๋ก์ปฌ ๋ฐ ๋คํธ์ํฌ ์ฃผ์๋ฅผ ๋ชจ๋ ํ์ํฉ๋๋ค. |
|
|
| ``` |
| Local access: http://localhost:4096 |
| Network access: http://192.168.1.100:4096 |
| ``` |
|
|
| |
|
|
| ๋ก์ปฌ ๋คํธ์ํฌ์์ ์๋ฒ๋ฅผ ๋ฐ๊ฒฌํ ์ ์๋ mDNS: |
|
|
| ```bash |
| opencode web --mdns |
| ``` |
|
|
| ์ด ์๋์ผ๋ก `0.0.0.0`์ hostname์ ์ค์ ํ๊ณ `opencode.local`๋ก ์๋ฒ๋ฅผ ๊ด๊ณ ํฉ๋๋ค. |
|
|
| ๋์ผํ ๋คํธ์ํฌ์์ ์ฌ๋ฌ ์ธ์คํด์ค๋ฅผ ์คํํ๋ ค๋ฉด mDNS ๋๋ฉ์ธ ์ด๋ฆ์ ์ง์ ํ ์ ์์ต๋๋ค. |
|
|
| ```bash |
| opencode web --mdns --mdns-domain myproject.local |
| ``` |
|
|
| |
|
|
| CORS์ ๋ํ ์ถ๊ฐ ๋๋ฉ์ธ์ ํ์ฉํ๋ ค๋ฉด (์ฌ์ฉ์ ์ ์ frontends์ ์ ํฉ) : |
|
|
| ```bash |
| opencode web --cors https://example.com |
| ``` |
|
|
| |
|
|
| ์ก์ธ์ค๋ฅผ ๋ณดํธํ๋ ค๋ฉด `OPENCODE_SERVER_PASSWORD` ํ๊ฒฝ ๋ณ์๋ฅผ ์ฌ์ฉํ์ฌ ์ํธ๋ฅผ ์ค์ ํ์ญ์์ค. |
|
|
| ```bash |
| OPENCODE_SERVER_PASSWORD=secret opencode web |
| ``` |
|
|
| `opencode`์ ๋ํ ์ฌ์ฉ์์ ๊ธฐ๋ณธ๊ฐ์ `OPENCODE_SERVER_USERNAME`๋ก ๋ณ๊ฒฝํ ์ ์์ต๋๋ค. |
|
|
| --- |
| |
| |
|
|
| ์์๋๋ฉด ์น ์ธํฐํ์ด์ค๋ opencode ์ธ์
์ ์ก์ธ์ค ํ ์ ์์ต๋๋ค. |
|
|
| |
|
|
| ํํ์ด์ง์์ ์ธ์
์ ๋ณด๊ณ ๊ด๋ฆฌํฉ๋๋ค. ํ์ฑ ์ธ์
์ ๋ณผ ์ ์์ผ๋ฉฐ ์๋ก์ด ๊ฒ์ ์์ํฉ๋๋ค. |
|
|
|  |
|
|
| |
|
|
| "See Servers"๋ฅผ ํด๋ฆญํ์ฌ ์ฐ๊ฒฐ๋ ์๋ฒ์ ์ํ๋ฅผ ๋ณผ ์ ์์ต๋๋ค. |
|
|
|  |
|
|
| --- |
| |
| |
|
|
| ์คํ ์น ์๋ฒ์ terminal TUI๋ฅผ ์ฐ๊ฒฐํ ์ ์์ต๋๋ค. |
|
|
| ```bash |
| |
| opencode web --port 4096 |
|
|
| |
| opencode attach http://localhost:4096 |
| ``` |
|
|
| ์น ์ธํฐํ์ด์ค์ terminal์ ๋์์ ์ฌ์ฉํ ์ ์๋๋ก, ๊ฐ์ ์ธ์
๊ณผ ์ํ๋ฅผ ๊ณต์ ํฉ๋๋ค. |
|
|
| --- |
| |
| |
|
|
| `opencode.json` config ํ์ผ์์ ์๋ฒ ์ค์ ์ ๊ตฌ์ฑํ ์ ์์ต๋๋ค: |
|
|
| ```json |
| { |
| "server": { |
| "port": 4096, |
| "hostname": "0.0.0.0", |
| "mdns": true, |
| "cors": ["https://example.com"] |
| } |
| } |
| ``` |
|
|
| Command line flags๋ config ํ์ผ ์ค์ ์ ๋ํ precedence๋ฅผ ๊ฐ์ ธ์ต๋๋ค. |
|
|