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

Commit 63108f8

Browse files
christseclaude
andcommitted
Add batch upload and track --push features
Features: - Add batch upload via /_atomic endpoint for efficient multi-file uploads - Add --push flag to track command for automatic server sync - Cache JWT at startup in long-running processes (track, watch) - Add -v/--verbose flag to sync, track, watch, push, pull commands Batch upload features: - Efficient batching with configurable batch size and payload limits - Fallback strategy: full batch → half batches → individual uploads - Verbose logging shows file lists, payload sizes, server responses - Proper error handling with detailed error messages from /_atomic Documentation: - Update CLAUDE.md with track --push workflow - Update README with verbose mode section and examples - Document real-time local-to-server sync workflow Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f80821c commit 63108f8

19 files changed

Lines changed: 1376 additions & 331 deletions

.claude/CLAUDE.md

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,6 @@ npx boxel profile switch username # Switch by partial match
9999

100100
## Available Skills
101101

102-
### `/track` - Track Local Edits
103-
Starts `boxel track` to auto-checkpoint local file changes:
104-
- Creates checkpoints as you save files in IDE
105-
- **IMPORTANT:** Track creates LOCAL checkpoints only
106-
- **After editing, run `boxel sync . --prefer-local` to push to server**
107-
108102
### `/watch` - Smart Watch
109103
Starts `boxel watch` with intelligent interval based on context:
110104
- **Active development** (5s interval, 3s debounce): When editing files
@@ -120,7 +114,7 @@ Complete restore workflow:
120114

121115
### `/sync` - Smart Sync
122116
Context-aware bidirectional sync:
123-
- After local edits or track `--prefer-local`
117+
- After local edits → `--prefer-local`
124118
- After server changes → `--prefer-remote`
125119
- After restore → `--prefer-local` (essential for syncing deletions)
126120

@@ -151,18 +145,23 @@ boxel sync . --dry-run # Preview only
151145
boxel track . # Track local edits, auto-checkpoint as you save
152146
boxel track . -d 5 -i 30 # 5s debounce, 30s min between checkpoints
153147
boxel track . -q # Quiet mode
148+
boxel track . --push # Auto-push changes to server (batch upload)
149+
boxel track . --push -v # Push with verbose logging
154150
```
155151

156152
**Use track when:** Editing locally in IDE/VS Code. Creates checkpoints as you save files.
157153
**Symbol:** ⇆ (horizontal arrows = local changes)
158154

155+
**--push mode:** Automatically batch uploads changes to the server after each checkpoint using the `/_atomic` endpoint. Efficient for real-time sync workflows.
156+
159157
### Watch ⇅ (Remote Server Watching)
160158
```bash
161159
boxel watch # Watch all configured realms (from .boxel-workspaces.json)
162160
boxel watch . # Watch single workspace
163161
boxel watch . ./other-realm # Watch multiple realms simultaneously
164162
boxel watch . -i 5 -d 3 # Active: 5s interval, 3s debounce
165163
boxel watch . -q # Quiet mode
164+
boxel watch . -v # Verbose logging
166165
```
167166

168167
**Use watch when:** Others are editing in Boxel web UI. Pulls their changes and creates checkpoints.
@@ -238,6 +237,7 @@ boxel gather . -s /path/to/repo # Pull from GitHub repo
238237
```
239238

240239
**Share** copies workspace state to a GitHub repo branch:
240+
- Copies to repo root by default (use `--subfolder` to target a specific directory)
241241
- Preserves repo-level files (package.json, LICENSE, README, etc.)
242242
- Skips realm-specific files (.realm.json, index.json, cards-grid.json)
243243
- Creates branch and commits changes
@@ -274,25 +274,21 @@ boxel skills --export . # Re-export to .claude/commands/
274274

275275
## Key Workflows
276276

