asciinema_win 0.2.1 → 0.3.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +96 -41
- data/LICENSE +21 -21
- data/README.md +645 -655
- data/docs/architecture.md +113 -105
- data/docs/cheat-sheet.md +80 -80
- data/docs/customization.md +141 -141
- data/docs/example.md +350 -350
- data/docs/how-to-use.md +153 -153
- data/docs/test-report.md +165 -165
- data/docs/troubleshooting.md +94 -94
- data/docs/windows-notes.md +87 -87
- data/exe/asciinema_win +18 -17
- data/lib/asciinema_win/ansi_parser.rb +437 -437
- data/lib/asciinema_win/asciicast.rb +567 -537
- data/lib/asciinema_win/cli.rb +604 -604
- data/lib/asciinema_win/export.rb +1412 -1410
- data/lib/asciinema_win/output_organizer.rb +276 -276
- data/lib/asciinema_win/player.rb +348 -348
- data/lib/asciinema_win/recorder.rb +519 -480
- data/lib/asciinema_win/screen_buffer.rb +371 -375
- data/lib/asciinema_win/themes.rb +334 -334
- data/lib/asciinema_win/version.rb +6 -6
- data/lib/asciinema_win/win32_screen.rb +119 -0
- data/lib/asciinema_win.rb +156 -153
- data/lib/rich/_palettes.rb +148 -148
- data/lib/rich/box.rb +342 -342
- data/lib/rich/cells.rb +524 -512
- data/lib/rich/color.rb +631 -628
- data/lib/rich/color_triplet.rb +227 -220
- data/lib/rich/console.rb +604 -549
- data/lib/rich/control.rb +332 -332
- data/lib/rich/json.rb +260 -254
- data/lib/rich/layout.rb +314 -314
- data/lib/rich/markdown.rb +531 -509
- data/lib/rich/markup.rb +186 -175
- data/lib/rich/panel.rb +318 -311
- data/lib/rich/progress.rb +430 -430
- data/lib/rich/segment.rb +387 -387
- data/lib/rich/style.rb +464 -433
- data/lib/rich/syntax.rb +1220 -1145
- data/lib/rich/table.rb +547 -525
- data/lib/rich/terminal_theme.rb +126 -126
- data/lib/rich/text.rb +460 -433
- data/lib/rich/tree.rb +232 -238
- data/lib/rich/version.rb +5 -5
- data/lib/rich/win32_console.rb +620 -859
- data/lib/rich.rb +108 -108
- metadata +2 -4
data/README.md
CHANGED
|
@@ -1,655 +1,645 @@
|
|
|
1
|
-
# asciinema-win + Rich-Ruby
|
|
2
|
-
|
|
3
|
-
[](https://www.ruby-lang.org/)
|
|
4
|
-
[](https://github.com/tigel-agm/asciinema-windows)
|
|
5
|
-
[](LICENSE)
|
|
6
|
-
[](https://github.com/tigel-agm/asciinema-windows)
|
|
7
|
-
[](https://rubygems.org/gems/asciinema_win)
|
|
8
|
-
|
|
9
|
-
> **Native Windows Terminal Recorder and Rich Text Library in Pure Ruby**
|
|
10
|
-
|
|
11
|
-
Record terminal sessions, export to GIF/MP4/WebM video, and render beautiful formatted output
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Demo
|
|
16
|
-
|
|
17
|
-
**Rich-Ruby Terminal Recording exported to GIF:**
|
|
18
|
-
|
|
19
|
-

|
|
20
|
-
|
|
21
|
-
The GIF above shows Rich-Ruby components (Panel, Table, Tree, Syntax Highlighting, Progress Bar) rendered correctly with ANSI colors. Created with `examples/rich_ruby_demo.rb` and exported using the pure Ruby PPM frame renderer.
|
|
22
|
-
|
|
23
|
-
<details>
|
|
24
|
-
<summary><strong>Common rendering issues
|
|
25
|
-
|
|
26
|
-
**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
- [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
- Native
|
|
77
|
-
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
Export
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
# Export to
|
|
301
|
-
AsciinemaWin::Export.export("demo.cast", "demo.
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
```ruby
|
|
332
|
-
#
|
|
333
|
-
AsciinemaWin::Export.
|
|
334
|
-
|
|
335
|
-
#
|
|
336
|
-
AsciinemaWin::
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
#
|
|
346
|
-
AsciinemaWin::Export.
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
)
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
#
|
|
371
|
-
AsciinemaWin::
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
├──
|
|
399
|
-
│ └──
|
|
400
|
-
│
|
|
401
|
-
│
|
|
402
|
-
│
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
)
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
#
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
```
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
├──
|
|
594
|
-
├──
|
|
595
|
-
│ └──
|
|
596
|
-
|
|
597
|
-
│
|
|
598
|
-
│
|
|
599
|
-
│
|
|
600
|
-
│
|
|
601
|
-
│
|
|
602
|
-
│
|
|
603
|
-
│
|
|
604
|
-
│
|
|
605
|
-
│
|
|
606
|
-
|
|
607
|
-
│
|
|
608
|
-
│
|
|
609
|
-
│
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
MIT License - See [LICENSE](LICENSE)
|
|
648
|
-
|
|
649
|
-
---
|
|
650
|
-
|
|
651
|
-
# Credits
|
|
652
|
-
|
|
653
|
-
- Inspired by [asciinema](https://asciinema.org)
|
|
654
|
-
- Rich-Ruby inspired by Python's [Rich](https://github.com/Textualize/rich)
|
|
655
|
-
- Developed on Ruby 3.4.8 (MSVC) on Windows
|
|
1
|
+
# asciinema-win + Rich-Ruby
|
|
2
|
+
|
|
3
|
+
[](https://www.ruby-lang.org/)
|
|
4
|
+
[](https://github.com/tigel-agm/asciinema-windows)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://github.com/tigel-agm/asciinema-windows)
|
|
7
|
+
[](https://rubygems.org/gems/asciinema_win)
|
|
8
|
+
|
|
9
|
+
> **Native Windows Terminal Recorder and Rich Text Library in Pure Ruby**
|
|
10
|
+
|
|
11
|
+
Record terminal sessions, export to GIF/MP4/WebM video, and render beautiful formatted output, all with zero external dependencies (except FFmpeg for video export).
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Demo
|
|
16
|
+
|
|
17
|
+
**Rich-Ruby Terminal Recording exported to GIF:**
|
|
18
|
+
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
The GIF above shows Rich-Ruby components (Panel, Table, Tree, Syntax Highlighting, Progress Bar) rendered correctly with ANSI colors. Created with `examples/rich_ruby_demo.rb` and exported using the pure Ruby PPM frame renderer.
|
|
22
|
+
|
|
23
|
+
<details>
|
|
24
|
+
<summary><strong>Common rendering issues</strong></summary>
|
|
25
|
+
|
|
26
|
+
- **Literal markup tags** if you see `[blue]text[/]` instead of colored text,
|
|
27
|
+
the markup wasn't parsed. Render through `Rich::Console#print` or
|
|
28
|
+
`Rich::Text.from_markup`. All built-in components (Panel, Table, Tree, Syntax)
|
|
29
|
+
parse markup in their content automatically.
|
|
30
|
+
- **Empty progress bar / missing block glyphs** the embedded video-export font
|
|
31
|
+
includes block elements (█ ░ ▒ ▓) and box-drawing characters (since v0.2.0),
|
|
32
|
+
so bars in exported GIF/MP4/WebM render correctly.
|
|
33
|
+
|
|
34
|
+
</details>
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Table of Contents
|
|
39
|
+
|
|
40
|
+
- [asciinema-win](#asciinema-win)
|
|
41
|
+
- [Features](#asciinema-features)
|
|
42
|
+
- [Quick Start](#asciinema-quick-start)
|
|
43
|
+
- [CLI Reference](#cli-reference)
|
|
44
|
+
- [Ruby API](#ruby-api)
|
|
45
|
+
- [Export Formats](#export-formats)
|
|
46
|
+
- [Rich-Ruby](#rich-ruby)
|
|
47
|
+
- [Features](#rich-ruby-features)
|
|
48
|
+
- [Quick Start](#rich-ruby-quick-start)
|
|
49
|
+
- [Usage Guide](#usage-guide)
|
|
50
|
+
- [Requirements](#requirements)
|
|
51
|
+
- [Installation](#installation)
|
|
52
|
+
- [Documentation](#documentation)
|
|
53
|
+
- [License](#license)
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
# asciinema-win
|
|
58
|
+
|
|
59
|
+
Record and playback terminal sessions on native Windows with accurate timing and full color support. Export to video formats (GIF, MP4, WebM) using a pure Ruby frame renderer.
|
|
60
|
+
|
|
61
|
+
<a name="asciinema-features"></a>
|
|
62
|
+
## Features
|
|
63
|
+
|
|
64
|
+
**Core**
|
|
65
|
+
- Zero external dependencies (pure Ruby + Fiddle for Win32 API)
|
|
66
|
+
- Native Windows Console API access
|
|
67
|
+
- asciicast v2 format (compatible with asciinema.org)
|
|
68
|
+
|
|
69
|
+
**Recording**
|
|
70
|
+
- Screen buffer capture with colors and attributes
|
|
71
|
+
- Microsecond-accurate timing
|
|
72
|
+
- Idle time limiting
|
|
73
|
+
- Command recording mode
|
|
74
|
+
|
|
75
|
+
**Export**
|
|
76
|
+
- Native: HTML, SVG, Text, JSON (no dependencies)
|
|
77
|
+
- Video: GIF, MP4, WebM (requires FFmpeg)
|
|
78
|
+
- 9 terminal color themes
|
|
79
|
+
- Pure Ruby PPM frame renderer with embedded VGA font
|
|
80
|
+
|
|
81
|
+
**Playback**
|
|
82
|
+
- Accurate timing reproduction
|
|
83
|
+
- Adjustable speed (0.5x to 4x)
|
|
84
|
+
|
|
85
|
+
<a name="asciinema-quick-start"></a>
|
|
86
|
+
## Quick Start
|
|
87
|
+
|
|
88
|
+
> **Note:** Use the full Ruby path: `C:\RubyMSVC34\bin\ruby.exe`
|
|
89
|
+
|
|
90
|
+
### Record a Terminal Session
|
|
91
|
+
|
|
92
|
+
```powershell
|
|
93
|
+
C:\RubyMSVC34\bin\ruby.exe -Ilib exe\asciinema_win rec session.cast
|
|
94
|
+
# Press Ctrl+D to stop recording
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Record a Specific Command
|
|
98
|
+
|
|
99
|
+
```powershell
|
|
100
|
+
C:\RubyMSVC34\bin\ruby.exe -Ilib exe\asciinema_win rec -c "dir /s" output.cast
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Play Back a Recording
|
|
104
|
+
|
|
105
|
+
```powershell
|
|
106
|
+
C:\RubyMSVC34\bin\ruby.exe -Ilib exe\asciinema_win play session.cast
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Play at 2x Speed
|
|
110
|
+
|
|
111
|
+
```powershell
|
|
112
|
+
C:\RubyMSVC34\bin\ruby.exe -Ilib exe\asciinema_win play -s 2 session.cast
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Get Recording Info
|
|
116
|
+
|
|
117
|
+
```powershell
|
|
118
|
+
C:\RubyMSVC34\bin\ruby.exe -Ilib exe\asciinema_win info session.cast
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Export to HTML
|
|
122
|
+
|
|
123
|
+
```powershell
|
|
124
|
+
C:\RubyMSVC34\bin\ruby.exe -Ilib exe\asciinema_win export session.cast -o session.html
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
<a name="cli-reference"></a>
|
|
128
|
+
## CLI Reference
|
|
129
|
+
|
|
130
|
+
### `asciinema_win rec`
|
|
131
|
+
|
|
132
|
+
Record a terminal session.
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
Usage: asciinema_win rec [options] <filename>
|
|
136
|
+
|
|
137
|
+
Options:
|
|
138
|
+
-t, --title <title> Recording title
|
|
139
|
+
-c, --command <cmd> Record specific command
|
|
140
|
+
-i, --idle-time-limit <s> Max idle time (default: 2.0)
|
|
141
|
+
-y, --overwrite Overwrite existing file
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### `asciinema_win play`
|
|
145
|
+
|
|
146
|
+
Play back a recording.
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
Usage: asciinema_win play [options] <filename>
|
|
150
|
+
|
|
151
|
+
Options:
|
|
152
|
+
-s, --speed <factor> Playback speed (default: 1.0)
|
|
153
|
+
-i, --idle-time-limit <s> Max idle time between frames
|
|
154
|
+
-m, --pause-on-markers Pause at marker events
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### `asciinema_win export`
|
|
158
|
+
|
|
159
|
+
Export to other formats.
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
Usage: asciinema_win export [options] <filename>
|
|
163
|
+
|
|
164
|
+
Formats:
|
|
165
|
+
html Standalone HTML with embedded player
|
|
166
|
+
svg SVG image snapshot
|
|
167
|
+
txt Plain text (ANSI stripped)
|
|
168
|
+
json Normalized JSON
|
|
169
|
+
gif Animated GIF (requires FFmpeg)
|
|
170
|
+
mp4 MP4 video (requires FFmpeg)
|
|
171
|
+
webm WebM video (requires FFmpeg)
|
|
172
|
+
|
|
173
|
+
Options:
|
|
174
|
+
-f, --format <fmt> Output format
|
|
175
|
+
-o, --output <file> Output file path
|
|
176
|
+
-t, --title <title> Title for HTML export
|
|
177
|
+
--fps <n> Frames per second for video (default: 10)
|
|
178
|
+
--theme <name> Color theme for video export
|
|
179
|
+
--scale <n> Scale factor for video output
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### `asciinema_win cat`
|
|
183
|
+
|
|
184
|
+
Output to stdout without timing.
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
Usage: asciinema_win cat <filename>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### `asciinema_win info`
|
|
191
|
+
|
|
192
|
+
Show recording metadata.
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
Usage: asciinema_win info <filename>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
<a name="ruby-api"></a>
|
|
199
|
+
## Ruby API
|
|
200
|
+
|
|
201
|
+
### Recording
|
|
202
|
+
|
|
203
|
+
```ruby
|
|
204
|
+
require 'asciinema_win'
|
|
205
|
+
|
|
206
|
+
# Record an interactive session
|
|
207
|
+
AsciinemaWin.record("session.cast", title: "My Demo")
|
|
208
|
+
|
|
209
|
+
# Record a command
|
|
210
|
+
AsciinemaWin.record("command.cast", command: "dir /s")
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Playback
|
|
214
|
+
|
|
215
|
+
```ruby
|
|
216
|
+
require 'asciinema_win'
|
|
217
|
+
|
|
218
|
+
# Simple playback
|
|
219
|
+
AsciinemaWin.play("session.cast")
|
|
220
|
+
|
|
221
|
+
# With options
|
|
222
|
+
AsciinemaWin.play("session.cast", speed: 2.0)
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Export
|
|
226
|
+
|
|
227
|
+
```ruby
|
|
228
|
+
require 'asciinema_win'
|
|
229
|
+
|
|
230
|
+
# Export to HTML
|
|
231
|
+
AsciinemaWin::Export.export("session.cast", "output.html", format: :html)
|
|
232
|
+
|
|
233
|
+
# Export to SVG with theme
|
|
234
|
+
AsciinemaWin::Export.export("session.cast", "output.svg", format: :svg, theme: "dracula")
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Creating Recordings Programmatically
|
|
238
|
+
|
|
239
|
+
```ruby
|
|
240
|
+
require 'asciinema_win'
|
|
241
|
+
|
|
242
|
+
AsciinemaWin::Asciicast.create("demo.cast", width: 80, height: 24) do |writer|
|
|
243
|
+
writer.write_output(0.0, "Hello ")
|
|
244
|
+
writer.write_output(0.5, "\e[32mWorld!\e[0m\r\n")
|
|
245
|
+
writer.write_marker(1.0, "greeting done")
|
|
246
|
+
end
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
<a name="export-formats"></a>
|
|
250
|
+
## Export Formats
|
|
251
|
+
|
|
252
|
+
| Format | Extension | Dependencies | Description |
|
|
253
|
+
|--------|-----------|--------------|-------------|
|
|
254
|
+
| Cast | `.cast` | None | Asciicast v2 (with speed/trim options) |
|
|
255
|
+
| HTML | `.html` | None | Standalone page with asciinema-player |
|
|
256
|
+
| SVG | `.svg` | None | Colored terminal snapshot with themes |
|
|
257
|
+
| Text | `.txt` | None | Plain text with ANSI stripped |
|
|
258
|
+
| JSON | `.json` | None | Normalized event data |
|
|
259
|
+
| GIF | `.gif` | FFmpeg | Animated GIF (2-pass palette) |
|
|
260
|
+
| MP4 | `.mp4` | FFmpeg | H.264 video (yuv420p) |
|
|
261
|
+
| WebM | `.webm` | FFmpeg | VP9 video |
|
|
262
|
+
|
|
263
|
+
### Video Export (GIF/MP4/WebM)
|
|
264
|
+
|
|
265
|
+
Export recordings to video formats using FFmpeg. Uses a pure Ruby PPM frame
|
|
266
|
+
renderer with an embedded 8x16 VGA bitmap font, no external libraries needed
|
|
267
|
+
except FFmpeg itself.
|
|
268
|
+
|
|
269
|
+
**CLI Examples:**
|
|
270
|
+
|
|
271
|
+
```powershell
|
|
272
|
+
# Export to GIF (default 10 FPS)
|
|
273
|
+
C:\RubyMSVC34\bin\ruby.exe -Ilib exe\asciinema_win export demo.cast -o demo.gif
|
|
274
|
+
|
|
275
|
+
# Export to GIF with custom FPS and theme
|
|
276
|
+
C:\RubyMSVC34\bin\ruby.exe -Ilib exe\asciinema_win export demo.cast -o demo.gif --fps 15 --theme dracula
|
|
277
|
+
|
|
278
|
+
# Export to MP4
|
|
279
|
+
C:\RubyMSVC34\bin\ruby.exe -Ilib exe\asciinema_win export demo.cast -o demo.mp4 --fps 30
|
|
280
|
+
|
|
281
|
+
# Export to WebM
|
|
282
|
+
C:\RubyMSVC34\bin\ruby.exe -Ilib exe\asciinema_win export demo.cast -o demo.webm
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
**Ruby API:**
|
|
286
|
+
|
|
287
|
+
```ruby
|
|
288
|
+
require 'asciinema_win'
|
|
289
|
+
|
|
290
|
+
# Export to GIF with options
|
|
291
|
+
AsciinemaWin::Export.export("demo.cast", "demo.gif",
|
|
292
|
+
format: :gif,
|
|
293
|
+
fps: 15,
|
|
294
|
+
theme: "dracula"
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
# Export to MP4
|
|
298
|
+
AsciinemaWin::Export.export("demo.cast", "demo.mp4", format: :mp4, fps: 30)
|
|
299
|
+
|
|
300
|
+
# Export to WebM
|
|
301
|
+
AsciinemaWin::Export.export("demo.cast", "demo.webm", format: :webm)
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
> **Note:** GIF export uses 2-pass palette optimization (`palettegen` + `paletteuse`)
|
|
305
|
+
> for high-quality output with proper dithering.
|
|
306
|
+
|
|
307
|
+
### Terminal Themes
|
|
308
|
+
|
|
309
|
+
SVG exports support multiple color themes:
|
|
310
|
+
|
|
311
|
+
- `asciinema` (default)
|
|
312
|
+
- `dracula`
|
|
313
|
+
- `monokai`
|
|
314
|
+
- `solarized-dark`
|
|
315
|
+
- `solarized-light`
|
|
316
|
+
- `nord`
|
|
317
|
+
- `one-dark`
|
|
318
|
+
- `github-dark`
|
|
319
|
+
- `tokyo-night`
|
|
320
|
+
|
|
321
|
+
```ruby
|
|
322
|
+
# Export with Dracula theme
|
|
323
|
+
AsciinemaWin::Export.export("demo.cast", "demo.svg", format: :svg, theme: "dracula")
|
|
324
|
+
|
|
325
|
+
# List available themes
|
|
326
|
+
AsciinemaWin::Themes.names # => ["asciinema", "dracula", "monokai", ...]
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Speed Adjustment & Idle Compression
|
|
330
|
+
|
|
331
|
+
```ruby
|
|
332
|
+
# Speed up playback 2x
|
|
333
|
+
AsciinemaWin::Export.adjust_speed("input.cast", "output.cast", speed: 2.0)
|
|
334
|
+
|
|
335
|
+
# Compress idle time to max 0.5s
|
|
336
|
+
AsciinemaWin::Export.adjust_speed("input.cast", "output.cast", max_idle: 0.5)
|
|
337
|
+
|
|
338
|
+
# Both
|
|
339
|
+
AsciinemaWin::Export.adjust_speed("input.cast", "output.cast", speed: 1.5, max_idle: 0.5)
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### Recording Concatenation
|
|
343
|
+
|
|
344
|
+
```ruby
|
|
345
|
+
# Combine multiple recordings
|
|
346
|
+
AsciinemaWin::Export.concatenate(
|
|
347
|
+
["part1.cast", "part2.cast", "part3.cast"],
|
|
348
|
+
"combined.cast",
|
|
349
|
+
title: "Full Demo",
|
|
350
|
+
gap: 1.0 # seconds between recordings
|
|
351
|
+
)
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Thumbnail Generation
|
|
355
|
+
|
|
356
|
+
```ruby
|
|
357
|
+
# Generate thumbnail from last frame
|
|
358
|
+
AsciinemaWin::Export.thumbnail("demo.cast", "thumb.svg", frame: :last, theme: "dracula")
|
|
359
|
+
|
|
360
|
+
# Other frame options: :first, :middle, or specific time in seconds
|
|
361
|
+
AsciinemaWin::Export.thumbnail("demo.cast", "thumb.svg", frame: :middle)
|
|
362
|
+
AsciinemaWin::Export.thumbnail("demo.cast", "thumb.svg", frame: 5.0) # at 5s
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Organized Output
|
|
366
|
+
|
|
367
|
+
Use `OutputOrganizer` for structured output directories:
|
|
368
|
+
|
|
369
|
+
```ruby
|
|
370
|
+
# Create a session
|
|
371
|
+
session = AsciinemaWin::OutputOrganizer.create_session("my_demo")
|
|
372
|
+
|
|
373
|
+
# Get paths for various outputs
|
|
374
|
+
recording = session.recording_path("demo") # asciinema_output/recordings/my_demo_YYYYMMDD_HHMMSS/demo.cast
|
|
375
|
+
svg_path = session.export_path("demo", format: :svg) # asciinema_output/svg/my_demo_YYYYMMDD_HHMMSS/demo.svg
|
|
376
|
+
thumb = session.thumbnail_path("demo", frame: :last) # asciinema_output/thumbnails/svg/.../demo_last.svg
|
|
377
|
+
|
|
378
|
+
# View session summary
|
|
379
|
+
puts session.summary
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
Output directory structure:
|
|
383
|
+
```
|
|
384
|
+
asciinema_output/
|
|
385
|
+
├── recordings/
|
|
386
|
+
│ └── my_demo_20251224_120000/
|
|
387
|
+
│ └── demo.cast
|
|
388
|
+
├── svg/
|
|
389
|
+
│ └── my_demo_20251224_120000/
|
|
390
|
+
│ ├── demo_asciinema.svg
|
|
391
|
+
│ ├── demo_dracula.svg
|
|
392
|
+
│ └── ...
|
|
393
|
+
├── html/
|
|
394
|
+
│ └── my_demo_20251224_120000/
|
|
395
|
+
│ └── demo.html
|
|
396
|
+
├── json/
|
|
397
|
+
├── text/
|
|
398
|
+
├── thumbnails/
|
|
399
|
+
│ └── svg/
|
|
400
|
+
│ └── my_demo_20251224_120000/
|
|
401
|
+
│ ├── demo_first.svg
|
|
402
|
+
│ ├── demo_middle.svg
|
|
403
|
+
│ └── demo_last.svg
|
|
404
|
+
└── video/
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
# Rich-Ruby
|
|
410
|
+
|
|
411
|
+
A Pure Ruby library for rich text and beautiful formatting in the terminal.
|
|
412
|
+
|
|
413
|
+
<a name="rich-ruby-features"></a>
|
|
414
|
+
## Features
|
|
415
|
+
|
|
416
|
+
- **Colors**: 16-color, 256-color, and TrueColor (24-bit)
|
|
417
|
+
- **Styles**: Bold, italic, underline, strikethrough, blink, reverse
|
|
418
|
+
- **Markup**: `[bold red]text[/]` syntax for inline styling
|
|
419
|
+
- **Panels**: Bordered boxes with titles
|
|
420
|
+
- **Tables**: Data tables with alignment and styling
|
|
421
|
+
- **Trees**: Hierarchical tree views
|
|
422
|
+
- **Progress**: Animated progress bars and spinners
|
|
423
|
+
- **Syntax**: Code highlighting for Ruby, Python, JavaScript, SQL
|
|
424
|
+
- **Markdown**: Render Markdown in the terminal
|
|
425
|
+
- **Windows**: Full Windows Console API support
|
|
426
|
+
|
|
427
|
+
<a name="rich-ruby-quick-start"></a>
|
|
428
|
+
## Quick Start
|
|
429
|
+
|
|
430
|
+
```ruby
|
|
431
|
+
require 'rich'
|
|
432
|
+
|
|
433
|
+
# Simple styled output
|
|
434
|
+
Rich.print("[bold cyan]Hello[/] [yellow]World![/]")
|
|
435
|
+
|
|
436
|
+
# Create a console for more control
|
|
437
|
+
console = Rich::Console.new
|
|
438
|
+
console.print("Welcome!", style: "bold green")
|
|
439
|
+
|
|
440
|
+
# Display a panel
|
|
441
|
+
panel = Rich::Panel.new(
|
|
442
|
+
"This is important information.",
|
|
443
|
+
title: "Notice",
|
|
444
|
+
border_style: "cyan"
|
|
445
|
+
)
|
|
446
|
+
puts panel.render(max_width: 50)
|
|
447
|
+
|
|
448
|
+
# Display a table
|
|
449
|
+
table = Rich::Table.new(title: "Users")
|
|
450
|
+
table.add_column("Name", header_style: "bold")
|
|
451
|
+
table.add_column("Role")
|
|
452
|
+
table.add_row("Alice", "Admin")
|
|
453
|
+
table.add_row("Bob", "User")
|
|
454
|
+
puts table.render(max_width: 40)
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
<a name="usage-guide"></a>
|
|
458
|
+
## Usage Guide
|
|
459
|
+
|
|
460
|
+
### Colors and Styles
|
|
461
|
+
|
|
462
|
+
```ruby
|
|
463
|
+
# Named colors
|
|
464
|
+
Rich.print("[red]Error[/] [green]Success[/] [blue]Info[/]")
|
|
465
|
+
|
|
466
|
+
# 256 colors
|
|
467
|
+
Rich.print("[color(208)]Orange[/]")
|
|
468
|
+
|
|
469
|
+
# RGB colors
|
|
470
|
+
Rich.print("[rgb(255,100,50)]Custom[/]")
|
|
471
|
+
|
|
472
|
+
# Background colors
|
|
473
|
+
Rich.print("[white on blue]Highlighted[/]")
|
|
474
|
+
|
|
475
|
+
# Styles
|
|
476
|
+
Rich.print("[bold]Bold[/] [italic]Italic[/] [underline]Underline[/]")
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
### Panels
|
|
480
|
+
|
|
481
|
+
```ruby
|
|
482
|
+
panel = Rich::Panel.new(
|
|
483
|
+
"Content here",
|
|
484
|
+
title: "Title",
|
|
485
|
+
subtitle: "Subtitle",
|
|
486
|
+
border_style: "green",
|
|
487
|
+
padding: [1, 2]
|
|
488
|
+
)
|
|
489
|
+
puts panel.render(max_width: 60)
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
### Tables
|
|
493
|
+
|
|
494
|
+
```ruby
|
|
495
|
+
table = Rich::Table.new(title: "Data", show_header: true)
|
|
496
|
+
table.add_column("ID", justify: :right)
|
|
497
|
+
table.add_column("Name", justify: :left)
|
|
498
|
+
table.add_column("Value", justify: :center)
|
|
499
|
+
table.add_row("1", "Item A", "100")
|
|
500
|
+
table.add_row("2", "Item B", "200")
|
|
501
|
+
puts table.render
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
### Trees
|
|
505
|
+
|
|
506
|
+
```ruby
|
|
507
|
+
tree = Rich::Tree.new("Root")
|
|
508
|
+
child1 = tree.add("Child 1")
|
|
509
|
+
child1.add("Grandchild 1")
|
|
510
|
+
child1.add("Grandchild 2")
|
|
511
|
+
tree.add("Child 2")
|
|
512
|
+
puts tree.render
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
### Progress Bars
|
|
516
|
+
|
|
517
|
+
```ruby
|
|
518
|
+
progress = Rich::Progress.new("Processing", total: 100)
|
|
519
|
+
100.times do |i|
|
|
520
|
+
progress.update(i + 1)
|
|
521
|
+
sleep(0.05)
|
|
522
|
+
end
|
|
523
|
+
progress.complete!
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
### Syntax Highlighting
|
|
527
|
+
|
|
528
|
+
```ruby
|
|
529
|
+
code = 'def hello; puts "Hello"; end'
|
|
530
|
+
syntax = Rich::Syntax.new(code, "ruby", theme: "monokai")
|
|
531
|
+
puts syntax.render
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
---
|
|
535
|
+
|
|
536
|
+
# Requirements
|
|
537
|
+
|
|
538
|
+
- **Ruby**: 3.0+ (tested on 3.4.8 MSVC)
|
|
539
|
+
- **Platform**: Windows 10/11 (asciinema-win requires Windows)
|
|
540
|
+
- **Dependencies**: None (zero external gems)
|
|
541
|
+
|
|
542
|
+
### Development Environment
|
|
543
|
+
|
|
544
|
+
```
|
|
545
|
+
C:\RubyMSVC34 # Ruby installation
|
|
546
|
+
C:\Users\#yourusername\vcpkg # Dependencies
|
|
547
|
+
C:\Program Files\Microsoft Visual Studio\18\Community # VS 2026
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
---
|
|
551
|
+
|
|
552
|
+
# Installation
|
|
553
|
+
|
|
554
|
+
### From Source
|
|
555
|
+
|
|
556
|
+
```powershell
|
|
557
|
+
git clone https://github.com/tigel-agm/asciinema-win.git
|
|
558
|
+
cd asciinema-win
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
### Build and Install Gem
|
|
562
|
+
|
|
563
|
+
```powershell
|
|
564
|
+
C:\RubyMSVC34\bin\gem.cmd build asciinema_win.gemspec
|
|
565
|
+
C:\RubyMSVC34\bin\gem.cmd install asciinema_win-0.2.0.gem
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
---
|
|
569
|
+
|
|
570
|
+
# Documentation
|
|
571
|
+
|
|
572
|
+
- [docs/how-to-use.md](docs/how-to-use.md) - Rich-Ruby usage guide
|
|
573
|
+
- [docs/troubleshooting.md](docs/troubleshooting.md) - Solutions for common issues
|
|
574
|
+
- [docs/windows-notes.md](docs/windows-notes.md) - Windows-specific details
|
|
575
|
+
- [docs/cheat-sheet.md](docs/cheat-sheet.md) - Quick reference
|
|
576
|
+
|
|
577
|
+
---
|
|
578
|
+
|
|
579
|
+
# Project Structure
|
|
580
|
+
|
|
581
|
+
```
|
|
582
|
+
asciinema-win/
|
|
583
|
+
├── asciinema_win.gemspec # Gem specification
|
|
584
|
+
├── exe/
|
|
585
|
+
│ └── asciinema_win # CLI executable
|
|
586
|
+
├── lib/
|
|
587
|
+
│ ├── asciinema_win.rb # asciinema-win entry point
|
|
588
|
+
│ ├── asciinema_win/
|
|
589
|
+
│ │ ├── version.rb
|
|
590
|
+
│ │ ├── screen_buffer.rb # Screen capture
|
|
591
|
+
│ │ ├── asciicast.rb # File format
|
|
592
|
+
│ │ ├── recorder.rb # Recording engine
|
|
593
|
+
│ │ ├── player.rb # Playback engine
|
|
594
|
+
│ │ ├── export.rb # Export formats
|
|
595
|
+
│ │ └── cli.rb # CLI
|
|
596
|
+
│ └── rich/ # Rich-Ruby library
|
|
597
|
+
│ ├── console.rb
|
|
598
|
+
│ ├── text.rb
|
|
599
|
+
│ ├── panel.rb
|
|
600
|
+
│ ├── table.rb
|
|
601
|
+
│ ├── tree.rb
|
|
602
|
+
│ ├── progress.rb
|
|
603
|
+
│ ├── syntax.rb
|
|
604
|
+
│ ├── markdown.rb
|
|
605
|
+
│ └── win32_console.rb # Windows API
|
|
606
|
+
├── examples/
|
|
607
|
+
│ ├── test_capture.rb
|
|
608
|
+
│ ├── rich_ruby_recording_demo.rb
|
|
609
|
+
│ └── create_sample_recording.rb
|
|
610
|
+
└── docs/
|
|
611
|
+
└── ...
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
---
|
|
615
|
+
|
|
616
|
+
# File Format
|
|
617
|
+
|
|
618
|
+
asciinema-win uses **asciicast v2** format (newline-delimited JSON):
|
|
619
|
+
|
|
620
|
+
```json
|
|
621
|
+
{"version":2,"width":80,"height":24,"timestamp":1735052000,"title":"Demo"}
|
|
622
|
+
[0.0,"o","Hello "]
|
|
623
|
+
[0.5,"o","\u001b[32mWorld!\u001b[0m\r\n"]
|
|
624
|
+
[1.0,"m","marker label"]
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
Event types:
|
|
628
|
+
- `"o"` - Output (terminal data)
|
|
629
|
+
- `"i"` - Input (keyboard)
|
|
630
|
+
- `"r"` - Resize (`"80x24"`)
|
|
631
|
+
- `"m"` - Marker (bookmark)
|
|
632
|
+
|
|
633
|
+
---
|
|
634
|
+
|
|
635
|
+
# License
|
|
636
|
+
|
|
637
|
+
MIT License - See [LICENSE](LICENSE)
|
|
638
|
+
|
|
639
|
+
---
|
|
640
|
+
|
|
641
|
+
# Credits
|
|
642
|
+
|
|
643
|
+
- Inspired by [asciinema](https://asciinema.org)
|
|
644
|
+
- Rich-Ruby inspired by Python's [Rich](https://github.com/Textualize/rich)
|
|
645
|
+
- Developed on Ruby 3.4.8 (MSVC) on Windows
|