diff options
| author | David Hill <[email protected]> | 2025-11-10 13:44:12 +0000 |
|---|---|---|
| committer | David Hill <[email protected]> | 2025-11-10 13:44:12 +0000 |
| commit | c6e830c954418808dc39284a1c073aa63a6d4d21 (patch) | |
| tree | 9c3052e0509115188768a553c0be5a8441ebdd96 /packages/web/src/content/docs | |
| parent | 7088bfabd773e2f076aab1c9d2468c04feff0570 (diff) | |
| parent | fc78c28df64383a9f99382093f61fc28caf6569f (diff) | |
| download | opencode-c6e830c954418808dc39284a1c073aa63a6d4d21.tar.gz opencode-c6e830c954418808dc39284a1c073aa63a6d4d21.zip | |
Merge branch 'dev' of https://github.com/sst/opencode into dev
Diffstat (limited to 'packages/web/src/content/docs')
| -rw-r--r-- | packages/web/src/content/docs/1-0.mdx | 3 | ||||
| -rw-r--r-- | packages/web/src/content/docs/cli.mdx | 12 | ||||
| -rw-r--r-- | packages/web/src/content/docs/formatters.mdx | 2 | ||||
| -rw-r--r-- | packages/web/src/content/docs/index.mdx | 30 | ||||
| -rw-r--r-- | packages/web/src/content/docs/permissions.mdx | 1 | ||||
| -rw-r--r-- | packages/web/src/content/docs/providers.mdx | 56 | ||||
| -rw-r--r-- | packages/web/src/content/docs/troubleshooting.mdx | 2 | ||||
| -rw-r--r-- | packages/web/src/content/docs/zen.mdx | 10 |
8 files changed, 92 insertions, 24 deletions
diff --git a/packages/web/src/content/docs/1-0.mdx b/packages/web/src/content/docs/1-0.mdx index 49db53d72..6737482a7 100644 --- a/packages/web/src/content/docs/1-0.mdx +++ b/packages/web/src/content/docs/1-0.mdx @@ -16,13 +16,14 @@ The new TUI works like the old one since it connects to the same opencode server You should not be autoupgraded to 1.0 if you are currently using a previous version. However some older versions of OpenCode always grab latest. - To upgrade manually, run + ```bash $ opencode upgrade 1.0.0 ``` To downgrade back to 0.x, run + ```bash $ opencode upgrade 0.15.31 ``` diff --git a/packages/web/src/content/docs/cli.mdx b/packages/web/src/content/docs/cli.mdx index 1312442d6..083db369b 100644 --- a/packages/web/src/content/docs/cli.mdx +++ b/packages/web/src/content/docs/cli.mdx @@ -184,6 +184,16 @@ This is useful for scripting, automation, or when you want a quick answer withou opencode run Explain the use of context in Go ``` +You can also attach to a running `opencode serve` instance to avoid MCP server cold boot times on every run: + +```bash +# Start a headless server in one terminal +opencode serve + +# In another terminal, run commands that attach to it +opencode run --attach http://localhost:4096 "Explain async/await in JavaScript" +``` + #### Flags | Flag | Short | Description | @@ -197,6 +207,8 @@ opencode run Explain the use of context in Go | `--file` | `-f` | File(s) to attach to message | | `--format` | | Format: default (formatted) or json (raw JSON events) | | `--title` | | Title for the session (uses truncated prompt if no value provided) | +| `--attach` | | Attach to a running opencode server (e.g., http://localhost:4096) | +| `--port` | | Port for the local server (defaults to random port) | --- diff --git a/packages/web/src/content/docs/formatters.mdx b/packages/web/src/content/docs/formatters.mdx index 8853ca334..9fc41a53d 100644 --- a/packages/web/src/content/docs/formatters.mdx +++ b/packages/web/src/content/docs/formatters.mdx @@ -21,9 +21,11 @@ OpenCode comes with several built-in formatters for popular languages and framew | clang-format | .c, .cpp, .h, .hpp, .ino, and [more](https://clang.llvm.org/docs/ClangFormat.html) | `.clang-format` config file | | ktlint | .kt, .kts | `ktlint` command available | | ruff | .py, .pyi | `ruff` command available with config | +| uv | .py, .pyi | `uv` command available | | rubocop | .rb, .rake, .gemspec, .ru | `rubocop` command available | | standardrb | .rb, .rake, .gemspec, .ru | `standardrb` command available | | htmlbeautifier | .erb, .html.erb | `htmlbeautifier` command available | +| air | .R | `air` command available | So if your project has `prettier` in your `package.json`, OpenCode will automatically use it. diff --git a/packages/web/src/content/docs/index.mdx b/packages/web/src/content/docs/index.mdx index f6d2b3129..20c0d2f99 100644 --- a/packages/web/src/content/docs/index.mdx +++ b/packages/web/src/content/docs/index.mdx @@ -41,28 +41,36 @@ You can also install it with the following commands: - **Using Node.js** - <Tabs> + <Tabs> + <TabItem label="npm"> - ```bash - npm install -g opencode-ai - ``` - </TabItem> - <TabItem label="Bun"> + ```bash + npm install -g opencode-ai + ``` + + </TabItem> + + <TabItem label="Bun"> ```bash bun install -g opencode-ai ``` - </TabItem> - <TabItem label="pnpm"> + + </TabItem> + + <TabItem label="pnpm"> ```bash pnpm install -g opencode-ai ``` - </TabItem> - <TabItem label="Yarn"> + + </TabItem> + + <TabItem label="Yarn"> ```bash yarn global add opencode-ai ``` + </TabItem> - </Tabs> +</Tabs> - **Using Homebrew on macOS and Linux** diff --git a/packages/web/src/content/docs/permissions.mdx b/packages/web/src/content/docs/permissions.mdx index 4579c2127..a0ba5d5d9 100644 --- a/packages/web/src/content/docs/permissions.mdx +++ b/packages/web/src/content/docs/permissions.mdx @@ -187,4 +187,3 @@ permission: Only analyze code and suggest changes. ``` - diff --git a/packages/web/src/content/docs/providers.mdx b/packages/web/src/content/docs/providers.mdx index 41e6308f7..6a7520e56 100644 --- a/packages/web/src/content/docs/providers.mdx +++ b/packages/web/src/content/docs/providers.mdx @@ -301,6 +301,42 @@ Or if you already have an API key, you can select **Manually enter API Key** and --- +### Deep Infra + +1. Head over to the [Deep Infra dashboard](https://deepinfra.com/dash), create an account, and generate an API key. + +2. Run `opencode auth login` and select **Deep Infra**. + + ```bash + $ opencode auth login + + ┌ Add credential + │ + ◆ Select provider + │ ● Deep Infra + │ ... + └ + ``` + +3. Enter your Deep Infra API key. + + ```bash + $ opencode auth login + + ┌ Add credential + │ + ◇ Select provider + │ Deep Infra + │ + ◇ Enter your API key + │ _ + └ + ``` + +4. Run the `/models` command to select a model. + +--- + ### Fireworks AI 1. Head over to the [Fireworks AI console](https://app.fireworks.ai/), create an account, and click **Create API Key**. @@ -482,7 +518,6 @@ To use Google Vertex AI with OpenCode: 4. Run the `/models` command to select a model like _Kimi-K2-Instruct_ or _GLM-4.6_. - --- ### LM Studio @@ -935,9 +970,9 @@ You can use any OpenAI-compatible provider with opencode. Most modern AI provide ##### Example -Here's an example setting the `apiKey` and `headers` options. +Here's an example setting the `apiKey`, `headers`, and model `limit` options. -```json title="opencode.json" {9,11} +```json title="opencode.json" {9,11,17-20} { "$schema": "https://opencode.ai/config.json", "provider": { @@ -953,7 +988,11 @@ Here's an example setting the `apiKey` and `headers` options. }, "models": { "my-model-name": { - "name": "My Model Display Name" + "name": "My Model Display Name", + "limit": { + "context": 200000, + "output": 65536 + } } } } @@ -961,7 +1000,14 @@ Here's an example setting the `apiKey` and `headers` options. } ``` -We are setting the `apiKey` using the `env` variable syntax, [learn more](/docs/config#env-vars). +Configuration details: + +- **apiKey**: Set using `env` variable syntax, [learn more](/docs/config#env-vars). +- **headers**: Custom headers sent with each request. +- **limit.context**: Maximum input tokens the model accepts. +- **limit.output**: Maximum tokens the model can generate. + +The `limit` fields allow OpenCode to understand how much context you have left. Standard providers pull these from models.dev automatically. --- diff --git a/packages/web/src/content/docs/troubleshooting.mdx b/packages/web/src/content/docs/troubleshooting.mdx index fb8e964ba..d38b892fc 100644 --- a/packages/web/src/content/docs/troubleshooting.mdx +++ b/packages/web/src/content/docs/troubleshooting.mdx @@ -90,8 +90,8 @@ If you encounter `ProviderModelNotFoundError` you are most likely incorrectly referencing a model somewhere. Models should be referenced like so: `<providerId>/<modelId>` - Examples: + - `openai/gpt-4.1` - `openrouter/google/gemini-2.5-flash` - `opencode/kimi-k2` diff --git a/packages/web/src/content/docs/zen.mdx b/packages/web/src/content/docs/zen.mdx index d2da4a51c..6c9b9fb88 100644 --- a/packages/web/src/content/docs/zen.mdx +++ b/packages/web/src/content/docs/zen.mdx @@ -75,6 +75,7 @@ You can also access our models through the following API endpoints. | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Grok Code Fast 1 | grok-code | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | +| Big Pickle | big-pickle | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | The [model id](/docs/config/#models) in your OpenCode config uses the format `opencode/<model-id>`. For example, for GPT 5 Codex, you would @@ -117,8 +118,8 @@ We support a pay-as-you-go model. Below are the prices **per 1M tokens**. | GLM 4.6 | $0.60 | $2.20 | $0.10 | - | | Kimi K2 | $0.60 | $2.50 | $0.36 | - | | Qwen3 Coder 480B | $0.45 | $1.50 | - | - | -| Grok Code Fast 1 | Free | Free | - | - | -| Code Supernova | Free | Free | - | - | +| Grok Code Fast 1 | Free | Free | Free | - | +| Big Pickle | Free | Free | Free | - | | Claude Sonnet 4.5 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | | Claude Sonnet 4.5 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 | | Claude Sonnet 4 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 | @@ -138,7 +139,7 @@ Credit card fees are passed along at cost; we don't charge anything beyond that. The free models: - Grok Code Fast 1 is currently free on OpenCode for a limited time. The xAI team is using this time to collect feedback and improve Grok Code. -- Code Supernova is a stealth model that's free on OpenCode for a limited time. The team is using this time to collect feedback and improve the model. +- Big Pickle is a stealth model that's free on OpenCode for a limited time. The team is using this time to collect feedback and improve the model. :::tip Subscription plans and a free tier are coming soon. @@ -153,8 +154,7 @@ Subscription plans and a free tier are coming soon. All our models are hosted in the US. Our providers follow a zero-retention policy and do not use your data for model training, with the following exceptions: - Grok Code Fast 1: During its free period, collected data may be used to improve Grok Code. -- Code Supernova: During its free period, collected data may be used to improve - the model. +- Big Pickle: During its free period, collected data may be used to improve the model. - OpenAI APIs: Requests are retained for 30 days in accordance with [OpenAI's Data Policies](https://platform.openai.com/docs/guides/your-data). - Anthropic APIs: Requests are retained for 30 days in accordance with [Anthropic's Data Policies](https://docs.anthropic.com/en/docs/claude-code/data-usage). |
