docs: document bd setup command
Add comprehensive documentation for the bd setup command which was largely undocumented (GH#518): - CLI_REFERENCE.md: Add new "Editor Integration" section documenting bd setup claude/cursor/aider commands with all flags - INSTALLING.md: Fix incorrect reference to "bd hooks install" for editor integration - should be "bd setup <editor>" - CLAUDE_INTEGRATION.md: Add Installation section with bd setup claude examples Fixes: GH#518 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -81,6 +81,29 @@ They should be:
|
||||
|
||||
Users who want custom Skills can create their own, but beads doesn't ship with or require them.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
# Install Claude Code hooks globally
|
||||
bd setup claude
|
||||
|
||||
# Install for this project only
|
||||
bd setup claude --project
|
||||
|
||||
# Use stealth mode (flush only, no git operations)
|
||||
bd setup claude --stealth
|
||||
|
||||
# Check installation status
|
||||
bd setup claude --check
|
||||
|
||||
# Remove hooks
|
||||
bd setup claude --remove
|
||||
```
|
||||
|
||||
**What it installs:**
|
||||
- SessionStart hook: Runs `bd prime` when Claude Code starts a session
|
||||
- PreCompact hook: Runs `bd prime` before context compaction to preserve workflow instructions
|
||||
|
||||
## Related Files
|
||||
|
||||
- `cmd/bd/prime.go` - Context generation
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
- [Filtering & Search](#filtering--search)
|
||||
- [Advanced Operations](#advanced-operations)
|
||||
- [Database Management](#database-management)
|
||||
- [Editor Integration](#editor-integration)
|
||||
|
||||
## Basic Operations
|
||||
|
||||
@@ -550,6 +551,44 @@ bd sync # Force immediate sync, bypass debounce
|
||||
|
||||
**ALWAYS run `bd sync` at end of agent sessions** to ensure changes are committed/pushed immediately.
|
||||
|
||||
## Editor Integration
|
||||
|
||||
### Setup Commands
|
||||
|
||||
```bash
|
||||
# Setup editor integration (choose based on your editor)
|
||||
bd setup claude # Claude Code - installs SessionStart/PreCompact hooks
|
||||
bd setup cursor # Cursor IDE - creates .cursor/rules/beads.mdc
|
||||
bd setup aider # Aider - creates .aider.conf.yml
|
||||
|
||||
# Check if integration is installed
|
||||
bd setup claude --check
|
||||
bd setup cursor --check
|
||||
bd setup aider --check
|
||||
|
||||
# Remove integration
|
||||
bd setup claude --remove
|
||||
bd setup cursor --remove
|
||||
bd setup aider --remove
|
||||
```
|
||||
|
||||
**Claude Code options:**
|
||||
```bash
|
||||
bd setup claude # Install globally (~/.claude/settings.json)
|
||||
bd setup claude --project # Install for this project only
|
||||
bd setup claude --stealth # Use stealth mode (flush only, no git operations)
|
||||
```
|
||||
|
||||
**What each setup does:**
|
||||
- **Claude Code** (`bd setup claude`): Adds hooks to Claude Code's settings.json that run `bd prime` on SessionStart and PreCompact events
|
||||
- **Cursor** (`bd setup cursor`): Creates `.cursor/rules/beads.mdc` with workflow instructions
|
||||
- **Aider** (`bd setup aider`): Creates `.aider.conf.yml` with bd workflow instructions
|
||||
|
||||
See also:
|
||||
- [INSTALLING.md](INSTALLING.md#ide-and-editor-integrations) - Installation guide
|
||||
- [AIDER_INTEGRATION.md](AIDER_INTEGRATION.md) - Detailed Aider guide
|
||||
- [CLAUDE_INTEGRATION.md](CLAUDE_INTEGRATION.md) - Claude integration design
|
||||
|
||||
## See Also
|
||||
|
||||
- [AGENTS.md](../AGENTS.md) - Main agent workflow guide
|
||||
|
||||
+14
-5
@@ -133,15 +133,17 @@ brew install bd
|
||||
cd your-project
|
||||
bd init --quiet
|
||||
|
||||
# 3. Install hooks for automatic context injection
|
||||
bd hooks install
|
||||
# 3. Setup editor integration (choose one)
|
||||
bd setup claude # Claude Code - installs SessionStart/PreCompact hooks
|
||||
bd setup cursor # Cursor IDE - creates .cursor/rules/beads.mdc
|
||||
bd setup aider # Aider - creates .aider.conf.yml
|
||||
```
|
||||
|
||||
**How it works:**
|
||||
- SessionStart hook runs `bd prime` automatically
|
||||
- `bd prime` injects ~1-2k tokens of workflow context
|
||||
- Editor hooks/rules inject `bd prime` automatically on session start
|
||||
- `bd prime` provides ~1-2k tokens of workflow context
|
||||
- You use `bd` CLI commands directly
|
||||
- Git hooks auto-sync the database
|
||||
- Git hooks (installed by `bd init`) auto-sync the database
|
||||
|
||||
**Why this is recommended:**
|
||||
- **Context efficient** - ~1-2k tokens vs 10-50k for MCP tool schemas
|
||||
@@ -149,6 +151,13 @@ bd hooks install
|
||||
- **Universal** - Works with any editor that has shell access
|
||||
- **More sustainable** - Less compute per request
|
||||
|
||||
**Verify installation:**
|
||||
```bash
|
||||
bd setup claude --check # Check Claude Code integration
|
||||
bd setup cursor --check # Check Cursor integration
|
||||
bd setup aider --check # Check Aider integration
|
||||
```
|
||||
|
||||
### Claude Code Plugin (Optional)
|
||||
|
||||
For enhanced UX with slash commands:
|
||||
|
||||
Reference in New Issue
Block a user