appydave-tools 0.16.0 → 0.17.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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -0
  3. data/AGENTS.md +22 -0
  4. data/CHANGELOG.md +27 -0
  5. data/CLAUDE.md +206 -51
  6. data/README.md +153 -11
  7. data/bin/archive_project.rb +249 -0
  8. data/bin/configuration.rb +21 -1
  9. data/bin/generate_manifest.rb +357 -0
  10. data/bin/sync_from_ssd.rb +236 -0
  11. data/bin/vat +623 -0
  12. data/docs/README.md +169 -0
  13. data/docs/configuration/.env.example +19 -0
  14. data/docs/configuration/README.md +394 -0
  15. data/docs/configuration/channels.example.json +26 -0
  16. data/docs/configuration/settings.example.json +6 -0
  17. data/docs/development/CODEX-recommendations.md +230 -0
  18. data/docs/development/README.md +100 -0
  19. data/docs/development/cli-architecture-patterns.md +1604 -0
  20. data/docs/development/pattern-comparison.md +284 -0
  21. data/docs/prd-unified-brands-configuration.md +792 -0
  22. data/docs/project-brand-systems-analysis.md +934 -0
  23. data/docs/vat/dam-vision.md +123 -0
  24. data/docs/vat/session-summary-2025-11-09.md +478 -0
  25. data/docs/vat/usage.md +574 -0
  26. data/docs/vat/vat-testing-plan.md +801 -0
  27. data/lib/appydave/tools/configuration/models/brands_config.rb +238 -0
  28. data/lib/appydave/tools/configuration/models/config_base.rb +7 -0
  29. data/lib/appydave/tools/configuration/models/settings_config.rb +4 -0
  30. data/lib/appydave/tools/vat/config.rb +153 -0
  31. data/lib/appydave/tools/vat/config_loader.rb +91 -0
  32. data/lib/appydave/tools/vat/manifest_generator.rb +239 -0
  33. data/lib/appydave/tools/vat/project_listing.rb +198 -0
  34. data/lib/appydave/tools/vat/project_resolver.rb +132 -0
  35. data/lib/appydave/tools/vat/s3_operations.rb +560 -0
  36. data/lib/appydave/tools/version.rb +1 -1
  37. data/lib/appydave/tools.rb +9 -1
  38. data/package.json +1 -1
  39. metadata +57 -3
  40. data/docs/dam/overview.md +0 -28
