# OpenCode

Add concise LintLang repair guidance after supported successful file edits. The adapter uses an explicit changed-file path supplied by the host to select the input.

## Setup

The released adapter targets the **OpenCode 1.18.27 legacy `tool.execute.after` contract**. Use Git, Python 3.10+, and pipx; see [installation options](/docs/install) if you need to install the scanner another way. Its recorded scanner setup is:

```bash
pipx install lintlang==0.7.0
lintlang --version
```

Open a terminal in an empty scratch directory and clone the released adapter source:

```bash
git clone --depth 1 --branch v0.8.0 https://github.com/hermes-labs-ai/lintlang.git lintlang-integration-source
cd lintlang-integration-source
```

Install [lintlang.js](https://github.com/hermes-labs-ai/lintlang/blob/c0cab00048220286858f227aaf4b13cc043f718b/integrations/opencode/lintlang.js) globally:

```bash
mkdir -p ~/.config/opencode/plugins
test ! -e ~/.config/opencode/plugins/lintlang.js && cp integrations/opencode/lintlang.js ~/.config/opencode/plugins/lintlang.js
```

The copy runs only if no adapter file already exists; review an existing installation before replacing it. For project-only use, copy the same source file into `.opencode/plugins/` inside your own project instead. Start OpenCode in your project, rather than the scratch checkout.

## Verify

Check the host version:

```bash
opencode --version
```

Then make a successful supported edit with an explicit changed path and inspect its result for guidance. Version output identifies the host; it does not verify the plugin end to end.

The recorded 1.18.27 evidence comes from published `@opencode-ai/plugin` type declarations. It is distinct from live-host compatibility testing, and newer versions may expose a different event API. The [released guide](https://github.com/hermes-labs-ai/lintlang/blob/c0cab00048220286858f227aaf4b13cc043f718b/integrations/opencode/README.md) includes the repository test command for adapter development.

## Supported edits

The hook handles `edit`, `multiedit`, `patch`, `write`, and `apply_patch` when arguments or metadata contain an explicit `filePath`, `file_path`, `path`, `file`, or `files` entry. A target hidden only inside patch text is skipped.

Supported extensions are `.yaml`, `.yml`, `.json`, `.txt`, `.md`, `.prompt`, and `.py`. The hook returns up to eight findings and omits raw evidence. Clean and unsupported inputs produce no repair guidance. It does not rewrite files or block tool calls.

If feedback is absent, check the runner, installation location, host version, and supplied changed path. To remove the integration, remove only the copied `lintlang.js`, then restart the host.

## Next steps

[Add a separate CI gate](/integrations/github) · [Understand coverage](/docs/inputs) · [All integrations](/integrations)

