Skip to content
This repository was archived by the owner on Jun 4, 2026. It is now read-only.

Commit 0b7ad86

Browse files
christseclaude
andcommitted
Restructure CLI commands, add default workspace root, update docs
PR review changes (P1–P4): - Show push error details in track --push (quiet: false + error loop) - Conservative defaults for repair-realms (fixIndex/touchIndex/matchEndpoint off) - Full realm server hostname in folder naming (no normalization) - Simplified name selection: only overwrite bad names, not mismatched ones - Validate realms remove (error if path not found) - Rename list → workspace-list (with list alias) - Migrate realms to positional subcommands (realms add/remove/init/llm) - Add boxel doctor parent command (repair-realm, repair-realms, consolidate-workspaces, force-reindex) - Hidden backwards-compat aliases for all renamed commands Default workspace root: - Add defaultWorkspacesRoot() → ~/boxel-workspaces/ (all platforms) - Wire into workspace-resolver, consolidate, legacy path warning - Make pull local-dir argument optional (defaults to ~/boxel-workspaces/) Documentation: - Update all .md files with new command nomenclature - Add terminology section (realm vs workspace) to README - Document ~/boxel-workspaces/ as default root everywhere - Update onboarding flow to use boxel pull <url> Tests: - 28 new tests: workspace-paths, realm-config, repair (isBadName, selectNextName, batch defaults) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 087abbf commit 0b7ad86

16 files changed

Lines changed: 678 additions & 224 deletions

.claude/CLAUDE.md

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ BOXEL_PASSWORD="password" npx boxel profile add -u @username:boxel.ai -n "My Pro
8080
8181
### Step 3: Verify & List Workspaces
8282
```bash
83-
npx boxel list
83+
npx boxel workspace-list
8484
```
8585

86-
### Step 4: First Sync
87-
Help them sync their first workspace:
86+
### Step 4: First Pull
87+
Help them pull their first workspace (defaults to `~/boxel-workspaces/`):
8888
```bash
89-
npx boxel sync @username/workspace ./workspace-name
89+
npx boxel pull https://app.boxel.ai/username/workspace/
9090
```
9191

9292
### Switching Between Profiles
@@ -99,33 +99,32 @@ npx boxel profile switch username # Switch by partial match
9999

100100
## Local Workspace Organization
101101

102-
When syncing multiple workspaces locally, organize them by **domain/username/realm** to mirror the Matrix ID structure (`@username:domain`):
102+
The CLI stores synced workspaces under `~/boxel-workspaces/` by default, organized by **realm-server-hostname/username/realm**:
103103

104104
```
105-
boxel-workspaces/
106-
├── boxel.ai/ # Production domain
107-
│ └── acme-corp/ # Username
108-
│ ├── personal/ # Realm
105+
~/boxel-workspaces/ # Default root (all platforms)
106+
├── app.boxel.ai/ # Production realm server
107+
│ └── acme-corp/
108+
│ ├── personal/
109109
│ ├── project-atlas/
110110
│ └── inventory-tracker/
111-
└── stack.cards/ # Staging domain
111+
└── realms-staging.stack.cards/ # Staging realm server
112112
└── acme-corp/
113113
└── sandbox/
114114
```
115115

116+
**Default root:** `~/boxel-workspaces/` on macOS, Linux, and Windows. Override by passing an explicit local path to `pull` or `sync`.
117+
116118
**Benefits:**
117-
- Clear separation between production and staging environments
118-
- Matches the `@username:domain` profile ID format
119-
- Easy to identify which profile/environment a workspace belongs to
120-
- Supports multiple users on the same machine
119+
- Full realm server hostname as folder name eliminates staging/production ambiguity
120+
- Each environment is clearly identifiable by its path
121+
- No collision between realms on different servers
121122

122-
**First-time sync to this structure:**
123+
**First-time sync:**
123124
```bash
124-
# Production workspace
125-
boxel pull https://app.boxel.ai/acme-corp/project-atlas/ ./boxel-workspaces/boxel.ai/acme-corp/project-atlas
126-
127-
# Staging workspace
128-
boxel pull https://realms-staging.stack.cards/acme-corp/sandbox/ ./boxel-workspaces/stack.cards/acme-corp/sandbox
125+
# The CLI automatically places workspaces under ~/boxel-workspaces/
126+
boxel pull https://app.boxel.ai/acme-corp/project-atlas/
127+
boxel pull https://realms-staging.stack.cards/acme-corp/sandbox/
129128
```
130129

