Tool calling for providers without native function calling.
Fork of anomalyco/opencode — integrates @ai-sdk-tool/parser middleware so that tools work through text-based protocols (Hermes, XML) instead of the structured tools API parameter.
npx opencode-ai-nofc
# or install globally
npm i -g opencode-ai-nofc
# or download pre-built binary
curl -fsSL https://github.com/okuyam2y/opencode-nofc/releases/latest/download/opencode-$(uname -s | tr A-Z a-z)-$(uname -m).tar.gz | tar xz
./opencode
# or build from source
git clone https://github.com/okuyam2y/opencode-nofc.git
cd opencode-nofc && bun install && bun turbo buildMany API gateways and self-hosted inference servers (vLLM, LiteLLM, custom proxies) strip or ignore the tools parameter from OpenAI-compatible requests. Without native function calling, OpenCode's tools — read, write, bash, and others — simply don't work.
This fork solves the problem by parsing tool calls directly from model text output. The model writes <tool_call> tags in plain text, and the parser middleware converts them into standard AI SDK tool-call events.
Add toolParser to your provider options in opencode.json:
| Mode | Description |
|---|---|
hermes-strict |
Recommended. Strict JSON format with explicit rules in system prompt. Most reliable. |
hermes |
Standard Hermes protocol. Fallback if hermes-strict causes issues. |
xml |
Pure XML format for models trained on XML tool calling. |
Beyond the tool parser, this fork adds:
- Streaming tag filter — removes
<tool_call>/<tool_response>tags leaked into visible output - Tool call deduplication — drops duplicate tool executions within the same LLM step
apply_patch→edit/writeauto-substitution — replaces diff-based editing with line-based tools when the tool parser is active- PDF / DOCX / XLSX text extraction and macOS Vision OCR
- Finish reason handling — converts
unknownfinish reasons to terminal states, with loop guardrails
Setup guide → — per-model settings, model compatibility table, and troubleshooting.
This fork tracks the upstream dev branch and is regularly rebased. Bug fixes are submitted as PRs when applicable.
- npm:
opencode-ai-nofc(separate from the officialopencode-aipackage) - Related: #2917 (custom tool parser request) · #1122 (vLLM + Hermes)
- License: MIT (same as upstream)
The original OpenCode README follows below.
The open source AI coding agent.
English | 简体中文 | 繁體中文 | 한국어 | Deutsch | Español | Français | Italiano | Dansk | 日本語 | Polski | Русский | Bosanski | العربية | Norsk | Português (Brasil) | ไทย | Türkçe | Українська | বাংলা | Ελληνικά | Tiếng Việt
# YOLO
curl -fsSL https://opencode.ai/install | bash
# Package managers
npm i -g opencode-ai@latest # or bun/pnpm/yarn
scoop install opencode # Windows
choco install opencode # Windows
brew install anomalyco/tap/opencode # macOS and Linux (recommended, always up to date)
brew install opencode # macOS and Linux (official brew formula, updated less)
sudo pacman -S opencode # Arch Linux (Stable)
paru -S opencode-bin # Arch Linux (Latest from AUR)
mise use -g opencode # Any OS
nix run nixpkgs#opencode # or github:anomalyco/opencode for latest dev branchTip
Remove versions older than 0.1.x before installing.
OpenCode is also available as a desktop application. Download directly from the releases page or opencode.ai/download.
| Platform | Download |
|---|---|
| macOS (Apple Silicon) | opencode-desktop-mac-arm64.dmg |
| macOS (Intel) | opencode-desktop-mac-x64.dmg |
| Windows | opencode-desktop-windows-x64.exe |
| Linux | .deb, .rpm, or .AppImage |
# macOS (Homebrew)
brew install --cask opencode-desktop
# Windows (Scoop)
scoop bucket add extras; scoop install extras/opencode-desktopThe install script respects the following priority order for the installation path:
$OPENCODE_INSTALL_DIR- Custom installation directory$XDG_BIN_DIR- XDG Base Directory Specification compliant path$HOME/bin- Standard user binary directory (if it exists or can be created)$HOME/.opencode/bin- Default fallback
# Examples
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bashOpenCode includes two built-in agents you can switch between with the Tab key.
- build - Default, full-access agent for development work
- plan - Read-only agent for analysis and code exploration
- Denies file edits by default
- Asks permission before running bash commands
- Ideal for exploring unfamiliar codebases or planning changes
Also included is a general subagent for complex searches and multistep tasks.
This is used internally and can be invoked using @general in messages.
Learn more about agents.
For more info on how to configure OpenCode, head over to our docs.
If you're interested in contributing to OpenCode, please read our contributing docs before submitting a pull request.
If you are working on a project that's related to OpenCode and is using "opencode" as part of its name, for example "opencode-dashboard" or "opencode-mobile", please add a note to your README to clarify that it is not built by the OpenCode team and is not affiliated with us in any way.

{ "provider": { "my-gateway": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "https://your-gateway/v1", "toolParser": "hermes-strict" }, "models": { "your-model": { "name": "Your Model", "limit": { "context": 200000, "output": 32768 } } } } } }