Tools
Tools enable LLMs to perform actions within your codebase. OpenCode provides built-in tools with the ability to extend through custom tools and MCP servers.
Configuration
Tools are managed through the permission field in opencode.json:
"allow"- Execute without approval"deny"- Prevent execution"ask"- Require user approval
{
"permission": {
"edit": "ask",
"bash": "ask"
}
}Wildcard patterns supported: "mcp_*" for multiple tools.
Built-in Tools
File Operations
| Tool | Purpose |
|---|---|
| read | Retrieve file contents |
| write | Create or overwrite files |
| edit | Precise string replacements |
| patch | Apply diffs and patches |
Search & Discovery
| Tool | Purpose |
|---|---|
| grep | Search with regular expressions |
| glob | Find files by pattern |
| list | Enumerate directory contents |
Execution & Integration
| Tool | Purpose |
|---|---|
| bash | Execute shell commands |
| lsp | Code intelligence (experimental) |
Specialized Tools
| Tool | Purpose |
|---|---|
| skill | Load SKILL.md content |
| webfetch | Fetch web pages |
| question | Ask user questions |
| todowrite/todoread | Manage task lists |
File Ignoring
By default, search tools respect .gitignore. Create a .ignore file to allow searching otherwise-ignored directories.