277-
### Local Development with Track (IDE/Agent Editing)
278-
```bash
279-
boxel track . # Start tracking local edits (auto-checkpoints)
280-
# ... edit files in IDE or with Claude ...
281-
# Track creates LOCAL checkpoints as you save
282-
283-
# IMPORTANT: When ready to push changes to Boxel server:
284-
boxel sync . --prefer-local # Push your local changes to server
285-
```
286-
287-
**Remember:** Track does NOT sync to server automatically - it only creates local checkpoints. Always run `sync --prefer-local` when you want your changes live on the server.
288-
289-
### Active Development Session (Watching Server)
277+
### Active Development Session
290278
```bash
291279
/watch # Starts with 5s interval
292280
# ... edit in Boxel UI or locally ...
293281
/sync # Push/pull changes
294282
```
295283

284+
### Real-Time Local-to-Server Sync
285+
```bash
286+
boxel track . --push -d 2 -i 5 # Track + auto-push with 2s debounce, 5s interval
287+
# Edit files in IDE - changes auto-sync to server via batch upload
288+
```
289+
290+
**Use this when:** You want instant sync to server as you edit locally. Uses the efficient `/_atomic` batch upload endpoint.
291+
296292
### Undo Server Changes (Restore)
297293
```bash
298294
boxel history . # Find checkpoint

.claude/commands/track.md

Lines changed: 0 additions & 84 deletions
This file was deleted.

.claude/settings.local.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(grep:*)",
5+
"Bash(npm run dev:*)",
6+
"Bash(ls:*)",
7+
"Bash(pdftotext:*)",
8+
"Bash(python3:*)",
9+
"Bash(npm run build:*)",
10+
"Bash(git checkout:*)",
11+
"Bash(git add:*)",
12+
"Bash(git commit:*)",
13+
"Bash(DEBUG=1 timeout 30 npm run dev:*)",
14+
"Bash(pkill:*)",
15+
"Bash(code:*)",
16+
"Bash(open:*)",
17+
"Bash(npm run:*)",
18+
"Bash(git push:*)",
19+
"Bash(npx boxel:*)",
20+
"Bash(git remote set-url:*)",
21+
"Bash(npm install:*)",
22+
"Bash(git fetch:*)",
23+
"Bash(git stash:*)",
24+
"Bash(git pull:*)",
25+
"Bash(git ls-tree:*)",
26+
"Bash(git status:*)",
27+
"Bash(git branch:*)",
28+
"Bash(xargs:*)",
29+
"Bash(cat:*)",
30+
"Bash(echo \"card definitions\" ls ./steady-loon/boxel-ai-website/SampleCard/*/*.json)",
31+
"Bash(zip:*)",
32+
"Bash(find:*)",
33+
"WebFetch(domain:images.pexels.com)",
34+
"WebSearch",
35+
"Bash(# Copy all instance directories explicitly SOURCE=\"\"/Users/chris/Documents/code/boxel-cli/steady-loon/boxel-ai-website/SampleCard\"\" DEST=\"\"/Users/chris/Documents/code/boxel-cli/hilarious-marmoset/placeholders\"\" for dir in AiImageCard AnalyticsDashboard BlogPost BrochureCard BudgetLineItemCard CodeReview ConferenceCard CourseModuleCard DesignAssetCard EventTicketCard ExpenseReportCard FitnessActivityCard FlashcardCard HotelRoomCard InventoryItemCard Invoice LeaseAgreementCard MaintenanceRequestCard MedicationReminderCard MeetingRoomCard PatientAppointmentCard PodcastEpisodeCard Product ProjectTracker PropertyListingCard RecipeCardCard RestaurantMenuItemCard SalesCrm ShipmentTrackingCard StockTickerCard StudentGradeCard StudyGuideCard SubscriptionPlanCard TimeEntryCard TradingCardCard TripItineraryCard VideoContentCard; do cp -rf \"\"$SOURCE/$dir\"\" \"\"$DEST/\"\" done echo \"\"Directories copied. Listing new directories:\"\" ls -d \"\"$DEST\"\"/*/)",
36+
"Bash(# List the orphan JSON files in placeholders root \\(not in subdirectories\\) ls /Users/chris/Documents/code/boxel-cli/hilarious-marmoset/placeholders/*.json)",
37+
"Bash(# Delete all orphan JSON files from placeholders root rm /Users/chris/Documents/code/boxel-cli/hilarious-marmoset/placeholders/*.json echo \"\"Deleted orphan JSON files\"\" ls /Users/chris/Documents/code/boxel-cli/hilarious-marmoset/placeholders/*.json)",
38+
"Bash(lsof:*)",
39+
"Bash(xattr:*)",
40+
"Bash(ssh-add:*)",
41+
"WebFetch(domain:github.com)",
42+
"WebFetch(domain:raw.githubusercontent.com)",
43+
"Bash(npx tsc:*)",
44+
"Bash(npx tsx:*)",
45+
"Bash(curl:*)"
46+
]
47+
}
48+
}

README.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,16 @@ boxel pull <url> ./local # One-way pull (remote → local)
205205
boxel track . # Track local edits, auto-checkpoint
206206
boxel track . -d 5 -i 30 # 5s debounce, 30s min between checkpoints
207207
boxel track . -q # Quiet mode
208+
boxel track . --push # Auto-push to server via batch upload
209+
boxel track . --push -v # Push with verbose logging
208210

209211
# Watch REMOTE server changes (pull external updates)
210212
boxel watch . # Watch single workspace (30s default)
211213
boxel watch . ./other-realm # Watch multiple realms
212214
boxel watch # Watch all configured realms
213215
boxel watch . -i 5 -d 3 # 5s interval, 3s debounce
214216
boxel watch . -q # Quiet mode
217+
boxel watch . -v # Verbose logging
215218

216219
# Stop all watchers and trackers
217220
boxel stop # Stops all running watch (⇅) and track (⇆) processes
@@ -225,6 +228,7 @@ boxel status . --pull # Auto-pull changes
225228
| Command | Symbol | Direction | Purpose |
226229
|---------|--------|-----------|---------|
227230
| `track` || Local → Checkpoints | Backup your IDE edits as you type |
231+
| `track --push` || Local → Server | Real-time sync to server (batch upload) |
228232
| `watch` || Server → Local | Pull external changes from Boxel web UI |
229233

230234
### History & Checkpoints
@@ -301,14 +305,9 @@ boxel skills --export . # Export to .claude/commands/
301305
boxel track . # Start tracking local edits
302306
# In another terminal or IDE, edit files...
303307
# Checkpoints created automatically as you save
304-
305-
# IMPORTANT: Track creates LOCAL checkpoints only!
306-
# When ready to push changes to Boxel server:
307308
boxel sync . --prefer-local # Push changes to server
308309
```
309310