data/docs/vat/usage.md ADDED
@@ -0,0 +1,574 @@
1
+ # VAT (Video Asset Tools) - Usage Guide
2
+
3
+ **VAT** is a unified CLI for managing video projects across local storage, S3 cloud collaboration, and SSD archival storage.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Quick Start](#quick-start)
8
+ - [Installation](#installation)
9
+ - [Configuration](#configuration)
10
+ - [Commands](#commands)
11
+ - [Examples](#examples)
12
+ - [Workflows](#workflows)
13
+ - [Troubleshooting](#troubleshooting)
14
+
15
+ ---
16
+
17
+ ## Quick Start
18
+
19
+ ```bash
20
+ # Install appydave-tools gem
21
+ gem install appydave-tools
22
+
23
+ # Initialize configuration
24
+ vat init
25
+
26
+ # List available brands
27
+ vat list
28
+
29
+ # List projects for a brand
30
+ vat list appydave
31
+
32
+ # Upload files to S3 for collaboration
33
+ vat s3-up appydave b65
34
+
35
+ # Download files from S3
36
+ vat s3-down appydave b65
37
+
38
+ # Check sync status
39
+ vat s3-status appydave b65
40
+ ```
41
+
42
+ ---
43
+
44
+ ## Installation
45
+
46
+ ### Install Gem
47
+
48
+ ```bash
49
+ gem install appydave-tools
50
+ ```
51
+
52
+ ### Initialize Configuration
53
+
54
+ ```bash
55
+ vat init
56
+ ```
57
+
58
+ This creates `~/.vat-config` pointing to your video projects directory.
59
+
60
+ ### AWS CLI Setup
61
+
62
+ VAT uses the AWS CLI for S3 operations. Install and configure:
63
+
64
+ ```bash
65
+ # Install AWS CLI (macOS)
66
+ brew install awscli
67
+
68
+ # Configure AWS credentials (if not using .video-tools.env)
69
+ aws configure
70
+ ```
71
+
72
+ ---
73
+
74
+ ## Configuration
75
+
76
+ ### System Configuration (`~/.vat-config`)
77
+
78
+ Created by `vat init`:
79
+
80
+ ```bash
81
+ VIDEO_PROJECTS_ROOT=/Users/yourname/dev/video-projects
82
+ ```
83
+
84
+ ### Brand Configuration (`.video-tools.env`)
85
+
86
+ Each brand directory contains a `.video-tools.env` file:
87
+
88
+ ```bash
89
+ # AWS Configuration
90
+ AWS_ACCESS_KEY_ID=AKIA...
91
+ AWS_SECRET_ACCESS_KEY=...
92
+ AWS_REGION=ap-southeast-1
93
+ S3_BUCKET=your-bucket-name
94
+ S3_STAGING_PREFIX=staging/v-appydave/
95
+
96
+ # SSD Backup Path
97
+ SSD_BASE=/Volumes/T7/youtube-PUBLISHED/appydave
98
+ ```
99
+
100
+ **Example template**: See `v-shared/video-asset-tools/.env.example` in your video-projects folder.
101
+
102
+ ---
103
+
104
+ ## Commands
105
+
106
+ ### Initialization & Help
107
+
108
+ #### `vat init`
109
+ Initialize VAT configuration.
110
+
111
+ ```bash
112
+ vat init
113
+ ```
114
+
115
+ #### `vat help [command]`
116
+ Show help information.
117
+
118
+ ```bash
119
+ vat help # Overview
120
+ vat help s3-up # Command-specific help
121
+ vat help brands # List available brands
122
+ vat help workflows # Explain FliVideo vs Storyline
123
+ ```
124
+
125
+ ### Project Discovery
126
+
127
+ #### `vat list [--summary] [brand] [pattern]`
128
+ List brands and projects.
129
+
130
+ **Mode 1: Brands only (clean list)**
131
+ ```bash
132
+ vat list
133
+ # Output: Brands: appydave, aitldr, joy, kiros, ss, voz
134
+ ```
135
+
136
+ **Mode 2: Brands with project counts (summary)**
137
+ ```bash
138
+ vat list --summary
139
+ # Output:
140
+ # appydave: 27 projects
141
+ # voz: 3 projects
142
+ # aitldr: 2 projects
143
+ ```
144
+
145
+ **Mode 3: Specific brand's projects**
146
+ ```bash
147
+ vat list appydave
148
+ # Output: Lists all AppyDave projects
149
+ ```
150
+
151
+ **Mode 3b: Pattern matching**
152
+ ```bash
153
+ vat list appydave 'b6*'
154
+ # Output: Lists b60, b61, b62...b69 projects
155
+ ```
156
+
157
+ ### S3 Sync Commands
158
+
159
+ #### `vat s3-up [brand] [project] [--dry-run]`
160
+ Upload files from local `s3-staging/` to S3.
161
+
162
+ ```bash
163
+ # With explicit args
164
+ vat s3-up appydave b65
165
+
166
+ # Auto-detect from current directory
167
+ cd ~/dev/video-projects/v-appydave/b65-project
168
+ vat s3-up
169
+
170
+ # Dry-run (preview without uploading)
171
+ vat s3-up appydave b65 --dry-run
172
+ ```
173
+
174
+ **What it does:**
175
+ - Uploads files from `project/s3-staging/` to S3
176
+ - Skips files already in sync (MD5 comparison)
177
+ - Shows progress and summary
178
+
179
+ #### `vat s3-down [brand] [project] [--dry-run]`
180
+ Download files from S3 to local `s3-staging/`.
181
+
182
+ ```bash
183
+ # With explicit args
184
+ vat s3-down appydave b65
185
+
186
+ # Auto-detect
187
+ cd ~/dev/video-projects/v-appydave/b65-project
188
+ vat s3-down
189
+
190
+ # Dry-run
191
+ vat s3-down voz boy-baker --dry-run
192
+ ```
193
+
194
+ **What it does:**
195
+ - Downloads files from S3 to `project/s3-staging/`
196
+ - Skips files already in sync
197
+ - Creates `s3-staging/` if it doesn't exist
198
+
199
+ #### `vat s3-status [brand] [project]`
200
+ Check sync status between local and S3.
201
+
202
+ ```bash
203
+ vat s3-status appydave b65
204
+ ```
205
+
206
+ **Output:**
207
+ ```
208
+ 📊 S3 Staging Status: v-appydave/b65-project
209
+
210
+ Local s3-staging/:
211
+ ✓ intro.mp4 (150.3 MB)
212
+ ↑ outro.mp4 (75.2 MB)
213
+
214
+ S3 (s3://bucket/staging/v-appydave/b65-project/):
215
+ ✓ intro.mp4 (150.3 MB)
216
+ ↓ chapter-1.mp4 (200.1 MB)
217
+
218
+ Status:
219
+ ✓ In sync: 1
220
+ ↑ Local only (need upload): 1
221
+ ↓ S3 only (need download): 1
222
+ ⚠️ Out of sync (file changed): 0
223
+ ```
224
+
225
+ #### `vat s3-cleanup-remote [brand] [project] [--dry-run] [--force]`
226
+ Delete S3 staging files for a project.
227
+
228
+ ```bash
229
+ # Preview what would be deleted
230
+ vat s3-cleanup-remote appydave b65 --dry-run
231
+
232
+ # Delete with confirmation prompt
233
+ vat s3-cleanup-remote appydave b65
234
+
235
+ # Delete without confirmation
236
+ vat s3-cleanup-remote appydave b65 --force
237
+ ```
238
+
239
+ **Warning:** This deletes files from S3. Use `--dry-run` first!
240
+
241
+ **Note:** The old `vat s3-cleanup` command still works but shows a deprecation warning.
242
+
243
+ #### `vat s3-cleanup-local [brand] [project] [--dry-run] [--force]`
244
+ Delete local s3-staging files for a project.
245
+
246
+ ```bash
247
+ # Preview what would be deleted
248
+ vat s3-cleanup-local appydave b65 --dry-run
249
+
250
+ # Delete with confirmation prompt
251
+ vat s3-cleanup-local appydave b65
252
+
253
+ # Delete without confirmation
254
+ vat s3-cleanup-local appydave b65 --force
255
+ ```
256
+
257
+ **Warning:** This deletes local files in the s3-staging directory. Use `--dry-run` first!
258
+
259
+ ### Project Management
260
+
261
+ #### `vat manifest [brand] [--all]`
262
+ Generate project manifest for a brand (tracks projects across local + SSD storage).
263
+
264
+ ```bash
265
+ # Generate manifest for specific brand
266
+ vat manifest appydave
267
+
268
+ # Generate manifests for all configured brands
269
+ vat manifest --all
270
+ ```
271
+
272
+ **What it does:**
273
+ - Scans local and SSD storage locations
274
+ - Tracks project distribution (local only, SSD only, or both)
275
+ - Calculates disk usage statistics
276
+ - Validates project ID formats
277
+ - Outputs `projects.json` in brand directory
278
+
279
+ **Example output:**
280
+ ```
281
+ 📊 Generating manifest for appydave...
282
+
283
+ ✅ Generated /path/to/v-appydave/projects.json
284
+ Found 27 unique projects
285
+
286
+ Distribution:
287
+ Local only: 15
288
+ SSD only: 8
289
+ Both locations: 4
290
+
291
+ Disk Usage:
292
+ Local: 45.3 GB
293
+ SSD: 120.7 GB
294
+
295
+ 🔍 Running validations...
296
+ ✅ All validations passed!
297
+ ```
298
+
299
+ #### `vat archive [brand] [project] [--dry-run] [--force]`
300
+ Archive completed project to SSD backup location.
301
+
302
+ ```bash
303
+ # Preview archive operation
304
+ vat archive appydave b63 --dry-run
305
+
306
+ # Copy to SSD (leaves local copy intact)
307
+ vat archive appydave b63
308
+
309
+ # Copy to SSD and delete local copy
310
+ vat archive appydave b63 --force
311
+ ```
312
+
313
+ **What it does:**
314
+ - Copies entire project directory to SSD backup location
315
+ - Verifies SSD is mounted before archiving
316
+ - Shows project size before copying
317
+ - Optional: Delete local copy after successful archive (--force)
318
+
319
+ **Configuration:** Uses `ssd_backup` location from `brands.json` config.
320
+
321
+ #### `vat sync-ssd [brand]`
322
+ Sync light files from SSD for brand.
323
+
324
+ ```bash
325
+ vat sync-ssd appydave
326
+ ```
327
+
328
+ **Status:** ⏳ Coming soon - restore projects from SSD backup
329
+
330
+ ---
331
+
332
+ ## Examples
333
+
334
+ ### Example 1: Collaboration Workflow (David → Jan)
335
+
336
+ **David (uploads to S3):**
337
+ ```bash
338
+ cd ~/dev/video-projects/v-appydave/b65-guy-monroe
339
+ # Place files in s3-staging/
340
+ mkdir -p s3-staging
341
+ cp ~/Downloads/intro-footage.mp4 s3-staging/
342
+
343
+ # Upload to S3
344
+ vat s3-up appydave b65
345
+ ```
346
+
347
+ **Jan (downloads from S3):**
348
+ ```bash
349
+ cd ~/dev/video-projects/v-appydave/b65-guy-monroe
350
+
351
+ # Check what's available
352
+ vat s3-status appydave b65
353
+
354
+ # Download files
355
+ vat s3-down appydave b65
356
+
357
+ # Edit files in s3-staging/
358
+ # ...
359
+
360
+ # Upload edited files back
361
+ vat s3-up appydave b65
362
+ ```
363
+
364
+ ### Example 2: Pattern Matching
365
+
366
+ ```bash
367
+ # List all b60-series projects
368
+ vat list appydave 'b6*'
369
+
370
+ # List all completed projects
371
+ vat list appydave 'b[1-5]*'
372
+ ```
373
+
374
+ ### Example 3: Cleanup After Project Completion
375
+
376
+ ```bash
377
+ # Archive to SSD
378
+ vat archive appydave b63
379
+
380
+ # Verify sync status
381
+ vat s3-status appydave b63
382
+
383
+ # Clean up S3 (saves storage costs)
384
+ vat s3-cleanup-remote appydave b63 --dry-run # Preview
385
+ vat s3-cleanup-remote appydave b63 --force # Execute
386
+ ```
387
+
388
+ ---
389
+
390
+ ## Workflows
391
+
392
+ ### FliVideo Workflow (AppyDave Brand)
393
+
394
+ **Pattern:** Sequential, chapter-based recording
395
+
396
+ **Project Naming:** `b65-guy-monroe-marketing-plan`
397
+
398
+ **Short Name Support:**
399
+ ```bash
400
+ vat s3-up appydave b65 # Expands to full project name
401
+ ```
402
+
403
+ **Typical Flow:**
404
+ 1. Record chapters sequentially
405
+ 2. Upload raw footage to S3 for collaboration
406
+ 3. Download edited chapters from S3
407
+ 4. Publish final video
408
+ 5. Archive to SSD
409
+
410
+ ### Storyline Workflow (VOZ, AITLDR Brands)
411
+
412
+ **Pattern:** Script-first, narrative-driven content
413
+
414
+ **Project Naming:** `boy-baker`, `the-point`
415
+
416
+ **Full Name Required:**
417
+ ```bash
418
+ vat s3-up voz boy-baker # Use full project name
419
+ ```
420
+
421
+ **Typical Flow:**
422
+ 1. Write script
423
+ 2. Record A-roll (main footage)
424
+ 3. Upload raw footage to S3
425
+ 4. Download edited version from S3
426
+ 5. Publish and archive
427
+
428
+ ---
429
+
430
+ ## Brand Shortcuts
431
+
432
+ VAT supports brand shortcuts for faster typing:
433
+
434
+ | Shortcut | Full Name | Purpose |
435
+ |----------|-----------|---------|
436
+ | `appydave` | `v-appydave` | AppyDave brand videos |
437
+ | `voz` | `v-voz` | VOZ client projects |
438
+ | `aitldr` | `v-aitldr` | AITLDR brand videos |
439
+ | `kiros` | `v-kiros` | Kiros client projects |
440
+ | `joy` | `v-beauty-and-joy` | Beauty & Joy brand |
441
+ | `ss` | `v-supportsignal` | SupportSignal client |
442
+
443
+ **Usage:**
444
+ ```bash
445
+ # Both are equivalent
446
+ vat list appydave
447
+ vat list v-appydave
448
+
449
+ # Both are equivalent
450
+ vat s3-up joy project-name
451
+ vat s3-up v-beauty-and-joy project-name
452
+ ```
453
+
454
+ ---
455
+
456
+ ## Troubleshooting
457
+
458
+ ### "VIDEO_PROJECTS_ROOT not configured"
459
+
460
+ **Solution:**
461
+ ```bash
462
+ vat init
463
+ ```
464
+
465
+ ### "Brand directory not found"
466
+
467
+ **Check available brands:**
468
+ ```bash
469
+ vat list
470
+ ```
471
+
472
+ **Verify config:**
473
+ ```bash
474
+ cat ~/.vat-config
475
+ ```
476
+
477
+ ### "No project found matching 'b65'"
478
+
479
+ **Possible causes:**
480
+ 1. Project doesn't exist in brand directory
481
+ 2. Wrong brand specified
482
+
483
+ **Debug:**
484
+ ```bash
485
+ # List all projects
486
+ vat list appydave
487
+
488
+ # Use full project name
489
+ vat s3-up appydave b65-full-project-name
490
+ ```
491
+
492
+ ### "AWS credentials not found"
493
+
494
+ **Solution 1:** Add to `.video-tools.env` in brand directory
495
+ ```bash
496
+ AWS_ACCESS_KEY_ID=AKIA...
497
+ AWS_SECRET_ACCESS_KEY=...
498
+ AWS_REGION=ap-southeast-1
499
+ ```
500
+
501
+ **Solution 2:** Configure AWS CLI
502
+ ```bash
503
+ aws configure
504
+ ```
505
+
506
+ ### "Could not detect brand and project from current directory"
507
+
508
+ **Solution:** Either:
509
+ 1. Provide explicit args: `vat s3-up appydave b65`
510
+ 2. Ensure you're in project directory: `cd v-appydave/b65-project`
511
+
512
+ ### Files Not Syncing (Always "Skipped")
513
+
514
+ **Cause:** Files haven't changed (MD5 hash matches)
515
+
516
+ **Solution:** If you need to force re-upload, delete from S3 first:
517
+ ```bash
518
+ vat s3-cleanup appydave b65 --force
519
+ vat s3-up appydave b65
520
+ ```
521
+
522
+ ---
523
+
524
+ ## Advanced Usage
525
+
526
+ ### Auto-Detection from PWD
527
+
528
+ All S3 commands support auto-detection:
529
+
530
+ ```bash
531
+ cd ~/dev/video-projects/v-appydave/b65-project
532
+
533
+ # These auto-detect brand and project
534
+ vat s3-up
535
+ vat s3-down
536
+ vat s3-status
537
+ ```
538
+
539
+ ### Dry-Run Mode
540
+
541
+ Preview actions without making changes:
542
+
543
+ ```bash
544
+ vat s3-up appydave b65 --dry-run
545
+ vat s3-down voz boy-baker --dry-run
546
+ vat s3-cleanup-remote aitldr movie-posters --dry-run
547
+ vat s3-cleanup-local appydave b65 --dry-run
548
+ ```
549
+
550
+ ### Interactive Selection
551
+
552
+ When multiple projects match short name:
553
+
554
+ ```bash
555
+ vat s3-up appydave b65
556
+ # Output:
557
+ # ⚠️ Multiple projects match 'b65':
558
+ # 1. b65-first-project
559
+ # 2. b65-second-project
560
+ # Select project (1-2):
561
+ ```
562
+
563
+ ---
564
+
565
+ ## See Also
566
+
567
+ - **AWS Setup Guide:** [docs/usage/vat/aws-setup.md](./vat/aws-setup.md)
568
+ - **Architecture:** [docs/usage/vat/architecture.md](./vat/architecture.md)
569
+ - **Onboarding:** [docs/usage/vat/onboarding.md](./vat/onboarding.md)
570
+ - **Integration Brief:** [docs/vat-integration-plan.md](../vat-integration-plan.md)
571
+
572
+ ---
573
+
574
+ **Last Updated:** 2025-11-08