Skip to content

Commit 47838d2

Browse files
MrFlounderclaude
andcommitted
docs: update README and cheat sheet for multi-project support
Update README with multi-project setup flow, directory structure, FAQ, and config examples. Move MULTI-PROJECT section to top of cheat sheet with expanded command reference. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent dec8bb6 commit 47838d2

File tree

2 files changed

+85
-24
lines changed

2 files changed

+85
-24
lines changed

README.md

Lines changed: 68 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
< >
88
```
99

10-
A lightning-fast tmux-based workspace manager for multi-repo development. Start a full dev environment in seconds.
10+
A lightning-fast tmux-based workspace manager for multi-repo development. Manage multiple projects, start full dev environments in seconds.
1111

1212
## Quick Start
1313

@@ -19,9 +19,9 @@ brew install tmux yq # macOS
1919
# 2. Install crabcode
2020
curl -fsSL https://raw.githubusercontent.com/promptfoo/crabcode/main/install.sh | bash
2121

22-
# 3. Setup (2 questions: repo path + workspace dir)
22+
# 3. Register your project (3 questions: repo path, alias, workspace dir)
2323
cd ~/Dev/my-project
24-
crab init
24+
crab init # → alias: myproj
2525

2626
# 4. Auto-detect .env files and ports
2727
crab config scan
@@ -39,6 +39,14 @@ Run `crab ws 1` and get:
3939
- Tmux window with terminal, server, and your preferred tools
4040
- Shared volume for local experiments (`.local/`)
4141

42+
Managing multiple projects? Each gets its own alias:
43+
44+
```bash
45+
crab @pf ws 1 # promptfoo-cloud workspace
46+
crab @cb ws 1 # crabcode workspace
47+
crab projects # list all registered projects
48+
```
49+
4250
## Commands
4351

4452
Use `crab` (or `crabcode`) for all commands.
@@ -116,7 +124,7 @@ crab slack users # List workspace users
116124
crab slack users mike # Search by name
117125
```
118126

119-
**Setup:** Add to `~/.crabcode/config.yaml`:
127+
**Setup:** Add to your project config (`~/.crabcode/projects/<alias>.yaml`):
120128

121129
```yaml
122130
slack:
@@ -126,10 +134,28 @@ slack:
126134
127135
Messages appear with 🦀 icon and show `[Your Name] message` so recipients know who sent it.
128136

137+
### Multi-Project Commands
138+
139+
Manage multiple repos from a single crabcode install. Each project gets an alias.
140+
141+
```bash
142+
crab init # Register a new project (asks for alias)
143+
crab init -t <template> # Register with a template
144+
crab @pf ws 1 # Open workspace 1 for project "pf"
145+
crab @cb config # Show config for project "cb"
146+
crab ws 1 # Uses default project (or detects from cwd)
147+
crab projects # List all registered projects
148+
crab projects rm <alias> # Remove a project registration
149+
crab default pf # Set default project
150+
crab default # Show current default
151+
```
152+
153+
Project configs live in `~/.crabcode/projects/<alias>.yaml`. When you run commands from a workspace directory, crabcode auto-detects which project you're in.
154+
129155
### Config Commands
130156

131157
```bash
132-
crab init # Minimal setup (2 questions)
158+
crab init # Register a project (3 questions)
133159
crab config scan # Auto-detect .env files and ports
134160
crab config # Show current configuration
135161
```
@@ -164,17 +190,20 @@ crab cheat # Show cheat sheet
164190

165191
## Setup Flow
166192

167-
### 1. Initialize (minimal)
193+
### 1. Register your project
168194

169195
```bash
170196
cd ~/Dev/my-project
171197
crab init
172198
```
173199

174-
You'll be asked 2 questions:
200+
You'll be asked 3 questions:
175201
- **Main repo path** - where your project lives (defaults to current dir)
202+
- **Project alias** - short name like `pf`, `cb` (defaults to repo dirname)
176203
- **Workspace directory** - where to create worktrees (defaults to `<repo>-workspaces`)
177204

205+
This creates `~/.crabcode/projects/<alias>.yaml`.
206+
178207
### 2. Scan for ports
179208

180209
```bash
@@ -185,17 +214,36 @@ This scans your repo for `.env` and `.env.example` files, finds port variables,
185214

186215
### 3. Customize config
187216

188-
Edit `~/.crabcode/config.yaml` to set:
217+
Edit `~/.crabcode/projects/<alias>.yaml` to set:
189218
- **Layout panes** - your dev server command, main tool
190219
- **Shared volume** - persistent storage across resets
191220
- **Submodules** - if your project has git submodules
192221

222+
### 4. Add more projects
223+
224+
```bash
225+
cd ~/Dev/another-project
226+
crab init # → alias: another
227+
crab projects # see both projects
228+
```
229+
193230
## Configuration
194231