310-
**Remember:** `track` does NOT sync to server - it only creates local checkpoints for safety. Always run `sync --prefer-local` when you want your changes live.
311-
312311
### Active Development (with edit lock)
313312
```bash
314313
boxel edit . my-card.gts # Lock file (if watch is running)
@@ -508,6 +507,26 @@ cat ./Type/card-id.json
508507
| Files reverting after restore | Stop watch first, use `--prefer-local` after |
509508
| Watch not detecting changes | Check interval, verify workspace URL |
510509
| Definition changes not reflected | `boxel touch . Instance/file.json` |
510+
| Need more details on errors | Add `-v` or `--verbose` flag |
511+
512+
### Verbose Mode
513+
514+
Most commands support verbose logging with `-v` or `--verbose`:
515+
516+
```bash
517+
boxel sync . --prefer-local -v # Detailed sync logging
518+
boxel track . --push -v # See batch upload details
519+
boxel watch . -v # JWT and polling info
520+
boxel push ./local <url> -v # Upload debugging
521+
boxel pull <url> ./local -v # Download debugging
522+
```
523+
524+
Verbose output shows:
525+
- Matrix authentication details
526+
- JWT acquisition timing
527+
- Batch upload operations (file lists, payload sizes)
528+
- Server response status codes
529+
- Error details from `/_atomic` endpoint
511530

512531
---
513532

0 commit comments

Comments
 (0)