11#! /bin/bash
2- # Simulates Claude Code terminal output for the demo GIF.
2+ # Simulates Codex CLI terminal output for the demo GIF.
3+ # Format matches real Codex CLI v0.117.0 interactive mode output.
34# Runs in the LEFT tmux pane. Makes real file changes so diffpane picks them up.
45
56DEMO_DIR=" /tmp/diffpane-demo"
67
7- # ANSI colors
8+ # ANSI colors matching Codex CLI palette
89BOLD=' \033[1m'
910DIM=' \033[2m'
10- GREEN=' \033[32m'
11- PURPLE=' \033[35m'
1211RESET=' \033[0m'
1312
13+ # Codex uses a dimmed bullet for tool/action markers
14+ BULLET=" ${DIM} \xe2\x80\xa2${RESET} " # •
15+ PROMPT=" ${BOLD} \xe2\x80\xba${RESET} " # ›
16+ CORNER=" ${DIM} \xe2\x94\x94${RESET} " # └
17+
1418# Simulate typing (character by character)
1519type_out () {
1620 local text=" $1 "
1721 for (( i = 0 ; i < ${# text} ; i++ )) ; do
1822 printf ' %s' " ${text: $i : 1} "
1923 sleep 0.03
2024 done
21- echo
2225}
2326
24- # Wait for VHS hidden setup + Show (~4s setup, then ~1.5s empty visible)
25- sleep 5
27+ # Horizontal separator matching Codex style
28+ separator () {
29+ local cols
30+ cols=$( tput cols 2> /dev/null || echo 60)
31+ printf ' %s' " ${DIM} "
32+ printf ' %*s' " $cols " ' ' | tr ' ' ' ─'
33+ printf ' %s\n' " ${RESET} "
34+ }
35+
36+ # Wait for tmux setup (~2s already elapsed before recording starts)
37+ sleep 3
2638
27- # Claude Code banner
28- echo -e " ${BOLD}${PURPLE} ╭────────────────────────────────────────╮${RESET} "
29- echo -e " ${BOLD}${PURPLE} │${RESET} ${PURPLE} ✻${RESET}${BOLD} Welcome to Claude Code! ${PURPLE} │${RESET} "
30- echo -e " ${BOLD}${PURPLE} │${RESET} /help for help ${PURPLE} │${RESET} "
31- echo -e " ${BOLD}${PURPLE} ╰────────────────────────────────────────╯${RESET} "
39+ # --- Codex prompt with user task ---
40+ printf ' %s ' " ${PROMPT} "
41+ type_out " Add a detail parameter to health endpoint, and a version to config"
42+ echo
3243echo
33- sleep 0.8
3444
35- # --- Change 1: add detail param to health handler ---
45+ sleep 0.8
3646
37- printf ' %b> %b ' " $BOLD " " $RESET "
38- type_out " Add a detail parameter to the health endpoint "
47+ # --- Phase 1: reading files ---
48+ echo -e " ${BULLET} Reading project files to understand current structure. "
3949echo
40- sleep 0.3
50+ sleep 0.4
4151
42- echo -e " ${PURPLE} ⏺${RESET} Adding a ${BOLD} detail${RESET} query parameter with JSON response."
52+ echo -e " ${CORNER} Read ${DIM} internal/handler/health.go${RESET} "
53+ sleep 0.6
54+ echo -e " ${CORNER} Read ${DIM} internal/config/config.go${RESET} "
4355echo
44- sleep 0.5
56+ sleep 0.8
4557
46- echo -e " ${GREEN} Edit${RESET} ${DIM} internal/handler/health.go${RESET} "
58+ # --- Phase 2: first edit (health.go) ---
59+ echo -e " ${BULLET} Edited ${BOLD} internal/handler/health.go${RESET} "
60+ echo -e " ${CORNER} ${DIM} +8 -1${RESET} "
4761
4862# Make actual file change (triggers diffpane)
4963cat > " $DEMO_DIR /internal/handler/health.go" << 'GOEOF '
@@ -71,23 +85,12 @@ func Health(w http.ResponseWriter, r *http.Request) {
7185}
7286GOEOF
7387
74- sleep 1
75- echo -e " ${GREEN} ✓${RESET} Changes applied"
7688echo
7789sleep 1.5
7890
79- # --- Change 2: add version to config ---
80-
81- printf ' %b> %b' " $BOLD " " $RESET "
82- type_out " Add version to the config"
83- echo
84- sleep 0.3
85-
86- echo -e " ${PURPLE} ⏺${RESET} Adding a version field to the config map."
87- echo
88- sleep 0.5
89-
90- echo -e " ${GREEN} Edit${RESET} ${DIM} internal/config/config.go${RESET} "
91+ # --- Phase 3: second edit (config.go) ---
92+ echo -e " ${BULLET} Edited ${BOLD} internal/config/config.go${RESET} "
93+ echo -e " ${CORNER} ${DIM} +1 -0${RESET} "
9194
9295# Make actual file change (triggers diffpane)
9396cat > " $DEMO_DIR /internal/config/config.go" << 'GOEOF '
@@ -101,8 +104,22 @@ var Config = map[string]string{
101104}
102105GOEOF
103106
107+ echo
104108sleep 1
105- echo -e " ${GREEN} ✓${RESET} Changes applied"
109+
110+ # --- Phase 4: verification ---
111+ echo -e " ${BULLET} Ran ${DIM} git diff --stat${RESET} "
112+ echo -e " ${CORNER} ${DIM} 2 files changed, 9 insertions(+), 1 deletion(-)${RESET} "
113+ echo
114+
115+ sleep 0.5
116+ separator
117+ echo
118+
119+ # --- Completion summary ---
120+ echo -e " ${BULLET} Added ${BOLD} detail${RESET} query parameter to health handler and"
121+ echo -e " ${BOLD} version${RESET} field to config map."
122+ echo
106123
107124# Keep alive so tmux pane doesn't close
108125sleep 60
0 commit comments