diff --git a/packages/web/astro.config.mjs b/packages/web/astro.config.mjs index fb7bd75b..3bcd98cb 100644 --- a/packages/web/astro.config.mjs +++ b/packages/web/astro.config.mjs @@ -74,6 +74,7 @@ export default defineConfig({ { label: "Configure", items: [ + "tools", "rules", "agents", "models", diff --git a/packages/web/src/content/docs/agents.mdx b/packages/web/src/content/docs/agents.mdx index 7016d657..e15ba6cb 100644 --- a/packages/web/src/content/docs/agents.mdx +++ b/packages/web/src/content/docs/agents.mdx @@ -303,27 +303,33 @@ Use the `model` config to override the default model for this agent. Useful for Control which tools are available in this agent with the `tools` config. You can enable or disable specific tools by setting them to `true` or `false`. -```json title="opencode.json" +```json title="opencode.json" {3-6,9-12} { + "$schema": "https://opencode.ai/config.json", + "tools": { + "write": true, + "bash": true + }, "agent": { - "readonly": { + "plan": { "tools": { "write": false, - "edit": false, - "bash": false, - "read": true, - "grep": true, - "glob": true + "bash": false } } } } ``` +:::note +The agent-specific config overrides the global config. +::: + You can also use wildcards to control multiple tools at once. For example, to disable all tools from an MCP server: ```json title="opencode.json" { + "$schema": "https://opencode.ai/config.json", "agent": { "readonly": { "tools": { @@ -336,27 +342,7 @@ You can also use wildcards to control multiple tools at once. For example, to di } ``` -If no tools are specified, all tools are enabled by default. - ---- - -#### Available tools - -Here are all the tools can be controlled through the agent config. - -| Tool | Description | -| ----------- | ----------------------- | -| `bash` | Execute shell commands | -| `edit` | Modify existing files | -| `write` | Create new files | -| `read` | Read file contents | -| `grep` | Search file contents | -| `glob` | Find files by pattern | -| `list` | List directory contents | -| `patch` | Apply patches to files | -| `todowrite` | Manage todo lists | -| `todoread` | Read todo lists | -| `webfetch` | Fetch web content | +[Learn more about tools](/docs/tools). --- diff --git a/packages/web/src/content/docs/config.mdx b/packages/web/src/content/docs/config.mdx index d996cb94..f3b2a05a 100644 --- a/packages/web/src/content/docs/config.mdx +++ b/packages/web/src/content/docs/config.mdx @@ -86,6 +86,24 @@ You can configure TUI-specific settings through the `tui` option. --- +### Tools + +You can manage the tools an LLM can use through the `tools` option. + +```json title="opencode.json" +{ + "$schema": "https://opencode.ai/config.json", + "tools": { + "write": false, + "bash": false + } +} +``` + +[Learn more about tools here](/docs/tools). + +--- + ### Models You can configure the providers and models you want to use in your OpenCode config through the `provider`, `model` and `small_model` options. diff --git a/packages/web/src/content/docs/custom-tools.mdx b/packages/web/src/content/docs/custom-tools.mdx index d982475e..3f4cf06b 100644 --- a/packages/web/src/content/docs/custom-tools.mdx +++ b/packages/web/src/content/docs/custom-tools.mdx @@ -3,7 +3,7 @@ title: Custom Tools description: Create tools the LLM can call in opencode. --- -Custom tools are functions you create that the LLM can call during conversations. They work alongside opencode's built-in tools like `read`, `write`, and `bash`. +Custom tools are functions you create that the LLM can call during conversations. They work alongside opencode's [built-in tools](/docs/tools) like `read`, `write`, and `bash`. --- diff --git a/packages/web/src/content/docs/tools.mdx b/packages/web/src/content/docs/tools.mdx index f323ac10..11761d4c 100644 --- a/packages/web/src/content/docs/tools.mdx +++ b/packages/web/src/content/docs/tools.mdx @@ -303,7 +303,7 @@ Internally, tools like `grep`, `glob`, and `list` use [ripgrep](https://github.c --- -### Override ignore patterns +### Ignore patterns To include files that would normally be ignored, create a `.ignore` file in your project root. This file can explicitly allow certain paths. @@ -314,5 +314,3 @@ To include files that would normally be ignored, create a `.ignore` file in your ``` For example, this `.ignore` file allows ripgrep to search within `node_modules/`, `dist/`, and `build/` directories even if they're listed in `.gitignore`. - -The `.ignore` file follows ripgrep's ignore file syntax. Patterns prefixed with `!` negate the ignore rules from `.gitignore`. diff --git a/packages/web/src/content/docs/zen.mdx b/packages/web/src/content/docs/zen.mdx index 6bbe34a8..f1c2b333 100644 --- a/packages/web/src/content/docs/zen.mdx +++ b/packages/web/src/content/docs/zen.mdx @@ -66,6 +66,7 @@ You can also access our models through the following API endpoints. | ---------------- | ---------------- | --------------------------------------------- | --------------------------- | | GPT 5 | gpt-5 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5 Codex | gpt-5-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | +| Claude Sonnet 4.5 | claude-sonnet-4-5 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Sonnet 4 | claude-sonnet-4 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Haiku 3.5 | claude-3-5-haiku | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` | | Claude Opus 4.1 | claude-opus-4-1 | `https://opencode.ai/zen/v1/messages` | `@ai-sdk/anthropic` |