Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- After changing the public Protocol or Server `HttpApi`, run `bun run generate` from `packages/client`. Do not edit `src/generated` or `src/generated-effect` directly.
- Keep runtime dependencies directed from Schema to Core and Protocol, then from Core and Protocol to Server. Client runtime code may depend on Schema and Protocol but never Core or Server; `sdk-next` composes Client, Core, and Server.
- The default branch in this repo is `main`; use `main` or `origin/main` for diffs. (Upstream opencode's default is `dev`; this fork does not have that branch.)
- This repo is a fork of upstream opencode. Every deliberate change to an upstream file must get a row in `DIVERGENCES.md` (file, change, why, on-conflict guidance) in the same PR — an unlisted divergence is a bug. Fork-only new files are not tracked there. If the change alters documented behavior (e.g. a keybind default), record it in `CHANGELOG.md` — the user-facing docs live in the separate `codev-landing-page` repo (`content/docs/code`) and are synced from there.
- This repo is a fork of upstream opencode. Every deliberate change to an upstream file must get a row in `DIVERGENCES.md` (file, change, why, on-conflict guidance) in the same PR — an unlisted divergence is a bug. Fork-only new files are not tracked there. If the change alters documented behavior (e.g. a keybind default), record it in `CHANGELOG.md` — the user-facing docs live in the separate `codev-landing-page` repo (`content/docs/code`) and are synced from there. `packages/web/src/content/docs/*.mdx` in this repo is **not** those docs: it is the rebranded upstream merge base that makes upstream doc changes surface during a sync (see `packages/web/FORK-DOCS.md`). Never treat it as the place to document a fork feature.
- Before adding a feature, read Divergence policy in `DIVERGENCES.md` and prefer the lowest tier that works: config/plugins/skills/agents first, new `packages/codev-*` workspace packages second, upstream-file edits last. When asked to sync with upstream, follow Syncing with upstream in `DIVERGENCES.md` — do not `git merge` upstream refs.

## Branch Names
Expand Down
38 changes: 30 additions & 8 deletions DIVERGENCES.md

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions packages/web/FORK-DOCS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Upstream doc sources — merge base only

`src/content/docs/*.mdx` are the fork's rebranded copies of upstream's English
documentation, pinned to the upstream release named by `version` in
`packages/opencode/package.json`. **Nothing here is built, served, or published.**

## Why they exist

They are a change detector for `git apply -3`. The sync runbook in
[`DIVERGENCES.md`](../../DIVERGENCES.md) drops any path that existed at `FROM` and is
absent from `HEAD`, so while these files were deleted (PR #122) every upstream doc edit
was skipped in silence rather than raising a conflict — the fork went from v1.18.3 to
v1.18.4 without seeing upstream's doc changes at all. With the sources back at their
upstream paths, those edits surface the same way any other divergence does.

## Where the real docs are

The documentation users read lives in
[codev-landing-page](https://github.com/quickbeard/codev-landing-page), under
`content/docs/code/{en,vi}`, converted to that site's MDX pipeline.

**Edit those, not these.** When a sync raises a conflict in this directory, resolve it
here to keep the merge base honest, then carry the substance across by hand. The two
cannot be merged mechanically: the landing-page pages are restructured, use their own
components, and cover a different page set (no `zen`, `go`, `share`, `ecosystem`,
`enterprise`, `custom-tools`, `sdk`, `server` or `plugins`; plus a `desktop` page upstream
has never had).

Because these files track upstream rather than the published site, they will drift behind
it for fork-only features documented after PR #122. That is expected — their job is to
tell you what *upstream* changed.

## What was not restored

Everything else in this package: `astro.config.mjs`, `config.mjs`, `package.json`,
`public/`, `src/{components,pages,assets,styles,i18n,types}`, `middleware.ts`,
`content.config.ts`, and every translated docs directory. Without them the surviving
`.mdx` files have dangling imports — Starlight components, `../../../config.mjs`,
`../../assets/**` images. That is deliberate; nothing resolves them because nothing
compiles these files.

This directory is also not a workspace member. There is no `package.json`, so `bun
install`, `turbo typecheck` and the release pipeline all ignore it.
156 changes: 156 additions & 0 deletions packages/web/src/content/docs/acp.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
---
title: ACP Support
description: Use CoDev Code in any ACP-compatible editor.
---

CoDev Code supports the [Agent Client Protocol](https://agentclientprotocol.com) or (ACP), allowing you to use it directly in compatible editors and IDEs.

:::tip
For a list of editors and tools that support ACP, check out the [ACP progress report](https://zed.dev/blog/acp-progress-report#available-now).
:::

ACP is an open protocol that standardizes communication between code editors and AI coding agents.

---

## Configure

To use CoDev Code via ACP, configure your editor to run the `codev acp` command.

The command starts CoDev Code as an ACP-compatible subprocess that communicates with your editor over JSON-RPC via stdio.

Below are examples for popular editors that support ACP.

---

### Zed

Add to your [Zed](https://zed.dev) configuration (`~/.config/zed/settings.json`):

```json title="~/.config/zed/settings.json"
{
"agent_servers": {
"CoDev Code": {
"command": "codev",
"args": ["acp"]
}
}
}
```

To open it, use the `agent: new thread` action in the **Command Palette**.

You can also bind a keyboard shortcut by editing your `keymap.json`:

```json title="keymap.json"
[
{
"bindings": {
"cmd-alt-o": [
"agent::NewExternalAgentThread",
{
"agent": {
"custom": {
"name": "CoDev Code",
"command": {
"command": "codev",
"args": ["acp"]
}
}
}
}
]
}
}
]
```

---

### JetBrains IDEs

Add to your [JetBrains IDE](https://www.jetbrains.com/) acp.json according to the [documentation](https://www.jetbrains.com/help/ai-assistant/acp.html):

```json title="acp.json"
{
"agent_servers": {
"CoDev Code": {
"command": "/absolute/path/bin/codev",
"args": ["acp"]
}
}
}
```

To open it, use the new 'CoDev Code' agent in the AI Chat agent selector.

---

### Avante.nvim

Add to your [Avante.nvim](https://github.com/yetone/avante.nvim) configuration:

```lua
{
acp_providers = {
["opencode"] = {
command = "codev",
args = { "acp" }
}
}
}
```

If you need to pass environment variables:

```lua {6-8}
{
acp_providers = {
["opencode"] = {
command = "codev",
args = { "acp" },
env = {
CODEV_API_KEY = os.getenv("CODEV_API_KEY")
}
}
}
}
```

---

### CodeCompanion.nvim

To use CoDev Code as an ACP agent in [CodeCompanion.nvim](https://github.com/olimorris/codecompanion.nvim), add the following to your Neovim config:

```lua
require("codecompanion").setup({
interactions = {
chat = {
adapter = {
name = "opencode",
model = "claude-sonnet-4",
},
},
},
})
```

This config sets up CodeCompanion to use CoDev Code as the ACP agent for chat.

If you need to pass environment variables (like `CODEV_API_KEY`), refer to [Configuring Adapters: Environment Variables](https://codecompanion.olimorris.dev/getting-started#setting-an-api-key) in the CodeCompanion.nvim documentation for full details.

## Support

CoDev Code works the same via ACP as it does in the terminal. All features are supported:

:::note
Some built-in slash commands like `/undo` and `/redo` are currently unsupported.
:::

- Built-in tools (file operations, terminal commands, etc.)
- Custom tools and slash commands
- MCP servers configured in your CoDev Code config
- Project-specific rules from `AGENTS.md`
- Custom formatters and linters
- Agents and permissions system
Loading
Loading