Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/screenshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Screenshots

on:
push:
branches: [main]
paths:
- '*.go'
- 'examples/**/*.go'
- 'examples/**/*.tape'
pull_request:
paths:
- '*.go'
- 'examples/**/*.go'
- 'examples/**/*.tape'
workflow_dispatch:

permissions:
contents: write

jobs:
screenshots:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Install vhs dependencies
run: sudo apt-get update -q && sudo apt-get install -y ffmpeg ttyd

- name: Install vhs
run: go install github.com/charmbracelet/vhs@latest

- name: Pre-build examples
run: go build ./examples/...

- name: Generate screenshots
run: find examples -name '*.tape' -print0 | sort -z | xargs -0 -I{} vhs {}

- uses: actions/upload-artifact@v4
if: always()
with:
name: screenshots
path: 'examples/**/*.gif'

- uses: stefanzweifel/git-auto-commit-action@v5
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
commit_message: 'chore: update example screenshots [skip ci]'
file_pattern: 'examples/**/*.gif'
15 changes: 15 additions & 0 deletions examples/basic/basic.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Output examples/basic/screenshot.gif

Set Shell "bash"
Set FontSize 14
Set Width 1200
Set Height 200
Set Theme "Dracula"
Set TypingSpeed 10ms

Env PS1 "$ "

Sleep 500ms
Type "go run ./examples/basic/"
Enter
Sleep 10s
Binary file added examples/basic/screenshot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions examples/colorize/colorize.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Output examples/colorize/screenshot.gif

Set Shell "bash"
Set FontSize 14
Set Width 1200
Set Height 450
Set Theme "Dracula"
Set TypingSpeed 10ms

Env PS1 "$ "

Sleep 500ms
Type "go run ./examples/colorize/"
Enter
Sleep 10s
Binary file added examples/colorize/screenshot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions examples/colors/colors.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Output examples/colors/screenshot.gif

Set Shell "bash"
Set FontSize 14
Set Width 1200
Set Height 1000
Set Theme "Dracula"
Set TypingSpeed 10ms

Env PS1 "$ "

Sleep 500ms
Type "go run ./examples/colors/"
Enter
Sleep 15s
Binary file added examples/colors/screenshot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions examples/custom-theme/custom-theme.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Output examples/custom-theme/screenshot.gif

Set Shell "bash"
Set FontSize 14
Set Width 1200
Set Height 800
Set Theme "Dracula"
Set TypingSpeed 10ms

Env PS1 "$ "

Sleep 500ms
Type "go run ./examples/custom-theme/"
Enter
Sleep 15s
Binary file added examples/custom-theme/screenshot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions examples/env-theme/env-theme.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Output examples/env-theme/screenshot.gif

Set Shell "bash"
Set FontSize 14
Set Width 1200
Set Height 500
Set Theme "Dracula"
Set TypingSpeed 10ms

Env PS1 "$ "

Sleep 500ms
Type "CLI_THEME=dracula go run ./examples/env-theme/"
Enter
Sleep 15s
Binary file added examples/env-theme/screenshot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions examples/fatal/fatal.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Output examples/fatal/screenshot.gif

Set Shell "bash"
Set FontSize 14
Set Width 1200
Set Height 250
Set Theme "Dracula"
Set TypingSpeed 10ms

Env PS1 "$ "

Sleep 500ms
Type "go run ./examples/fatal/"
Enter
Sleep 10s
Binary file added examples/fatal/screenshot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions examples/formatting/formatting.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Output examples/formatting/screenshot.gif

Set Shell "bash"
Set FontSize 14
Set Width 1200
Set Height 650
Set Theme "Dracula"
Set TypingSpeed 10ms

Env PS1 "$ "

Sleep 500ms
Type "go run ./examples/formatting/"
Enter
Sleep 15s
Binary file added examples/formatting/screenshot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions examples/instance/instance.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Output examples/instance/screenshot.gif

Set Shell "bash"
Set FontSize 14
Set Width 1200
Set Height 900
Set Theme "Dracula"
Set TypingSpeed 10ms

Env PS1 "$ "

Sleep 500ms
Type "go run ./examples/instance/"
Enter
Sleep 15s
Binary file added examples/instance/screenshot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions examples/levels/levels.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Output examples/levels/screenshot.gif

Set Shell "bash"
Set FontSize 14
Set Width 1200
Set Height 800
Set Theme "Dracula"
Set TypingSpeed 10ms

Env PS1 "$ "

Sleep 500ms
Type "go run ./examples/levels/"
Enter
Sleep 15s
Binary file added examples/levels/screenshot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions examples/nocolor/nocolor.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Output examples/nocolor/screenshot.gif

Set Shell "bash"
Set FontSize 14
Set Width 1200
Set Height 800
Set Theme "Dracula"
Set TypingSpeed 10ms

Env PS1 "$ "

Sleep 500ms
Type "go run ./examples/nocolor/"
Enter
Sleep 15s
Binary file added examples/nocolor/screenshot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions examples/prefix/prefix.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Output examples/prefix/screenshot.gif

Set Shell "bash"
Set FontSize 14
Set Width 1200
Set Height 800
Set Theme "Dracula"
Set TypingSpeed 10ms

Env PS1 "$ "

Sleep 500ms
Type "go run ./examples/prefix/"
Enter
Sleep 15s
Binary file added examples/prefix/screenshot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions examples/real-world/real-world.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Output examples/real-world/screenshot.gif

Set Shell "bash"
Set FontSize 14
Set Width 1200
Set Height 700
Set Theme "Dracula"
Set TypingSpeed 10ms

Env PS1 "$ "

Sleep 500ms
Type "go run ./examples/real-world/"
Enter
Sleep 25s
Binary file added examples/real-world/screenshot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/theme-selector/screenshot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions examples/theme-selector/theme-selector.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Output examples/theme-selector/screenshot.gif

Set Shell "bash"
Set FontSize 14
Set Width 1200
Set Height 950
Set Theme "Dracula"
Set TypingSpeed 10ms

Env PS1 "$ "

Sleep 500ms
Type "go run ./examples/theme-selector/ --list"
Enter
Sleep 15s
Binary file added examples/themes/screenshot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions examples/themes/themes.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Output examples/themes/screenshot.gif

Set Shell "bash"
Set FontSize 14
Set Width 1200
Set Height 5000
Set Theme "Dracula"
Set TypingSpeed 10ms

Env PS1 "$ "

Sleep 500ms
Type "go run ./examples/themes/"
Enter
Sleep 15s
4 changes: 4 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,9 @@ fmt:
vet:
go vet ./...

# generate screenshots for all examples (requires vhs: https://github.com/charmbracelet/vhs)
screenshots:
find examples -name '*.tape' -print0 | sort -z | xargs -0 -I{} vhs {}

# run all checks (fmt, vet, lint, test)
check: fmt vet lint test
1 change: 1 addition & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[tools]
go = "1.26.0"
golangci-lint = "2.8.0"
"ubi:charmbracelet/vhs" = "latest"
Loading