@@ -21,35 +21,32 @@ Inspired by [VHS](https://github.com/charmbracelet/vhs) by Charm Bracelet. VcrSh
2121
2222## Installation
2323
24+ Install VcrSharp as a global .NET tool:
25+
26+ ``` bash
27+ dotnet tool install --global vcr --version 0.0.4 # or latest version
28+ ```
29+
2430### Prerequisites
2531
26- You'll need these installed and in your PATH:
32+ You'll also need these installed and in your PATH:
2733
28- - [ .NET 9 SDK] ( https://dotnet.microsoft.com/download/dotnet/9.0 )
2934- [ ttyd] ( https://github.com/tsl0922/ttyd ) (>= 1.7.2)
3035- [ FFmpeg] ( https://ffmpeg.org/ )
3136
3237Playwright browsers install automatically on first run.
3338
34- ### Building from Source
35-
36- ``` bash
37- git clone https://github.com/phil-scott-78/vcr.git
38- cd vcr
39- dotnet build VcrSharp.sln
40- ```
41-
42- ### Running
39+ ### Usage
4340
4441``` bash
4542# Record a tape file
46- dotnet run --project src/VcrSharp.Cli -- demo.tape
43+ vcr demo.tape
4744
4845# Validate a tape file without recording
49- dotnet run --project src/VcrSharp.Cli -- validate demo.tape
46+ vcr validate demo.tape
5047
5148# List available themes
52- dotnet run --project src/VcrSharp.Cli -- themes
49+ vcr themes
5350```
5451
5552## Quick Start
@@ -79,7 +76,7 @@ Sleep 2s
7976Then record it:
8077
8178``` bash
82- dotnet run --project src/VcrSharp.Cli -- demo.tape
79+ vcr demo.tape
8380```
8481
8582This will generate both ` demo.gif ` and ` demo.mp4 ` showing your terminal session.
@@ -99,31 +96,31 @@ Override any setting using `--set Key=Value`:
9996
10097``` bash
10198# Try different themes
102- dotnet run --project src/VcrSharp.Cli -- demo.tape --set Theme=Dracula
103- dotnet run --project src/VcrSharp.Cli -- demo.tape --set Theme=Nord
99+ vcr demo.tape --set Theme=Dracula
100+ vcr demo.tape --set Theme=Nord
104101
105102# Generate high-resolution output
106- dotnet run --project src/VcrSharp.Cli -- demo.tape --set Width=1920 --set Height=1080
103+ vcr demo.tape --set Width=1920 --set Height=1080
107104
108105# Adjust video settings
109- dotnet run --project src/VcrSharp.Cli -- demo.tape --set Framerate=60 --set PlaybackSpeed=1.5
106+ vcr demo.tape --set Framerate=60 --set PlaybackSpeed=1.5
110107
111108# Change terminal appearance
112- dotnet run --project src/VcrSharp.Cli -- demo.tape --set FontSize=28 --set Padding=100 --set BorderRadius=10
109+ vcr demo.tape --set FontSize=28 --set Padding=100 --set BorderRadius=10
113110```
114111
115- CLI ` --set ` parameters ** override** matching SET commands in the tape file. All 31 settings can be overridden (see [ Configuration Reference] ( #configuration-reference ) ).
112+ CLI ` --set ` parameters ** override** matching SET commands in the tape file. All 29 settings can be overridden (see [ Configuration Reference] ( #configuration-reference ) ).
116113
117114### Add Output Formats with ` --output `
118115
119116Add additional output files using ` -o ` or ` --output ` :
120117
121118``` bash
122119# Add MP4 output to a tape that only specifies GIF
123- dotnet run --project src/VcrSharp.Cli -- demo.tape --output demo.mp4
120+ vcr demo.tape --output demo.mp4
124121
125122# Generate multiple formats
126- dotnet run --project src/VcrSharp.Cli -- demo.tape -o video.mp4 -o video.webm -o video.gif
123+ vcr demo.tape -o video.mp4 -o video.webm -o video.gif
127124```
128125
129126CLI ` --output ` parameters ** append** to Output commands in the tape file. If your tape specifies ` Output demo.gif ` and you add ` --output demo.mp4 ` , both files will be generated.
@@ -133,18 +130,18 @@ CLI `--output` parameters **append** to Output commands in the tape file. If you
133130
134131``` bash
135132# Create variants for light and dark mode
136- dotnet run --project src/VcrSharp.Cli -- demo.tape --set Theme=Dracula -o dark-demo.gif
137- dotnet run --project src/VcrSharp.Cli -- demo.tape --set Theme=" Solarized Light" -o light-demo.gif
133+ vcr demo.tape --set Theme=Dracula -o dark-demo.gif
134+ vcr demo.tape --set Theme=" Solarized Light" -o light-demo.gif
138135```
139136
140137** Reuse tape files for different screen sizes:**
141138
142139``` bash
143140# Mobile-sized demo
144- dotnet run --project src/VcrSharp.Cli -- tutorial.tape --set FontSize=12 -o mobile.gif
141+ vcr tutorial.tape --set FontSize=12 -o mobile.gif
145142
146143# Desktop-sized demo
147- dotnet run --project src/VcrSharp.Cli -- tutorial.tape --set FontSize=22 -o desktop.gif
144+ vcr tutorial.tape --set FontSize=22 -o desktop.gif
148145```
149146
150147## Examples
@@ -233,6 +230,7 @@ Output input.webm
233230Set FontSize 12
234231Set Cols 80
235232Set Rows 30
233+ Set EndBuffer 2s
236234
237235Set TypingSpeed 250ms
238236
@@ -247,7 +245,6 @@ Down 5
247245Sleep 500ms
248246Screenshot "file-picker.gif"
249247Enter
250- Sleep 2000ms
251248```
252249
253250### Example 4: PowerShell Scripting (` samples/numbers.tape ` )
@@ -285,9 +282,10 @@ Set LineHeight 1.0 # Line height multiplier (default: 1.0)
285282Set Framerate 50 # Frames per second, 1-120 (default: 50)
286283Set PlaybackSpeed 1.0 # Playback speed multiplier (default: 1.0)
287284Set LoopOffset 0 # GIF loop offset percentage (default: 0)
285+ Set MaxColors 256 # Max colors for GIF palette, 1-256 (default: 256)
288286
289287Set Theme "Dracula" # Color theme (default: "Default")
290- Set Padding 60 # Padding around terminal in pixels (default: 60 )
288+ Set Padding 60 # Padding around terminal in pixels (default: 0 )
291289Set Margin 0 # Margin around recording in pixels (default: 0)
292290Set MarginFill "#000000" # Margin fill color or image path (default: null)
293291Set WindowBarSize 30 # Window bar height in pixels (default: 30)
@@ -296,12 +294,14 @@ Set CursorBlink true # Enable cursor blinking (default: true)
296294Set TransparentBackground true # Enable transparent terminal background (default: false)
297295
298296Set Shell "pwsh" # Shell to use (default: platform-specific)
299- Set TypingSpeed 150ms # Default typing speed (default: 150ms)
297+ Set WorkingDirectory "C:\\path" # Working directory for terminal session
298+ Set TypingSpeed 60ms # Default typing speed (default: 60ms)
300299Set WaitTimeout 15s # Max wait time for patterns (default: 15s)
300+ Set WaitPattern /\$/ # Regex pattern to detect shell prompt
301301Set InactivityTimeout 5s # Inactivity timeout for Exec (default: 5s)
302302Set StartWaitTimeout 10s # Wait for first terminal activity (default: 10s)
303303Set StartBuffer 500ms # Blank time before first activity (default: 500ms)
304- Set EndBuffer 1s # Time after last activity (default: 1s )
304+ Set EndBuffer 100ms # Time after last activity (default: 100ms )
305305```
306306
307307### Output Commands
@@ -519,7 +519,7 @@ VcrSharp includes 10 built-in themes:
519519
520520View all themes with:
521521``` bash
522- dotnet run --project src/VcrSharp.Cli -- themes
522+ vcr themes
523523```
524524
525525Use a theme in your tape file:
@@ -549,13 +549,14 @@ Set Theme "Tokyo Night"
549549| ` Framerate ` | 50 | Frames per second (1-120) |
550550| ` PlaybackSpeed ` | 1.0 | Playback speed multiplier |
551551| ` LoopOffset ` | 0 | GIF loop offset percentage |
552+ | ` MaxColors ` | 256 | Max colors for GIF palette (1-256) |
552553
553554### Styling
554555
555556| Setting | Default | Description |
556557| ---------| ---------| -------------|
557558| ` Theme ` | "Default" | Color theme name |
558- | ` Padding ` | 60 | Padding around terminal (px) |
559+ | ` Padding ` | 0 | Padding around terminal (px) |
559560| ` Margin ` | 0 | Margin around recording (px) |
560561| ` MarginFill ` | null | Margin fill color or image |
561562| ` WindowBarSize ` | 30 | Window bar height (px) |
@@ -568,12 +569,14 @@ Set Theme "Tokyo Night"
568569| Setting | Default | Description |
569570| ---------| ---------| -------------|
570571| ` Shell ` | Platform-specific | Shell to use (pwsh, cmd, bash) |
571- | ` TypingSpeed ` | 150ms | Default character typing delay |
572+ | ` WorkingDirectory ` | - | Working directory for terminal session |
573+ | ` TypingSpeed ` | 60ms | Default character typing delay |
572574| ` WaitTimeout ` | 15s | Max wait time for patterns |
575+ | ` WaitPattern ` | - | Regex pattern to detect shell prompt |
573576| ` InactivityTimeout ` | 5s | Inactivity timeout for Exec |
574577| ` StartWaitTimeout ` | 10s | Wait for first activity |
575578| ` StartBuffer ` | 500ms | Blank time before recording |
576- | ` EndBuffer ` | 1s | Time after last activity |
579+ | ` EndBuffer ` | 100ms | Time after last activity |
577580
578581## Differences from VHS
579582
@@ -598,15 +601,14 @@ If you need those features, use VHS. If you want scriptable, version-controlled
598601
599602### Why VCR and not VHS?
600603
601- I kept typing VCR when using VHS, no one called is VHS back in the day.
604+ I kept typing VCR when using VHS, no one called it VHS back in the day.
602605
603606## CLI Commands
604607
605608### Record (Default Command)
606609
607610``` bash
608611vcr < tape-file> [OPTIONS]
609- dotnet run --project src/VcrSharp.Cli -- demo.tape
610612```
611613
612614Records the tape file and generates output videos/GIFs.
@@ -621,25 +623,24 @@ Records the tape file and generates output videos/GIFs.
621623
622624``` bash
623625# Override theme and dimensions
624- dotnet run --project src/VcrSharp.Cli -- demo.tape --set Theme=Dracula --set Width=1920 --set Height=1080
626+ vcr demo.tape --set Theme=Dracula --set Width=1920 --set Height=1080
625627
626628# Add multiple output formats
627- dotnet run --project src/VcrSharp.Cli -- demo.tape -o demo.mp4 -o demo.webm
629+ vcr demo.tape -o demo.mp4 -o demo.webm
628630
629631# Combine settings and outputs
630- dotnet run --project src/VcrSharp.Cli -- demo.tape \
632+ vcr demo.tape \
631633 --set Theme=Nord \
632634 --output hires.gif \
633635 --output hires.mp4
634636```
635637
636- All 31 settings can be overridden via ` --set ` . See the [ Configuration Reference] ( #configuration-reference ) for available settings.
638+ All 29 settings can be overridden via ` --set ` . See the [ Configuration Reference] ( #configuration-reference ) for available settings.
637639
638640### Validate
639641
640642``` bash
641643vcr validate < tape-file>
642- dotnet run --project src/VcrSharp.Cli -- validate demo.tape
643644```
644645
645646Check your tape file syntax without actually recording anything. Shows parse errors, command counts, and configuration.
@@ -648,7 +649,6 @@ Check your tape file syntax without actually recording anything. Shows parse err
648649
649650``` bash
650651vcr themes
651- dotnet run --project src/VcrSharp.Cli -- themes
652652```
653653
654654Lists all available themes with color previews.
@@ -657,6 +657,29 @@ Lists all available themes with color previews.
657657
658658Check out the ` samples/ ` directory for examples of ` .tape ` files in action.
659659
660+ ## Building from Source
661+
662+ For contributors and developers who want to build VcrSharp from source:
663+
664+ ``` bash
665+ git clone https://github.com/phil-scott-78/vcr.git
666+ cd vcr
667+ dotnet build VcrSharp.sln
668+ ```
669+
670+ Run from source:
671+
672+ ``` bash
673+ # Record a tape file
674+ dotnet run --project src/VcrSharp.Cli -- demo.tape
675+
676+ # Validate a tape file
677+ dotnet run --project src/VcrSharp.Cli -- validate demo.tape
678+
679+ # List themes
680+ dotnet run --project src/VcrSharp.Cli -- themes
681+ ```
682+
660683## Project Structure
661684
662685```
0 commit comments