131130
---
@@ -160,8 +159,8 @@ Context-aware bidirectional sync:
160159
### `/repair` - Realm Metadata/Card Repair
161160
Use when workspaces show missing icon/background, wrong display name, or fail to open due to broken `index.json`/`cards-grid.json` links.
162161
- Read `.claude/commands/repair.md` for the step-by-step repair flow.
163-
- `boxel repair-realm <url>` repairs one realm
164-
- `boxel repair-realms` repairs all owned realms (excluding `personal` by default)
162+
- `boxel doctor repair-realm <url>` repairs one realm
163+
- `boxel doctor repair-realms` repairs all owned realms (excluding `personal` by default)
165164
- Also reconciles Matrix account data (`app.boxel.realms`) unless disabled
166165

167166
---
@@ -246,12 +245,12 @@ boxel stop # Stop all running watch (⇅) and track (⇆)
246245
### Realms (Multi-Realm Configuration)
247246
```bash
248247
boxel realms # List configured realms
249-
boxel realms --init # Create .boxel-workspaces.json
250-
boxel realms --add ./path # Add a realm
251-
boxel realms --add ./code --purpose "Card definitions" --patterns "*.gts" --default
252-
boxel realms --add ./data --purpose "Data instances" --card-types "BlogPost,Product"
253-
boxel realms --llm # Output LLM guidance for file placement
254-
boxel realms --remove ./path # Remove a realm
248+
boxel realms init # Create .boxel-workspaces.json
249+
boxel realms add ./path # Add a realm
250+
boxel realms add ./code --purpose "Card definitions" --patterns "*.gts" --default
251+
boxel realms add ./data --purpose "Data instances" --card-types "BlogPost,Product"
252+
boxel realms llm # Output LLM guidance for file placement
253+
boxel realms remove ./path # Remove a realm
255254
```
256255

257256
**File placement guidance:** The `--llm` output tells Claude which realm to use for different file types and card types.
@@ -293,11 +292,11 @@ boxel profile migrate # Migrate from old .env file
293292

294293
### Other
295294
```bash
296-
boxel list # List workspaces
295+
boxel workspace-list # List workspaces
297296
boxel create endpoint "Name" # Create workspace
298-
boxel consolidate-workspaces . # Move legacy local dirs into domain/owner/realm
299-
boxel repair-realm <url> # Repair one realm metadata/starter cards
300-
boxel repair-realms # Batch repair all owned realms
297+
boxel doctor consolidate-workspaces # Fix workspace dirs (defaults to ~/boxel-workspaces/)
298+
boxel doctor repair-realm <url> # Repair one realm metadata/starter cards
299+
boxel doctor repair-realms # Batch repair all owned realms
301300
boxel pull <url> ./local # One-way pull
302301
boxel push ./local <url> # One-way push
303302
```
@@ -413,14 +412,14 @@ When working with multiple realms (e.g., code + data separation):
413412

414413
```bash
415414
# Configure realms once
416-
boxel realms --add ./code-realm --purpose "Card definitions" --patterns "*.gts" --default
417-
boxel realms --add ./data-realm --purpose "Content instances" --card-types "BlogPost,Product"
415+
boxel realms add ./code-realm --purpose "Card definitions" --patterns "*.gts" --default
416+
boxel realms add ./data-realm --purpose "Content instances" --card-types "BlogPost,Product"
418417

419418
# Watch all configured realms
420419
boxel watch
421420

422421
# Check where to put a new file
423-
boxel realms --llm
422+
boxel realms llm
424423
```
425424

426425
**File placement heuristics:**
@@ -669,7 +668,7 @@ The `/_atomic` endpoint supports batch file operations that succeed or fail atom
669668
- For staging: ensure profile uses `@username:stack.cards`
670669

