75+ Tools

Built-in Tools Catalog

Every tool at your disposal, organized by category. Tools are automatically selected by the AI based on your requests.

12
File Operations
8
Search & Navigation
11
Git Integration
4
Web & Network
6
Code Execution
6
LSP Integration
8
Session & History
6
Edit & Review
4
Analysis
4
Undo & Redo
3
Skills & Plugins
2
Clipboard
3
MCP & Custom Tools
9
OpenCode Architecture
read_file(path: str, start_line?: int, end_line?: int)

Read a file with line numbers. Returns the full content with line-by-line numbering.

Example:"Read src/main.py"
write_file(path: str, content: str)

Create or overwrite a file with the given content. Creates parent directories automatically.

Example:"Create config.json with default settings"
edit_file(path: str, old_string: str, new_string: str)

Replace a unique string in a file. Finds the exact match and replaces it. Safer than write_file for targeted changes.

Example:"Fix the bug on line 42 in auth.py"
delete_file(path: str)

Delete a file or directory. Requires confirmation before deletion.

Example:"Delete old_file.txt"
create_directory(path: str)

Create a directory tree. Creates all parent directories as needed.

Example:"Create src/utils/helpers/"
list_files(path: str, recursive?: bool)

List files and directories at the given path. Shows names, types, and sizes.

Example:"List all files in src/"
search_in_files(pattern: str, path?: str, file_pattern?: str)

Regex search across files. Returns matching lines with file paths and line numbers.

Example:"Find all TODO comments in the project"
glob_search(pattern: str, path?: str)

Find files matching a glob pattern. Supports ** for recursive search.

Example:"Find all .py files in src/"
apply_patch(path: str, patch: str)

Apply a unified diff patch to a file. Precise multi-line edits.

Example:"Apply the formatting patch to main.py"
batch_read(paths: list[str])

Read multiple files at once. Efficient for reading several related files.

Example:"Read all config files"
get_file_tree(path?: str, max_depth?: int)

Get the complete directory tree structure. Shows the full project hierarchy.

Example:"Show the project structure"
diff_files(path1: str, path2: str)

Compare two files and show differences. Returns a unified diff.

Example:"Compare config.old and config.new"

How Tools Work

1. You Ask

Type your request in natural language. APEX understands what you need and selects the right tools.

2. Agent Selects

The current agent analyzes your request, checks permissions, and calls the appropriate tool with the right parameters.

3. Tool Executes

The tool executes safely, returns results, and the agent uses them to continue the conversation or take further action.