clipwise 0.7.2 → 0.9.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.ko.md CHANGED
@@ -13,18 +13,32 @@ YAML 시나리오를 작성하면 시네마틱 데모 영상(MP4/GIF)을 자동
13
13
  ## 빠른 시작
14
14
 
15
15
  ```bash
16
- # 설치
17
- npm install -D clipwise
18
-
19
- # 내장 데모 즉시 실행
20
- npx clipwise demo
16
+ # 설치 불필요 — npx로 바로 실행 (package.json 무수정)
17
+ npx clipwise@latest demo # 내장 데모 즉시 실행
21
18
 
22
19
  # 또는 직접 시나리오 작성
23
- npx clipwise init # clipwise.yaml 템플릿 생성
24
- # clipwise.yaml 편집 — URL을 내 사이트로 변경
25
- npx clipwise record clipwise.yaml -f mp4 # 녹화!
20
+ npx clipwise@latest init # .clipwise/ 스캐폴딩 생성
21
+ # .clipwise/scenarios/demo.yaml 편집 — URL을 내 사이트로 변경
22
+ npx clipwise@latest record .clipwise/scenarios/demo.yaml
26
23
  ```
27
24
 
25
+ **Zero footprint**: Clipwise가 남기는 모든 것(시나리오, 픽스처, 인증 상태, 출력물)은
26
+ `.clipwise/` 디렉토리 하나에 담깁니다. `rm -rf .clipwise` 한 줄로 모든 흔적이 사라집니다.
27
+
28
+ ### 처음 5분 가이드
29
+
30
+ 1. `npx clipwise@latest init` — 바로 쓸 수 있는 시나리오 2개와 함께 `.clipwise/` 생성
31
+ 2. `npx clipwise@latest record .clipwise/scenarios/keynote.yaml` — **수정 없이** 키노트
32
+ 런치 영상이 렌더됩니다 (호스팅 데모 대시보드를 녹화)
33
+ 3. `.clipwise/output/keynote.mp4` 열기 — 이것이 기본으로 제공되는 퀄리티 기준입니다
34
+ 4. `keynote.yaml` 수정: `url:`과 셀렉터를 **내 앱**으로 교체, 캡션 문구 조정
35
+ 5. `brand.yaml` 수정: accent 컬러·폰트 프리셋·캐치프레이즈 — 영상 전체가 따라옵니다
36
+
37
+ 자연어가 편하시면 `npx clipwise install-skill` 후 Claude Code에서 `/clipwise`로
38
+ 요청하세요 — 키노트 레시피가 내장된 스킬이 YAML을 대신 작성합니다. 런치 영상이
39
+ 아니라 단순 화면 녹화가 필요하면 `scenarios/demo.yaml`과 아래
40
+ [YAML 시나리오 형식](#yaml-시나리오-형식)에서 시작하세요.
41
+
28
42
  ## 요구사항
29
43
 
30
44
  - **Node.js** >= 18
@@ -54,11 +68,11 @@ npx clipwise demo --device android # Android 목업
54
68
  npx clipwise demo --device ipad # iPad 목업
55
69
  npx clipwise demo --url https://my-app.com # 내 사이트 데모
56
70
 
57
- # YAML 시나리오로 녹화
58
- npx clipwise record <scenario.yaml> -f mp4 -o ./output
59
- npx clipwise record <scenario.yaml> -f gif -o ./output
71
+ # YAML 시나리오로 녹화 (출력 기본 위치: .clipwise/output)
72
+ npx clipwise record <scenario.yaml> -f mp4
73
+ npx clipwise record <scenario.yaml> -f gif -o ./custom-dir
60
74
 
61
- # 템플릿 초기화
75
+ # .clipwise/ 스캐폴딩 (시나리오, 픽스처, prepare 에셋, 인증 — 단일 디렉토리)
62
76
  npx clipwise init
63
77
 
64
78
  # 녹화 없이 검증만
@@ -107,9 +121,11 @@ Claude가 자동으로:
107
121
  2. `npx clipwise validate`로 검증
108
122
  3. `npx clipwise record`로 MP4 녹화
109
123
 
110
- ### 업데이트
124
+ ### 업데이트 / 제거
111
125
 
112
126
  clipwise 업그레이드 후 `npx clipwise install-skill`을 다시 실행하면 최신 스킬로 업데이트됩니다.
127
+ `npx clipwise install-skill --remove`로 언제든 제거할 수 있습니다 — 스킬 파일은
128
+ Clipwise가 `.clipwise/` 밖에 남기는 유일한 파일입니다.
113
129
 
114
130
  ## YAML 시나리오 형식
115
131
 
@@ -212,6 +228,118 @@ steps:
212
228
  - `holdDuration: 1500-2500` ms
213
229
  - `type.delay: 40-60` ms/글자
214
230
 
231
+ ### 인증
232
+
233
+ 브라우저 세션을 복원해 로그인 뒤 페이지를 녹화합니다. Playwright `storageState`
234
+ 파일(권장) 또는 인라인 쿠키를 지원합니다.
235
+
236
+ ```yaml
237
+ # 방법 1: Playwright storageState 파일 (쿠키 + localStorage)
238
+ auth:
239
+ storageState: ../auth/auth-state.json
240
+
241
+ # 방법 2: 인라인 쿠키
242
+ auth:
243
+ cookies:
244
+ - name: session_id
245
+ value: abc123
246
+ domain: .example.com
247
+ ```
248
+
249
+ 대화형 로그인으로 `storageState` 파일 생성:
250
+
251
+ ```bash
252
+ npx playwright codegen --save-storage=.clipwise/auth/auth-state.json https://my-app.com
253
+ ```
254
+
255
+ ### Prepare — 녹화 시 런타임 주입
256
+
257
+ **앱 코드를 건드리지 않고** 데모용으로 페이지를 조정합니다. `prepare`의 모든
258
+ 항목은 녹화 브라우저에만 주입됩니다 — 소스, 빌드, DB는 무접촉이며 참조 파일은
259
+ 전부 `.clipwise/` 안에 둡니다.
260
+
261
+ ```yaml
262
+ prepare:
263
+ # 데모에 어울리지 않는 요소 숨김 (쿠키 배너, dev 오버레이)
264
+ hide:
265
+ - "#cookie-banner"
266
+ - "[data-nextjs-toast]"
267
+
268
+ # 시계 동결 — 매 녹화마다 동일한 날짜 표시
269
+ freezeTime: "2026-06-10T09:00:00Z"
270
+
271
+ # Math.random 결정론화 — 매번 같은 차트/데이터
272
+ seedRandom: 42
273
+
274
+ # 앱 부팅 전 웹 스토리지 시드 (온보딩 건너뛰기, 플래그 설정)
275
+ storage:
276
+ localStorage:
277
+ onboarding_done: "true"
278
+
279
+ # API 응답 목(mock) — DB 시드 없이 데모 데이터 제공
280
+ mock:
281
+ - url: "/api/dashboard/stats" # URL 부분 문자열 매칭
282
+ fixture: ../fixtures/stats.json # 이 YAML 기준 상대 경로
283
+ - url: "/api/user"
284
+ body: { name: "Demo User" } # 또는 인라인
285
+
286
+ # 그 외 모든 것 — 임의 CSS/JS 주입
287
+ inject:
288
+ css: ../prepare/demo.css
289
+ ```
290
+
291
+ | 앱 코드를 수정하게 되는 압력 | Prepare 대체 |
292
+ |------------------------------|--------------|
293
+ | dev 오버레이/쿠키 배너 조건부 숨김 코드 | `hide:` |
294
+ | 시드 데이터를 가진 "데모 모드" 구현 | `mock:` |
295
+ | 일관된 데모를 위한 날짜/랜덤 스텁 | `freezeTime:` + `seedRandom:` |
296
+ | 녹화용 온보딩 사전 완료 분기 | `storage:` |
297
+
298
+ `freezeTime` + `seedRandom`을 함께 쓰면 녹화가 **결정론적**이 됩니다 —
299
+ 같은 시나리오는 몇 번을 돌려도 바이트 단위로 동일한 프레임을 만듭니다.
300
+
301
+ ### Scenes — 키노트 스타일 런치 영상 <sup>v0.9</sup>
302
+
303
+ `scenes:` 타임라인을 선언하면 `clipwise record` 한 번으로 완성된 런치 영상이
304
+ 렌더됩니다: 키네틱 타이포 → 푸티지 비네트(크롭/푸시인/분할, 셀렉터 기반 선
305
+ 드로잉 주석) → 아웃트로 — 컷을 넘어 이어지는 잉크 스레드로 연결됩니다.
306
+
307
+ ```yaml
308
+ viewport: { width: 1280, height: 800, deviceScaleFactor: 2 } # 2 = 레티나 출력
309
+
310
+ scenes:
311
+ - type: screen # 푸티지 테이크 — 1회 녹화, 비네트들이 인용
312
+ id: demo
313
+ steps: [...] # 기존 steps 문법 그대로
314
+
315
+ - type: motion # 키네틱 타이포 (내장 템플릿)
316
+ template: kinetic-type
317
+ duration: 2200
318
+ props: { lines: "Ship *demos*,||not edits.", size: 86 }
319
+
320
+ - type: vignette # 푸티지를 레이어로 — 카메라를 선언으로
321
+ footage: demo
322
+ duration: 4200
323
+ layout: crop # hero | crop | split
324
+ label: "Smart Speed"
325
+ caption: "로딩은 빠르게, *결과는 또렷하게*"
326
+ crop: { selector: ".panel", pad: 14 } # 픽셀이 아니라 셀렉터
327
+ push: { from: 1.05, to: 1 }
328
+ start: { step: 3 } # step 경계에서 인용 시작
329
+ rate: 1.15
330
+ fx: [{ kind: circle, selector: "#revenue", delay: 2500 }]
331
+ ```
332
+
333
+ **고퀄리티 레시피** (쇼케이스 영상이 이렇게 나오는 이유):
334
+ 1. `viewport.deviceScaleFactor: 2` — 레티나 해상도 캡처 (푸티지·타이포 전부)
335
+ 2. `prepare:` — 배너 숨김, 시간 동결, 랜덤 시드, API 목킹
336
+ 3. `.clipwise/brand.yaml` — 톤 프리셋, accent, 폰트 프리셋(`editorial` = Inter + Fraunces),
337
+ 캐치프레이즈. 선 드로잉 주석 + 연결 스레드는 자동 적용
338
+ 4. 구성: 키네틱 훅 → 히어로 푸시인 → 클로즈업 비네트 → 인터스티셜 → 분할(YAML × 푸티지) → 아웃트로
339
+
340
+ 가장 빠른 길: Claude Code 스킬 설치(`npx clipwise install-skill`) 후
341
+ `/clipwise`에 자연어로 요청하면 — 이 YAML을 대신 만들어줍니다.
342
+
215
343
  ## 이펙트
216
344
 
217
345
  모든 이펙트는 선택사항이며 합리적인 기본값이 있습니다.
@@ -279,6 +407,7 @@ deviceFrame:
279
407
  enabled: true
280
408
  type: browser # browser | iphone | ipad | android | none
281
409
  darkMode: true
410
+ url: "app.example.com" # 주소창 표시 URL (기본: localhost)
282
411
  ```
283
412
 
284
413
  | 타입 | 설명 |
package/README.md CHANGED
@@ -13,18 +13,32 @@ Scriptable cinematic screen recorder for product demos — YAML in, polished MP4
13
13
  ## Quick Start
14
14
 
15
15
  ```bash
16
- # Install
17
- npm install -D clipwise
18
-
19
- # Try the built-in demo instantly
20
- npx clipwise demo
16
+ # No install needed — run straight from npx (your package.json stays untouched)
17
+ npx clipwise@latest demo # Try the built-in demo instantly
21
18
 
22
19
  # Or create your own scenario
23
- npx clipwise init # Creates clipwise.yaml template
24
- # Edit clipwise.yaml — change URL to your site
25
- npx clipwise record clipwise.yaml -f mp4 # Record!
20
+ npx clipwise@latest init # Scaffolds .clipwise/ (single footprint dir)
21
+ # Edit .clipwise/scenarios/demo.yaml — change the URL to your site
22
+ npx clipwise@latest record .clipwise/scenarios/demo.yaml
26
23
  ```
27
24
 
25
+ **Zero footprint**: everything Clipwise touches lives in one `.clipwise/` directory —
26
+ scenarios, fixtures, auth state, output. Remove every trace with `rm -rf .clipwise`.
27
+
28
+ ### Your first 5 minutes
29
+
30
+ 1. `npx clipwise@latest init` — scaffolds `.clipwise/` with two ready scenarios
31
+ 2. `npx clipwise@latest record .clipwise/scenarios/keynote.yaml` — renders a full
32
+ keynote-style launch video **with zero edits** (it records the hosted demo dashboard)
33
+ 3. Open `.clipwise/output/keynote.mp4` — this is the quality bar you get out of the box
34
+ 4. Edit `keynote.yaml`: swap the `url:` and selectors for **your** app, tweak the captions
35
+ 5. Edit `brand.yaml`: your accent color, font preset, catchphrases — the whole video follows
36
+
37
+ Prefer natural language? `npx clipwise install-skill`, then ask `/clipwise` in
38
+ Claude Code — it writes these YAMLs for you (the skill ships with the full
39
+ keynote recipe). For a plain screen recording instead of a launch video, start
40
+ from `scenarios/demo.yaml` and the [YAML Scenario Format](#yaml-scenario-format) below.
41
+
28
42
  ## Requirements
29
43
 
30
44
  - **Node.js** >= 18
@@ -54,11 +68,11 @@ npx clipwise demo --device android # Android mockup
54
68
  npx clipwise demo --device ipad # iPad mockup
55
69
  npx clipwise demo --url https://my-app.com # Your deployed site
56
70
 
57
- # Record from YAML scenario
58
- npx clipwise record <scenario.yaml> -f mp4 -o ./output
59
- npx clipwise record <scenario.yaml> -f gif -o ./output
71
+ # Record from YAML scenario (output defaults to .clipwise/output)
72
+ npx clipwise record <scenario.yaml> -f mp4
73
+ npx clipwise record <scenario.yaml> -f gif -o ./custom-dir
60
74
 
61
- # Initialize a template
75
+ # Scaffold .clipwise/ (scenarios, fixtures, prepare assets, auth — one dir, zero footprint)
62
76
  npx clipwise init
63
77
 
64
78
  # Validate without recording
@@ -107,9 +121,11 @@ Claude will:
107
121
  2. Run `npx clipwise validate` to check for errors
108
122
  3. Run `npx clipwise record` to produce the MP4
109
123
 
110
- ### Update
124
+ ### Update / Remove
111
125
 
112
126
  Re-run `npx clipwise install-skill` after upgrading clipwise to get the latest skill.
127
+ Remove it anytime with `npx clipwise install-skill --remove` — the skill file is the
128
+ only thing Clipwise leaves outside `.clipwise/`.
113
129
 
114
130
  ## YAML Scenario Format
115
131
 
@@ -235,9 +251,97 @@ auth:
235
251
  Generate a `storageState` file by logging in interactively:
236
252
 
237
253
  ```bash
238
- npx playwright codegen --save-storage=auth-state.json https://my-app.com
254
+ npx playwright codegen --save-storage=.clipwise/auth/auth-state.json https://my-app.com
255
+ ```
256
+
257
+ ### Prepare — Recording-Time Injection
258
+
259
+ Tweak the page for the demo **without touching your app code**. Everything in
260
+ `prepare` is injected only into the recording browser — your source, build, and
261
+ database stay untouched, and all referenced files live in `.clipwise/`.
262
+
263
+ ```yaml
264
+ prepare:
265
+ # Hide elements that don't belong in a demo (cookie banners, dev overlays)
266
+ hide:
267
+ - "#cookie-banner"
268
+ - "[data-nextjs-toast]"
269
+
270
+ # Freeze the clock — dates render identically on every recording
271
+ freezeTime: "2026-06-10T09:00:00Z"
272
+
273
+ # Make Math.random deterministic — same charts/data every run
274
+ seedRandom: 42
275
+
276
+ # Seed web storage before the app boots (skip onboarding, set flags)
277
+ storage:
278
+ localStorage:
279
+ onboarding_done: "true"
280
+
281
+ # Mock API responses — demo data without seeding your database
282
+ mock:
283
+ - url: "/api/dashboard/stats" # URL substring match
284
+ fixture: ../fixtures/stats.json # relative to this YAML
285
+ - url: "/api/user"
286
+ body: { name: "Demo User" } # or inline
287
+
288
+ # Inject arbitrary CSS/JS for anything else
289
+ inject:
290
+ css: ../prepare/demo.css
239
291
  ```
240
292
 
293
+ | Pressure to modify app code | Prepare replacement |
294
+ |------------------------------|---------------------|
295
+ | Hide dev overlays / cookie banners conditionally | `hide:` |
296
+ | Build a "demo mode" with seeded data | `mock:` |
297
+ | Stub dates and randomness for consistent demos | `freezeTime:` + `seedRandom:` |
298
+ | Pre-complete onboarding for recordings | `storage:` |
299
+
300
+ Combined with `freezeTime` + `seedRandom`, recordings become **deterministic** —
301
+ the same scenario produces byte-identical frames run after run.
302
+
303
+ ### Scenes — Keynote-style launch videos <sup>v0.9</sup>
304
+
305
+ Declare a `scenes:` timeline and one `clipwise record` renders a complete
306
+ launch video: kinetic typography → footage vignettes (crop / push-in / split,
307
+ selector-anchored line annotations) → outro — connected by an ink thread that
308
+ travels across cuts.
309
+
310
+ ```yaml
311
+ viewport: { width: 1280, height: 800, deviceScaleFactor: 2 } # 2 = retina output
312
+
313
+ scenes:
314
+ - type: screen # footage take — recorded once, quoted by vignettes
315
+ id: demo
316
+ steps: [...] # the same steps you already know
317
+
318
+ - type: motion # kinetic typography (built-in templates)
319
+ template: kinetic-type
320
+ duration: 2200
321
+ props: { lines: "Ship *demos*,||not edits.", size: 86 }
322
+
323
+ - type: vignette # footage as a layer — camera is declarative
324
+ footage: demo
325
+ duration: 4200
326
+ layout: crop # hero | crop | split
327
+ label: "Smart Speed"
328
+ caption: "Loading compressed, *results crisp*"
329
+ crop: { selector: ".panel", pad: 14 } # selectors, not pixels
330
+ push: { from: 1.05, to: 1 }
331
+ start: { step: 3 } # quote from a step boundary
332
+ rate: 1.15
333
+ fx: [{ kind: circle, selector: "#revenue", delay: 2500 }]
334
+ ```
335
+
336
+ **Quality recipe** (what makes the showcase videos look the way they do):
337
+ 1. `viewport.deviceScaleFactor: 2` — retina-resolution capture (footage, type, everything)
338
+ 2. `prepare:` — hide banners, freeze time, seed randomness, mock APIs
339
+ 3. `.clipwise/brand.yaml` — tone preset, accent, font preset (`editorial` = Inter + Fraunces), catchphrases; line annotations + the connecting thread switch on automatically
340
+ 4. Structure: kinetic hook → hero push-in → close-up vignettes → interstitial → split (YAML × footage) → outro
341
+
342
+ The fastest path: install the Claude Code skill (`npx clipwise install-skill`)
343
+ and ask `/clipwise` in natural language — it generates this YAML for you.
344
+
241
345
  ## Effects
242
346
 
243
347
  All effects are optional and have sensible defaults.
@@ -309,6 +413,7 @@ deviceFrame:
309
413
  enabled: true
310
414
  type: browser # browser | iphone | ipad | android | none
311
415
  darkMode: true
416
+ url: "app.example.com" # address-bar display URL (default: localhost)
312
417
  ```
313
418
 
314
419
  | Type | Description |