671670
### "No workspace found"
672-
- Run `boxel list` to see workspaces
671+
- Run `boxel workspace-list` to see workspaces
673672
- Use full URL for first sync
674673
- Ensure correct profile is active for the environment
675674

.claude/commands/repair.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ Use this workflow when a workspace has any of these symptoms:
1010

1111
```bash
1212
# Inspect one realm without mutating
13-
boxel repair-realm <workspace-url> --dry-run
13+
boxel doctor repair-realm <workspace-url> --dry-run
1414

1515
# Repair one realm
16-
boxel repair-realm <workspace-url>
16+
boxel doctor repair-realm <workspace-url>
1717

1818
# Repair all realms owned by active profile user
19-
boxel repair-realms
19+
boxel doctor repair-realms
2020
```
2121

2222
## Behavior
2323

24-
`repair-realm` and `repair-realms` perform these repairs:
24+
`doctor repair-realm` and `doctor repair-realms` perform these repairs:
2525
- `.realm.json`: normalize `name`, `iconURL`, `backgroundURL`
2626
- `index.json`: ensure `relationships.cardsGrid.links.self` = `./cards-grid`
2727
- `cards-grid.json`: restore default cards-grid card if missing/corrupt

.claude/commands/setup.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ BOXEL_PASSWORD="password" npx boxel profile add -u @username:stack.cards -n "Sta
5252
5353
### 3. Verify
5454
```bash
55-
npx boxel list
55+
npx boxel workspace-list
5656
```
5757

5858
### 4. First Sync
59-
Help them sync a workspace:
59+
Help them pull a workspace (defaults to `~/boxel-workspaces/`):
6060
```bash
61-
npx boxel sync @username/workspace ./workspace-name
61+
npx boxel pull https://app.boxel.ai/username/workspace/
6262
```
6363

6464
## Profile Management
@@ -81,8 +81,8 @@ npx boxel profile migrate
8181
## Success Message
8282
```
8383
Setup complete! You can now:
84-
- `npx boxel list` - See your workspaces
85-
- `npx boxel sync @username/workspace` - Sync a workspace
84+
- `npx boxel workspace-list` - See your workspaces
85+
- `npx boxel pull <url>` - Pull a workspace to ~/boxel-workspaces/
8686
- `npx boxel watch .` - Monitor for changes
8787
- `npx boxel history .` - View/restore checkpoints
8888

AGENTS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ Trigger examples:
3838
- `sync`: bidirectional conflict resolution
3939
- `track`: local file watching with auto-checkpoints (use `--push` for real-time server sync)
4040
- `watch`: remote change watching (pulls server changes)
41-
- `repair-realm`: repair one realm metadata + starter cards + optional Matrix reconciliation
42-
- `repair-realms`: batch repair all owned realms and reconcile Matrix realm list
41+
- `doctor repair-realm`: repair one realm metadata + starter cards + optional Matrix reconciliation
42+
- `doctor repair-realms`: batch repair all owned realms and reconcile Matrix realm list
4343

4444
After local edits tracked with `track`, push to server with:
4545
- `boxel sync . --prefer-local`
@@ -49,16 +49,16 @@ After local edits tracked with `track`, push to server with:
4949
If user has no profile configured:
5050
1. `npx boxel profile`
5151
2. `npx boxel profile add` (interactive preferred)
52-
3. `npx boxel list`
53-
4. First sync/pull into local workspace
52+
3. `npx boxel workspace-list`
53+
4. First sync/pull into local workspace (default root: `~/boxel-workspaces/`)
5454

5555
Security note:
5656
- Prefer interactive password entry or `BOXEL_PASSWORD` env var.
5757
- Avoid plain `-p` password usage in shell history.
5858

5959
## Multi-Realm Guidance
60-
- Configure realms with `boxel realms --add ...`
61-
- Use `boxel realms --llm` for file-placement guidance.
60+
- Configure realms with `boxel realms add ...`
61+
- Use `boxel realms llm` for file-placement guidance.
6262
- Heuristic:
6363
- `.gts` -> code realm (`*.gts` pattern)
6464
- instances -> realm mapped for card type

0 commit comments

Comments
 (0)