Skip to content

Commit 81b828c

Browse files
committed
Cleanup things a bit
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
1 parent 78f5efd commit 81b828c

File tree

8 files changed

+163
-265
lines changed

8 files changed

+163
-265
lines changed

content/manuals/ai/cagent/_index.md

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ problems. Run these agent teams from your terminal using any LLM provider.
2020

2121
## Why agent teams
2222

23-
One agent handling complex work means constant context-switching. Split the
24-
work across focused agents instead - each handles what it's best at. cagent
25-
manages the coordination.
23+
One agent handling complex work means constant context-switching. Split the work
24+
across focused agents instead - each handles what it's best at. cagent manages
25+
the coordination.
2626

2727
Here's a two-agent team that debugs problems:
2828

@@ -63,8 +63,11 @@ cagent is included in Docker Desktop 4.49 and later.
6363
For Docker Engine users or custom installations:
6464

6565
- **Homebrew**: `brew install cagent`
66-
- **Pre-built binaries**: [GitHub releases](https://github.com/docker/cagent/releases)
67-
- **From source**: See the [cagent repository](https://github.com/docker/cagent?tab=readme-ov-file#build-from-source)
66+
- **Winget**: `winget install Docker.Cagent`
67+
- **Pre-built binaries**: [GitHub
68+
releases](https://github.com/docker/cagent/releases)
69+
- **From source**: See the [cagent
70+
repository](https://github.com/docker/cagent?tab=readme-ov-file#build-from-source)
6871

6972
## Get started
7073

@@ -98,7 +101,8 @@ define. Each agent:
98101
- Uses its own model and parameters
99102
- Has its own context (agents don't share knowledge)
100103
- Can access built-in tools like todo lists, memory, and task delegation
101-
- Can use external tools via [MCP servers](/manuals/ai/mcp-catalog-and-toolkit/mcp-gateway.md)
104+
- Can use external tools via [MCP
105+
servers](/manuals/ai/mcp-catalog-and-toolkit/mcp-gateway.md)
102106

103107
The root agent delegates tasks to agents listed under `sub_agents`. Sub-agents
104108
can have their own sub-agents for deeper hierarchies.
@@ -124,7 +128,8 @@ agents:
124128
```
125129

126130
You can also configure model settings (like context limits), tools (including
127-
MCP servers), and more. See the [configuration reference](https://github.com/docker/cagent?tab=readme-ov-file#-configuration-reference)
131+
MCP servers), and more. See the [configuration
132+
reference](./reference/config.md)
128133
for complete details.
129134

130135
## Share agent teams
@@ -137,16 +142,21 @@ $ cagent push ./debugger.yaml myusername/debugger
137142
$ cagent pull myusername/debugger
138143
```
139144

140-
Use Docker Hub or any OCI-compatible registry. Pushing creates the repository
141-
if it doesn't exist yet.
145+
Use Docker Hub or any OCI-compatible registry. Pushing creates the repository if
146+
it doesn't exist yet.
142147

143148
## What's next
144149

145150
- Follow the [tutorial](./tutorial.md) to build your first coding agent
146151
- Learn [best practices](./best-practices.md) for building effective agents
147152
- Integrate cagent with your [editor](./integrations/acp.md) or use agents as
148153
[tools in MCP clients](./integrations/mcp.md)
149-
- Browse example agent configurations in the [cagent repository](https://github.com/docker/cagent/tree/main/examples)
150-
- Use `cagent new` to generate agent teams with AI <!-- TODO: link to some page where we explain this, probably a CLI reference? -->
151-
- Connect agents to external tools via the [Docker MCP Gateway](/manuals/ai/mcp-catalog-and-toolkit/mcp-gateway.md)
152-
- Read the full [configuration reference](https://github.com/docker/cagent?tab=readme-ov-file#-configuration-reference) <!-- TODO: move to this site/repo -->
154+
- Browse example agent configurations in the [cagent
155+
repository](https://github.com/docker/cagent/tree/main/examples)
156+
- Use `cagent new` to generate agent teams with AI <!-- TODO: link to some page
157+
where we explain this, probably a CLI reference? -->
158+
- Connect agents to external tools via the [Docker MCP
159+
Gateway](/manuals/ai/mcp-catalog-and-toolkit/mcp-gateway.md)
160+
- Read the full [configuration
161+
reference](https://github.com/docker/cagent?tab=readme-ov-file#-configuration-reference)
162+
<!-- TODO: move to this site/repo -->

content/manuals/ai/cagent/best-practices.md

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ practice.
1313

1414
Shell commands that produce large output can overflow your agent's context
1515
window. Validation tools, test suites, and build logs often generate thousands
16-
of lines. If you capture this output directly, it consumes all available
17-
context and the agent fails.
16+
of lines. If you capture this output directly, it consumes all available context
17+
and the agent fails.
1818

1919
The solution: redirect output to a file, then read the file. The Read tool
2020
automatically truncates large files to 2000 lines, and your agent can navigate
@@ -31,8 +31,8 @@ reviewer:
3131
- type: shell
3232
```
3333
34-
The validation output goes directly into context. If it's large, the agent
35-
fails with a context overflow error.
34+
The validation output goes directly into context. If it's large, the agent fails
35+
with a context overflow error.
3636
3737
**Do this:**
3838
@@ -50,26 +50,14 @@ reviewer:
5050
- type: shell
5151
```
5252
53-
The output goes to a file, not context. The agent reads what it needs using
54-
the filesystem toolset.
55-
56-
**Important details:**
57-
58-
- Use `>` to redirect, not `tee`. The `tee` command writes to both the file
59-
and stdout, defeating the purpose.
60-
- Redirect both stdout and stderr with `2>&1`
61-
- Write to the working directory, not `/tmp` (permission issues)
62-
- Tell your agent that errors usually appear early in logs so it knows to read
63-
from the beginning
64-
65-
This pattern works for any command with potentially large output: test runs,
66-
build logs, linting tools, search results, database dumps.
53+
The output goes to a file, not context. The agent reads what it needs using the
54+
filesystem toolset.
6755
6856
## Structuring agent teams
6957
70-
A single agent handling multiple responsibilities makes instructions complex
71-
and behavior unpredictable. Breaking work across specialized agents produces
72-
better results.
58+
A single agent handling multiple responsibilities makes instructions complex and
59+
behavior unpredictable. Breaking work across specialized agents produces better
60+
results.
7361
7462
The coordinator pattern works well: a root agent understands the overall task
7563
and delegates to specialists. Each specialist focuses on one thing.
@@ -187,7 +175,7 @@ understanding and exact matching.
187175
## Preserving document scope
188176
189177
When building agents that update documentation, a common problem: the agent
190-
transforms minimal guides into comprehensive tutorials. It adds prerequisites,
178+
transforms minimal guides into tutorials. It adds prerequisites,
191179
troubleshooting, best practices, examples, and detailed explanations to
192180
everything.
193181
@@ -254,6 +242,7 @@ complex reasoning needed, and Haiku is faster and cheaper.
254242
options
255243
- Check [toolsets reference](./reference/toolsets.md) to understand what tools
256244
agents can use
257-
- See [example configurations](https://github.com/docker/cagent/tree/main/examples)
258-
for complete working agents
245+
- See [example
246+
configurations](https://github.com/docker/cagent/tree/main/examples) for
247+
complete working agents
259248
- Read the [RAG guide](./rag.md) for detailed retrieval optimization

content/manuals/ai/cagent/integrations/acp.md

Lines changed: 23 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: ACP integration
2+
title: ACP
33
description: Configure your editor or IDE to use cagent agents as coding assistants
4-
keywords: [cagent, acp, editor, ide, vscode, neovim, integration]
4+
keywords: [cagent, acp, editor, ide, neovim, zed, integration]
55
weight: 40
66
---
77

@@ -10,15 +10,15 @@ Your agent gets access to your editor's filesystem context and can read and
1010
modify files as you work. The editor handles file operations while cagent
1111
provides the AI capabilities.
1212

13-
This guide shows you how to configure VS Code, Neovim, or Zed to run cagent
14-
agents. If you're looking to expose cagent agents as tools to MCP clients like
15-
Claude Desktop or Claude Code, see [MCP integration](./mcp.md) instead.
13+
This guide shows you how to configure Neovim, or Zed to run cagent agents. If
14+
you're looking to expose cagent agents as tools to MCP clients like Claude
15+
Desktop or Claude Code, see [MCP integration](./mcp.md) instead.
1616

1717
## How it works
1818

1919
When you run cagent with ACP, it becomes part of your editor's environment. You
20-
select code, highlight a function, or reference a file - the agent sees what
21-
you see. No copying file paths or switching to a terminal.
20+
select code, highlight a function, or reference a file - the agent sees what you
21+
see. No copying file paths or switching to a terminal.
2222

2323
Ask "explain this function" and the agent reads the file you're viewing. Ask it
2424
to "add error handling" and it edits the code right in your editor. The agent
@@ -27,9 +27,9 @@ has to navigate.
2727

2828
The difference from running cagent in a terminal: file operations go through
2929
your editor instead of the agent directly accessing your filesystem. When the
30-
agent needs to read or write a file, it requests it from your editor. This
31-
keeps the agent's view of your code synchronized with yours - same working
32-
directory, same files, same state.
30+
agent needs to read or write a file, it requests it from your editor. This keeps
31+
the agent's view of your code synchronized with yours - same working directory,
32+
same files, same state.
3333

3434
## Prerequisites
3535

@@ -39,20 +39,14 @@ Before configuring your editor, you need:
3939
- **Agent configuration** - A YAML file defining your agent. See the
4040
[tutorial](../tutorial.md) or [example
4141
configurations](https://github.com/docker/cagent/tree/main/examples)
42-
- **Editor with ACP support** - VS Code, Neovim, Zed, or any editor you can
43-
configure for stdio-based tools
42+
- **Editor with ACP support** - Neovim, Intellij, Zed, etc.
4443

4544
Your agents will use model provider API keys from your shell environment
4645
(`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, etc.). Make sure these are set before
4746
launching your editor.
4847

4948
## Editor configuration
5049

51-
Your editor needs to know how to start cagent and communicate with it over
52-
stdio. Most editors support this through extension systems, configuration files,
53-
or plugin managers. You're telling your editor: "When I want to use an AI
54-
agent, run this command and talk to it."
55-
5650
### Zed
5751

5852
Zed has built-in ACP support.
@@ -123,27 +117,11 @@ which has native support for cagent through a built-in adapter:
123117
4. Switch to the cagent adapter (keymap `ga` in the CodeCompanion buffer, by
124118
default).
125119

126-
See the [CodeCompanion ACP documentation](https://codecompanion.olimorris.dev/usage/acp-protocol)
127-
for more information about ACP support in CodeCompanion. Note that terminal
128-
operations are not supported, so [toolsets](../reference/toolsets.md) like
129-
`shell` or `script_shell` are not usable through CodeCompanion.
130-
131-
### VS Code
132-
133-
VS Code [doesn't support ACP](https://github.com/microsoft/vscode/issues/265496)
134-
natively yet.
135-
136-
### Other editors
137-
138-
For other editors with ACP support, you need a way to:
139-
140-
1. Start cagent with `cagent acp your-agent.yml --working-dir /project/path`
141-
2. Send prompts to its stdin
142-
3. Read responses from its stdout
143-
144-
This typically requires writing a small plugin or extension for your editor, or
145-
using your editor's external tool integration if it supports stdio
146-
communication.
120+
See the [CodeCompanion ACP
121+
documentation](https://codecompanion.olimorris.dev/usage/acp-protocol) for more
122+
information about ACP support in CodeCompanion. Note that terminal operations
123+
are not supported, so [toolsets](../reference/toolsets.md) like `shell` or
124+
`script_shell` are not usable through CodeCompanion.
147125

148126
## Agent references
149127

@@ -173,8 +151,8 @@ Use the same syntax in your editor configuration:
173151
```
174152

175153
Registry references enable team sharing, version management, and clean
176-
configuration without local file paths. See [Sharing agents](../sharing-agents.md)
177-
for details on using OCI registries.
154+
configuration without local file paths. See [Sharing
155+
agents](../sharing-agents.md) for details on using OCI registries.
178156

179157
## Testing your setup
180158

@@ -191,61 +169,14 @@ If the agent starts but can't access files or perform other actions, check:
191169
- Agent configuration file path is absolute or relative to working directory
192170
- Your editor or plugin properly implements ACP protocol features
193171

194-
## Common workflows
195-
196-
### Explain code at cursor
197-
198-
Select a function or code block, then ask: "Explain what this code does."
199-
200-
The agent reads the file, analyzes the selection, and explains the
201-
functionality.
202-
203-
### Add functionality
204-
205-
Ask: "Add error handling to this function" while having a function selected.
206-
207-
The agent reads the current code, writes improved code with error handling, and
208-
explains the changes.
209-
210-
### Search the codebase
211-
212-
For agents configured with RAG (see examples directory), ask: "Where is
213-
authentication implemented?"
214-
215-
The agent searches your indexed codebase and points to relevant files and
216-
functions.
217-
218-
### Multi-step refactoring
219-
220-
Ask: "Rename this function and update all callers."
221-
222-
The agent finds all references, makes changes across files, and reports what
223-
it updated.
224-
225-
## ACP vs MCP integration
226-
227-
Both protocols let you integrate cagent agents with other tools, but they're
228-
designed for different use cases:
229-
230-
| Feature | ACP Integration | MCP Integration |
231-
| ----------- | ---------------------------- | ------------------------------ |
232-
| Use case | Embedded agents in editors | Agents as tools in MCP clients |
233-
| Filesystem | Delegated to client (editor) | Direct cagent access |
234-
| Working dir | Client workspace | Configurable per agent |
235-
| Best for | Code editing workflows | Using agents as callable tools |
236-
237-
Use ACP when you want agents embedded in your editor. Use MCP when you want to
238-
expose agents as tools to MCP clients like Claude Desktop or Claude Code.
239-
240-
For MCP integration setup, see [MCP integration](./mcp.md).
241-
242172
## What's next
243173

244-
- Review the [configuration reference](../reference/config.md) for advanced agent
245-
setup
174+
- Review the [configuration reference](../reference/config.md) for advanced
175+
agent setup
246176
- Explore the [toolsets reference](../reference/toolsets.md) to learn what tools
247177
are available
248178
- Add [RAG for codebase search](../rag.md) to your agent
249179
- Check the [CLI reference](../reference/cli.md) for all `cagent acp` options
250-
- Browse [example configurations](https://github.com/docker/cagent/tree/main/examples)
251-
for inspiration
180+
- Browse [example
181+
configurations](https://github.com/docker/cagent/tree/main/examples) for
182+
inspiration

0 commit comments

Comments
 (0)