195-
Config file: `~/.crabcode/config.yaml`
232+
```
233+
~/.crabcode/
234+
config.yaml # global prefs (default_project)
235+
projects/
236+
pf.yaml # per-project config
237+
cb.yaml # per-project config
238+
wip/
239+
pf/ # per-project WIP isolation
240+
cb/
241+
```
242+
243+
Per-project config (`~/.crabcode/projects/<alias>.yaml`):
196244
197245
```yaml
198-
session_name: crab
246+
session_name: pf
199247
workspace_base: ~/Dev/my-project-workspaces
200248
main_repo: ~/Dev/my-project
201249
@@ -330,13 +378,13 @@ With prefix `Ctrl+a`:
330378
5. **Setup crabcode:**
331379
```bash
332380
cd ~/Dev/your-project
333-
crab init # 2 questions: repo path + workspace dir
381+
crab init # 3 questions: repo path, alias, workspace dir
334382
crab config scan # auto-detect .env files and ports
335383
```
336384

337385
6. **Edit config for your project:**
338386
```bash
339-
# Set your layout commands in ~/.crabcode/config.yaml
387+
# Set your layout commands in ~/.crabcode/projects/<alias>.yaml
340388
# - server pane: your dev server (e.g., pnpm dev)
341389
# - main pane: your main tool (e.g., claude)
342390
```
@@ -354,7 +402,14 @@ With branches, switching context means stashing changes, checking out, reinstall
354402

355403
### Can I use crabcode with multiple projects?
356404

357-
Yes! Each project gets its own `~/.crabcode/config.yaml`. Run `crab init` in each project directory. Crabcode detects which project you're in based on your current directory.
405+
Yes! Each project gets an alias and its own config at `~/.crabcode/projects/<alias>.yaml`. Run `crab init` in each project directory. Use `crab @alias <cmd>` to target a specific project, or just run commands from a workspace directory — crabcode auto-detects which project you're in.
406+
407+
```bash
408+
crab @pf ws 1 # explicit project
409+
crab ws 1 # uses default or auto-detects from cwd
410+
crab projects # see all registered projects
411+
crab default pf # set default project
412+
```
358413

359414
### How do I clean up old workspaces?
360415

src/crabcode

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6083,6 +6083,23 @@ show_cheat() {
60836083
║ ║
60846084
╠═══════════════════════════════════════════════════════════════════════════════╣
60856085
║ ║
6086+
║ MULTI-PROJECT (crab @alias ...) ║
6087+
║ ──────────────────────────────────────────────────────────────────────── ║
6088+
║ crab init Register a new project (asks for alias) ║
6089+
║ crab init -t <tpl> Register with template (e.g., promptfoo-cloud) ║
6090+
║ crab @pf ws 1 Open workspace 1 for project "pf" ║
6091+
║ crab @cb config Show config for project "cb" ║
6092+
║ crab ws 1 Uses default project (or detects from cwd) ║
6093+
║ crab projects List all registered projects ║
6094+
║ crab projects rm <a> Remove a project registration ║
6095+
║ crab default pf Set default project ║
6096+
║ crab default Show current default ║
6097+
║ ║
6098+
║ Config: ~/.crabcode/projects/<alias>.yaml ║
6099+
║ Auto-detect: crab figures out which project from your cwd ║
6100+
║ ║
6101+
╠═══════════════════════════════════════════════════════════════════════════════╣
6102+
║ ║
60866103
║ WORKSPACE COMMANDS (crab ws ...) ║
60876104
║ ──────────────────────────────────────────────────────────────────────── ║
60886105
║ crab ws Interactive menu (list + actions) ║
@@ -6145,19 +6162,8 @@ show_cheat() {
61456162
║ ║
61466163
╠═══════════════════════════════════════════════════════════════════════════════╣
61476164
║ ║
6148-
║ MULTI-PROJECT (crab @alias ...) ║
6149-
║ ──────────────────────────────────────────────────────────────────────── ║
6150-
║ crab @pf ws 1 Open workspace 1 for project "pf" ║
6151-
║ crab ws 1 Uses default project ║
6152-
║ crab projects List all registered projects ║
6153-
║ crab default pf Set default project ║
6154-
║ crab init Register a new project (asks for alias) ║
6155-
║ ║
6156-
╠═══════════════════════════════════════════════════════════════════════════════╣
6157-
║ ║
61586165
║ OTHER COMMANDS ║
61596166
║ ──────────────────────────────────────────────────────────────────────── ║
6160-
║ crab init Minimal setup (2 questions) ║
61616167
║ crab config scan Auto-detect .env files and ports ║
61626168
║ crab config Show current configuration ║
61636169
║ crab doctor Diagnose common issues ║

0 commit comments

Comments
 (0)