Skip to main content
OpenCode V2 accepts formatter configuration, but it does not yet include a formatter runtime. File writes and edits are not automatically formatted.
V2 currently has no built-in formatters. The built-in formatter list and automatic post-edit formatting documented for V1 do not apply to V2.

Configuration

The formatter field accepts a boolean or an object keyed by formatter name:
opencode.jsonc
This example is valid V2 configuration, but V2 does not currently execute the command. Each named formatter entry supports these optional fields: All entry fields are optional. The schema therefore also accepts an empty entry such as "prettier": {}.

Enable and disable

The schema accepts all of the following forms:
At present, omitted, false, true, and object forms have the same runtime result: V2 runs no formatter. disabled is retained as configuration data but does not control an executable formatter.

Commands and placeholders

command is an array of strings, not a shell command string. $FILE is the V1 file-path placeholder and is often retained in migrated configuration. V2 does not currently substitute $FILE or define another formatter placeholder. Likewise, V2 does not currently use extensions to select commands, merge environment into a child process, discover formatter executables or project configuration, or run multiple matching formatters. These behaviors will only be available after a V2 formatter runtime is implemented.