@damper/cli 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +202 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# @damper/cli
|
|
2
|
+
|
|
3
|
+
Agent orchestration CLI for working on [Damper](https://usedamper.com) roadmap tasks with Claude Code.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
1. **Picks a task** from your Damper roadmap (interactive or by ID)
|
|
8
|
+
2. **Creates an isolated git worktree** for the task
|
|
9
|
+
3. **Bootstraps context** - fetches task details, project docs, and critical rules from Damper
|
|
10
|
+
4. **Launches Claude Code** with full context ready to go
|
|
11
|
+
|
|
12
|
+
Claude then handles the task lifecycle via Damper MCP - logging commits, adding notes, and completing/abandoning tasks.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Run directly with npx (recommended)
|
|
18
|
+
npx @damper/cli
|
|
19
|
+
|
|
20
|
+
# Or install globally
|
|
21
|
+
npm install -g @damper/cli
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Prerequisites
|
|
25
|
+
|
|
26
|
+
- [Claude Code CLI](https://claude.ai/code) installed
|
|
27
|
+
- A Damper account with an API key
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# First time? Run setup to configure MCP and API key
|
|
33
|
+
npx @damper/cli setup
|
|
34
|
+
|
|
35
|
+
# Start working on a task
|
|
36
|
+
npx @damper/cli
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Commands
|
|
40
|
+
|
|
41
|
+
### `npx @damper/cli` (default)
|
|
42
|
+
|
|
43
|
+
Interactive task picker. Shows:
|
|
44
|
+
- **In Progress** - Tasks with existing worktrees you can resume
|
|
45
|
+
- **Available** - Planned tasks from your roadmap
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx @damper/cli # Interactive picker
|
|
49
|
+
npx @damper/cli --task 42 # Start specific task
|
|
50
|
+
npx @damper/cli --type bug # Filter by type
|
|
51
|
+
npx @damper/cli --status planned # Filter by status
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### `npx @damper/cli setup`
|
|
55
|
+
|
|
56
|
+
Configure Damper MCP in Claude Code. Run this first if you haven't set up MCP yet.
|
|
57
|
+
|
|
58
|
+
- Checks if Claude CLI is installed
|
|
59
|
+
- Configures `~/.claude/settings.json` with Damper MCP
|
|
60
|
+
- Prompts for API key if not in environment
|
|
61
|
+
|
|
62
|
+
### `npx @damper/cli status`
|
|
63
|
+
|
|
64
|
+
Show all tracked worktrees and their task status.
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Tracked Worktrees:
|
|
68
|
+
|
|
69
|
+
myproject (current)
|
|
70
|
+
/Users/me/projects/myproject
|
|
71
|
+
|
|
72
|
+
● #42 [in_progress]
|
|
73
|
+
Path: myproject-oauth-support
|
|
74
|
+
Branch: feature/oauth-support
|
|
75
|
+
Created: 2/5/2025
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### `npx @damper/cli cleanup`
|
|
79
|
+
|
|
80
|
+
Remove worktrees for completed or abandoned tasks. Interactive selection with auto-detection of:
|
|
81
|
+
- Completed tasks
|
|
82
|
+
- Abandoned tasks (unlocked in Damper)
|
|
83
|
+
- Missing worktree directories
|
|
84
|
+
|
|
85
|
+
## Workflow
|
|
86
|
+
|
|
87
|
+
### Starting a New Task
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
$ npx @damper/cli
|
|
91
|
+
|
|
92
|
+
? Select a task to work on:
|
|
93
|
+
--- Available Tasks ---
|
|
94
|
+
❯ #42 Add OAuth support [feature] !
|
|
95
|
+
#38 Fix login timeout [bug] ~
|
|
96
|
+
|
|
97
|
+
✓ Task locked in Damper
|
|
98
|
+
✓ Created worktree: ../myproject-oauth-support
|
|
99
|
+
✓ Created TASK_CONTEXT.md
|
|
100
|
+
✓ Updated CLAUDE.md with task section
|
|
101
|
+
|
|
102
|
+
Starting Claude Code for task #42: Add OAuth support
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Resuming Work
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
$ npx @damper/cli
|
|
109
|
+
|
|
110
|
+
? Select a task to work on:
|
|
111
|
+
--- In Progress (your worktrees) ---
|
|
112
|
+
❯ #42 Add OAuth support [feature] !
|
|
113
|
+
Worktree: myproject-oauth-support
|
|
114
|
+
--- Available Tasks ---
|
|
115
|
+
#38 Fix login timeout [bug] ~
|
|
116
|
+
|
|
117
|
+
✓ Resuming: #42 Add OAuth support
|
|
118
|
+
✓ Updated TASK_CONTEXT.md with latest notes
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Generated Files
|
|
122
|
+
|
|
123
|
+
The CLI creates these files in the worktree:
|
|
124
|
+
|
|
125
|
+
**`TASK_CONTEXT.md`** - Full task context for Claude:
|
|
126
|
+
- Critical rules (must-follow patterns)
|
|
127
|
+
- Damper workflow instructions
|
|
128
|
+
- Task description and implementation plan
|
|
129
|
+
- Previous session notes and commits
|
|
130
|
+
- Project architecture docs
|
|
131
|
+
- Available templates and modules
|
|
132
|
+
- Linked customer feedback
|
|
133
|
+
|
|
134
|
+
**`CLAUDE.md`** (appended) - Task-specific section pointing to TASK_CONTEXT.md
|
|
135
|
+
|
|
136
|
+
### Task Lifecycle (handled by Claude via MCP)
|
|
137
|
+
|
|
138
|
+
Once Claude is running, it handles:
|
|
139
|
+
- `add_commit` - Log commits to Damper
|
|
140
|
+
- `add_note` - Record decisions and progress
|
|
141
|
+
- `complete_task` - Mark done with summary
|
|
142
|
+
- `abandon_task` - Hand off with notes for next agent
|
|
143
|
+
|
|
144
|
+
## Environment Variables
|
|
145
|
+
|
|
146
|
+
| Variable | Description |
|
|
147
|
+
|----------|-------------|
|
|
148
|
+
| `DAMPER_API_KEY` | Your Damper API key (or configure via `setup`) |
|
|
149
|
+
| `DAMPER_API_URL` | API URL override (default: `https://api.usedamper.com`) |
|
|
150
|
+
|
|
151
|
+
## How it Works
|
|
152
|
+
|
|
153
|
+
### Worktree Isolation
|
|
154
|
+
|
|
155
|
+
Each task gets its own git worktree:
|
|
156
|
+
```
|
|
157
|
+
myproject/ # Main repo
|
|
158
|
+
../myproject-oauth-support/ # Task #42 worktree
|
|
159
|
+
../myproject-fix-login/ # Task #38 worktree
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
The CLI automatically:
|
|
163
|
+
- Creates the worktree with a feature branch
|
|
164
|
+
- Symlinks `node_modules` (detects monorepo structure)
|
|
165
|
+
- Copies `.env` files
|
|
166
|
+
|
|
167
|
+
### Context from Damper
|
|
168
|
+
|
|
169
|
+
The CLI fetches from Damper:
|
|
170
|
+
- Task details (description, plan, subtasks)
|
|
171
|
+
- Project context (architecture, conventions)
|
|
172
|
+
- Critical rules (shown prominently to Claude)
|
|
173
|
+
- Templates (code patterns to follow)
|
|
174
|
+
- Modules (monorepo structure)
|
|
175
|
+
- Previous agent notes (for continuity)
|
|
176
|
+
|
|
177
|
+
This context survives Claude conversation compaction because it's in local files.
|
|
178
|
+
|
|
179
|
+
### State Tracking
|
|
180
|
+
|
|
181
|
+
Worktree-to-task mappings are stored in `~/.damper/worktrees.json`. This enables:
|
|
182
|
+
- Showing "resume" options for in-progress tasks
|
|
183
|
+
- Detecting stale worktrees for cleanup
|
|
184
|
+
- Tracking across multiple projects
|
|
185
|
+
|
|
186
|
+
## Parallel Work
|
|
187
|
+
|
|
188
|
+
Run multiple instances in different terminals:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# Terminal 1
|
|
192
|
+
npx @damper/cli --task 42
|
|
193
|
+
|
|
194
|
+
# Terminal 2
|
|
195
|
+
npx @damper/cli --task 38
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Each task gets its own worktree and Claude session.
|
|
199
|
+
|
|
200
|
+
## License
|
|
201
|
+
|
|
202
|
+
MIT
|