Skip to main content

Examples

Five example scripts demonstrating progressively more advanced features. These are the built-in examples shipped with QuikGIF (also available via the MCP resource quikgif://examples/{name}).


hello.qgif

Minimal single-window recording demo. Opens a Terminal, types a command, and renders a GIF.

# hello.qgif — minimal single-window recording demo
# Usage: quikgif script hello.qgif

set fps 30
set output "hello.gif"
set max-width 800

# Open a fresh Terminal window
open "Terminal"
wait 0.5
capture-window app "Terminal" as $term

# Resize for consistent dimensions and clear for a clean slate
resize 800 400
wait 0.3
clear
wait 0.3

# Record for 3 seconds while typing
record $term duration 3.0 continue
type "echo Hello from QuikGIF!" enter
wait 1.0
remain

render

What this demonstrates:

  • Basic script structure: settings, window setup, record, render
  • continue keyword for non-blocking recording
  • remain to wait for the recording duration to finish
  • clear to start with a clean terminal

git-workflow.qgif

Multi-step git demo with command capture and spotlight effects.

# git-workflow.qgif — Multi-step git demo
# Demonstrates: typing, command capture, spotlight, multi-step recording

set fps 30
set output "git-workflow.gif"
set max-width 800

open "Terminal"
wait 1.0
capture-window app "Terminal" as $term

# Step 1: Show the git log
record $term duration 8.0 continue
type "git log --oneline -5" enter
wait 2.0

# Capture the output for spotlighting
run "git log --oneline -5" as $log

# Highlight the most recent commit
spotlight stdout $log[0] duration 2.0
wait 2.5
clear-fx

# Step 2: Show the diff
type "git diff --stat" enter
wait 2.0
remain

render

What this demonstrates:

  • run command to capture shell output into a variable
  • spotlight stdout $var[N] to highlight specific output lines
  • clear-fx to remove spotlight effects
  • Multi-step workflow within a single recording segment

multi-window.qgif

Recording across multiple windows with crossfade transitions and mouse interaction.

# multi-window.qgif — Multi-window recording with transitions
# Demonstrates: multiple windows, crossfade transitions, mouse interaction

set fps 30
set output "multi-window.gif"
set max-width 800
set transition 0.5

# Record Terminal
open "Terminal"
wait 1.0
capture-window app "Terminal" as $term

record $term duration 4.0 continue
type "ls -la" enter
wait 2.0
remain

# Switch to Finder
open "Finder"
wait 1.0
capture-window app "Finder" as $finder

record $finder duration 5.0 continue
cursor 200 300
wait 0.5
move 400 250 duration 0.5
click
scroll down 3
wait 1.0
remain

render

What this demonstrates:

  • Multiple recording segments from different applications
  • set transition 0.5 for crossfade between segments
  • Mouse interaction: cursor (instant move), move (smooth animation), click, scroll
  • Each segment records independently, then all are stitched together by render

spotlight-demo.qgif

Visual effects showcase demonstrating spotlight, spotlight-shift, and region highlighting.

# spotlight-demo.qgif — Visual effects showcase
# Demonstrates: spotlight regions, spotlight-shift animation, clear-fx

set fps 30
set output "spotlight-demo.gif"
set max-width 800

open "Terminal"
wait 1.0
capture-window app "Terminal" as $term

record $term duration 10.0 continue

# Run a command and capture output
type "cat /etc/hosts" enter
wait 2.0
run "cat /etc/hosts" as $hosts

# Spotlight the first line
spotlight stdout $hosts[0] duration 2.0
wait 2.5

# Shift spotlight to third line
spotlight-shift stdout $hosts[2] duration 1.5
wait 2.0

# Spotlight a specific region
clear-fx
wait 0.5
spotlight region 50 80 400 60 duration 2.0
wait 2.5
clear-fx

remain

render

What this demonstrates:

  • spotlight stdout $var[N] to highlight output lines
  • spotlight-shift to animate the spotlight to a new target
  • spotlight region to highlight an arbitrary screen area
  • clear-fx to remove effects between spotlight sequences

polish-demo.qgif

Timing presets, auto-pacing, keystroke badges, and intro/outro title cards.

# polish-demo.qgif — demonstrates timing + visual polish features
#
# Features used: timing presets, auto-pacing, keystroke badges, intro/outro

set pace demo
set keystroke-badges true
set intro-bg #0d1117
set intro-fg #58a6ff

intro "Git Workflow Demo" subtitle "Using QuikGIF scripting" duration 2

open "Terminal"
capture-window app "Terminal" as $term
resize 800 500

record $term duration 8 continue
type "git status" enter
type "git add ." enter
key cmd+s
wait 1
remain

outro "Created with QuikGIF" duration 1.5
render

What this demonstrates:

  • set pace demo applies the demo timing preset (30fps, 0.04s typing, auto-pacing enabled)
  • set keystroke-badges true shows floating key combo badges (e.g., when key cmd+s fires)
  • Custom title card colors with intro-bg and intro-fg
  • intro and outro title cards with subtitle text
  • The pace preset enables auto-pace, which inserts brief pauses after each command during recording
tip

Start with a pace preset and then override individual settings as needed. The demo preset is a good default for most use cases.