Skip to content

Commit 9a701e2

Browse files
bdougieclaude
andcommitted
docs: address review feedback on run-agents-locally guide
- Add clarifying note distinguishing local vs cloud agents - Remove redundant CardGroup section - Fix API key naming to ANTHROPIC_API_KEY - Clarify GitHub CLI pre-installed on runners - Remove unnecessary tools: built_in from examples - Rename "Rules" to "Guidelines" to avoid frontmatter confusion - Flip headless/TUI order (headless is typical) - Simplify frontmatter table, link to reference - Move GitHub Actions section before Security - Remove --ask from CI guidance (requires user intervention) - Fix mac-only log path - Add ANTHROPIC_API_KEY to local env vars section - Clarify name field vs filename in best practices Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 1ec2d35 commit 9a701e2

File tree

1 file changed

+79
-92
lines changed

1 file changed

+79
-92
lines changed

docs/guides/run-agents-locally.mdx

Lines changed: 79 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ sidebarTitle: "Run Agents Locally"
44
description: "Set up version-controlled agents in your repository and run them with Continue CLI or GitHub Actions"
55
---
66

7+
<Note>
8+
Looking for the easiest way to create and manage agents? [Cloud Agents in Mission Control](/agents/overview#pre-configured-agents) are recommended for most teams. This guide covers **local agents**—agent files stored in your repository—for open source users or teams needing version-controlled definitions.
9+
</Note>
10+
711
<Card title="What You'll Build" icon="folder-open">
812
A local agent system that:
913
- Keeps agent definitions version-controlled alongside your code
@@ -12,29 +16,13 @@ description: "Set up version-controlled agents in your repository and run them w
1216
- Applies consistent workflows across your team
1317
</Card>
1418

15-
## Why Local Agents?
16-
17-
<CardGroup cols={3}>
18-
<Card title="Version Control" icon="code-branch">
19-
Agent definitions evolve with your codebase. Track changes, review in PRs, and roll back when needed.
20-
</Card>
21-
22-
<Card title="Team Consistency" icon="users">
23-
Everyone runs the same agents with the same rules. No configuration drift across machines.
24-
</Card>
25-
26-
<Card title="CI/CD Ready" icon="rotate">
27-
Trigger agents automatically on pull requests, commits, or any GitHub event.
28-
</Card>
29-
</CardGroup>
30-
3119
## Prerequisites
3220

3321
Before starting, ensure you have:
3422

3523
- [Continue CLI installed](/cli/install) (`npm i -g @continuedev/cli`)
36-
- An LLM API key (e.g., `ANTHROPIC_API_KEY`)
37-
- [GitHub CLI](https://cli.github.com/) if your agents interact with GitHub
24+
- `ANTHROPIC_API_KEY` environment variable set
25+
- [GitHub CLI](https://cli.github.com/) installed locally if your agents interact with GitHub (pre-installed on GitHub-hosted runners)
3826

3927
## Quick Setup
4028

@@ -58,7 +46,6 @@ Before starting, ensure you have:
5846
---
5947
name: My First Agent
6048
description: Describes what this agent does
61-
tools: built_in
6249
---
6350

6451
You are an agent that helps with [specific task].
@@ -69,22 +56,22 @@ Before starting, ensure you have:
6956
2. Then, do that
7057
3. Finally, complete this
7158

72-
## Rules
59+
## Guidelines
7360

74-
- Follow this guideline
75-
- Avoid this pattern
61+
- Follow this pattern
62+
- Avoid this anti-pattern
7663
```
7764
</Step>
7865

7966
<Step title="Run the agent">
8067
```bash
81-
cn --agent .continue/agents/my-agent.md
68+
cn -p --agent .continue/agents/my-agent.md
8269
```
8370

84-
For headless execution (useful for automation):
71+
For interactive development (TUI mode):
8572

8673
```bash
87-
cn -p --agent .continue/agents/my-agent.md
74+
cn --agent .continue/agents/my-agent.md
8875
```
8976
</Step>
9077
</Steps>
@@ -99,12 +86,13 @@ Agent files are markdown documents with YAML frontmatter. The frontmatter config
9986
|-------|----------|-------------|
10087
| `name` | Yes | Display name for the agent |
10188
| `description` | Yes | Brief description of what the agent does |
102-
| `tools` | No | Tool configuration (`built_in` for standard tools) |
10389

10490
<Info>
10591
The markdown body is the agent's system prompt. Write clear, specific instructions with examples for best results.
10692
</Info>
10793

94+
For additional options like `rules`, `model`, and MCP tool configuration, see the [Agent Configuration Reference](/agents/agent-file-reference).
95+
10896
## Example: Conventional PR Title Agent
10997

11098
This agent updates pull request titles to follow conventional commit format:
@@ -113,7 +101,6 @@ This agent updates pull request titles to follow conventional commit format:
113101
---
114102
name: Conventional Title
115103
description: Updates PR title to follow conventional commit format
116-
tools: built_in
117104
---
118105

119106
You are reviewing a pull request to format its title according to conventional commit standards.
@@ -149,6 +136,61 @@ You are reviewing a pull request to format its title according to conventional c
149136
- Use lowercase, no period at end
150137
````
151138

139+
## GitHub Actions Integration
140+
141+
Continue provides a [reusable workflow](https://github.com/continuedev/continue/blob/main/.github/workflows/continue-agents.yml) that handles agent discovery, parallel execution, and GitHub Check reporting.
142+
143+
### Using the Reusable Workflow
144+
145+
Create `.github/workflows/run-agents.yml`:
146+
147+
```yaml
148+
name: Run Agents
149+
150+
on:
151+
pull_request:
152+
types: [opened, reopened, synchronize]
153+
branches:
154+
- main
155+
156+
jobs:
157+
agents:
158+
uses: continuedev/continue/.github/workflows/continue-agents.yml@main
159+
secrets:
160+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
161+
```
162+
163+
The reusable workflow automatically:
164+
- Discovers all `.md` files in `.continue/agents/`
165+
- Runs each agent in parallel
166+
- Creates GitHub Check runs for each agent
167+
- Provides `GH_TOKEN` for agents using the `gh` CLI
168+
- Writes job summaries with agent output
169+
170+
### Configuration Options
171+
172+
```yaml
173+
jobs:
174+
agents:
175+
uses: continuedev/continue/.github/workflows/continue-agents.yml@main
176+
with:
177+
agents-path: '.continue/agents' # Custom agents directory (optional)
178+
secrets:
179+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
180+
```
181+
182+
### Required Secrets
183+
184+
Add this secret to your repository under **Settings > Secrets and variables > Actions**:
185+
186+
| Secret | Description |
187+
|--------|-------------|
188+
| `ANTHROPIC_API_KEY` | Your Anthropic API key for Claude |
189+
190+
<Info>
191+
The reusable workflow automatically provides `GH_TOKEN` via `${{ github.token }}`, so agents using the `gh` CLI work out of the box.
192+
</Info>
193+
152194
## Security Considerations
153195

154196
<Warning>
@@ -182,9 +224,6 @@ When running agents in CI/CD, follow the principle of least privilege:
182224
# Only allow specific tools
183225
cn --allow "Read()" --allow "Grep()" --exclude "Bash()" \
184226
--agent .continue/agents/analysis-only.md
185-
186-
# Always ask before running commands
187-
cn --ask "Bash(*)" --agent .continue/agents/my-agent.md
188227
```
189228

190229
Learn more in the [CLI documentation](/cli/overview#how-to-set-tool-permissions).
@@ -210,76 +249,24 @@ When running agents in CI/CD, follow the principle of least privilege:
210249
Before enabling fully automated agents:
211250

212251
1. **Test locally first** - Run agents with `cn` to verify behavior
213-
2. **Use `--ask` mode** - Require approval for sensitive operations during testing
214-
3. **Review CI logs** - Check what commands agents execute in your workflows
215-
4. **Start with read-only agents** - Begin with agents that analyze rather than modify
252+
2. **Review CI logs** - Check what commands agents execute in your workflows
253+
3. **Start with read-only agents** - Begin with agents that analyze rather than modify
216254

217255
<Tip>
218256
For high-risk operations (like pushing commits or modifying infrastructure), consider requiring manual approval steps in your workflow.
219257
</Tip>
220258

221-
## GitHub Actions Integration
222-
223-
Continue provides a [reusable workflow](https://github.com/continuedev/continue/blob/main/.github/workflows/continue-agents.yml) that handles agent discovery, parallel execution, and GitHub Check reporting.
224-
225-
### Using the Reusable Workflow (Recommended)
226-
227-
Create `.github/workflows/run-agents.yml`:
228-
229-
```yaml
230-
name: Run Agents
231-
232-
on:
233-
pull_request:
234-
types: [opened, reopened, synchronize]
235-
branches:
236-
- main
237-
238-
jobs:
239-
agents:
240-
uses: continuedev/continue/.github/workflows/continue-agents.yml@main
241-
secrets:
242-
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
243-
```
244-
245-
The reusable workflow automatically:
246-
- Discovers all `.md` files in `.continue/agents/`
247-
- Runs each agent in parallel
248-
- Creates GitHub Check runs for each agent
249-
- Provides `GH_TOKEN` for agents using the `gh` CLI
250-
- Writes job summaries with agent output
251-
252-
### Configuration Options
253-
254-
```yaml
255-
jobs:
256-
agents:
257-
uses: continuedev/continue/.github/workflows/continue-agents.yml@main
258-
with:
259-
agents-path: '.continue/agents' # Custom agents directory (optional)
260-
secrets:
261-
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
262-
```
263-
264-
### Required Secrets
265-
266-
Add this secret to your repository under **Settings > Secrets and variables > Actions**:
267-
268-
| Secret | Description |
269-
|--------|-------------|
270-
| `ANTHROPIC_API_KEY` | Your Anthropic API key for Claude |
271-
272-
<Info>
273-
The reusable workflow automatically provides `GH_TOKEN` via `${{ github.token }}`, so agents using the `gh` CLI work out of the box.
274-
</Info>
275-
276259
## Environment Variables
277260

278-
When running agents locally that interact with GitHub, set the `GH_TOKEN`:
261+
When running agents locally, set these environment variables:
279262

280263
```bash
281-
# Use your GitHub CLI token
264+
# Required: Your Anthropic API key
265+
export ANTHROPIC_API_KEY=your-api-key
266+
267+
# Optional: GitHub token if your agents use the gh CLI
282268
export GH_TOKEN=$(gh auth token)
269+
283270
cn --agent .continue/agents/my-agent.md
284271
```
285272

@@ -331,7 +318,7 @@ your-repo/
331318
- Simplify the prompt and add more specific instructions
332319
- Check if the agent has access to required tools
333320
- Enable verbose logging: `cn --verbose --agent .continue/agents/my-agent.md`
334-
- Review logs at `~/.continue/logs/cn.log`
321+
- Review logs with `cn --verbose` or check the Continue logs directory
335322
</Accordion>
336323

337324
<Accordion title="Workflow doesn't discover agents">
@@ -357,7 +344,7 @@ your-repo/
357344
</Card>
358345

359346
<Card title="Use Descriptive Names" icon="tag">
360-
Name agent files clearly: `conventional-title.md`, `security-scan.md`, `deploy-checklist.md`.
347+
The `name` field in frontmatter is displayed to users. Use descriptive filenames for organization: `conventional-title.md`, `security-scan.md`.
361348
</Card>
362349

363350
<Card title="Keep Agents Focused" icon="bullseye">

0 commit comments

Comments
 (0)