docs: new configurable CORS option (#6522)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
This commit is contained in:
opencode-agent[bot]
2025-12-31 11:11:20 -06:00
committed by GitHub
parent 840fe030ab
commit c42bd492ea
3 changed files with 28 additions and 17 deletions

View File

@@ -13,16 +13,23 @@ The `opencode serve` command runs a headless HTTP server that exposes an OpenAPI
### Usage
```bash
opencode serve [--port <number>] [--hostname <string>]
opencode serve [--port <number>] [--hostname <string>] [--cors <origin>]
```
#### Options
| Flag | Description | Default |
| ------------ | --------------------- | ----------- |
| `--port` | Port to listen on | `4096` |
| `--hostname` | Hostname to listen on | `127.0.0.1` |
| `--mdns` | Enable mDNS discovery | `false` |
| Flag | Description | Default |
| ------------ | ----------------------------------- | ----------- |
| `--port` | Port to listen on | `4096` |
| `--hostname` | Hostname to listen on | `127.0.0.1` |
| `--mdns` | Enable mDNS discovery | `false` |
| `--cors` | Additional browser origins to allow | `[]` |
`--cors` can be passed multiple times:
```bash
opencode serve --cors http://localhost:5173 --cors https://app.example.com
```
---