Skip to content

Commit 9dc01dd

Browse files
KD-K2N2claude
andcommitted
Fix demo GIF — use asciinema cast + agg instead of broken VHS output
Python script generates proper asciicast v2 format with ANSI colors (green checkmarks, cyan project names, yellow indices, gray tags, purple/red memory types). Dracula theme, 150 frames, 776KB. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8064672 commit 9dc01dd

5 files changed

Lines changed: 490 additions & 0 deletions

File tree

assets/cortex-demo.gif

-1.04 MB
Loading

demos/cortex-demo.cast

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
{"version": 2, "width": 82, "height": 26, "env": {"SHELL": "/bin/bash", "TERM": "xterm-256color"}}
2+
[0.8, "o", "\u001b[32m\u276f\u001b[0m "]
3+
[0.845, "o", "c"]
4+
[0.89, "o", "o"]
5+
[0.935, "o", "r"]
6+
[0.98, "o", "t"]
7+
[1.025, "o", "e"]
8+
[1.07, "o", "x"]
9+
[1.115, "o", " "]
10+
[1.16, "o", "i"]
11+
[1.205, "o", "n"]
12+
[1.25, "o", "i"]
13+
[1.295, "o", "t"]
14+
[1.595, "o", "\r\n"]
15+
[2.295, "o", "\r\n"]
16+
[2.445, "o", " \u001b[32m\u2713\u001b[0m Cortex v1.0.0 installed\r\n"]
17+
[2.595, "o", " \u001b[32m\u2713\u001b[0m Daemon started (PID 48291)\r\n"]
18+
[2.745, "o", " \u001b[32m\u2713\u001b[0m MCP server registered with Claude Code\r\n"]
19+
[2.895, "o", " \u001b[32m\u2713\u001b[0m Database created (~/.cortex/cortex.db)\r\n"]
20+
[2.995, "o", "\r\n"]
21+
[3.095, "o", " Cortex is ready. Open Claude Code \u2014 it will remember.\r\n"]
22+
[3.195, "o", "\r\n"]
23+
[4.995, "o", "\u001b[32m\u276f\u001b[0m "]
24+
[5.04, "o", "c"]
25+
[5.085, "o", "o"]
26+
[5.13, "o", "r"]
27+
[5.175, "o", "t"]
28+
[5.22, "o", "e"]
29+
[5.265, "o", "x"]
30+
[5.31, "o", " "]
31+
[5.355, "o", "s"]
32+
[5.4, "o", "t"]
33+
[5.445, "o", "a"]
34+
[5.49, "o", "t"]
35+
[5.535, "o", "u"]
36+
[5.58, "o", "s"]
37+
[5.88, "o", "\r\n"]
38+
[6.48, "o", "\r\n"]
39+
[6.6, "o", " Daemon: \u001b[32mrunning\u001b[0m (PID 48291, uptime 3d 14h)\r\n"]
40+
[6.7, "o", " MCP Server: localhost:7434 (5 tools)\r\n"]
41+
[6.8, "o", " Dashboard: localhost:7433\r\n"]
42+
[6.9, "o", " Database: ~/.cortex/cortex.db (2.1 MB)\r\n"]
43+
[7.0, "o", "\r\n"]
44+
[7.1, "o", " Projects:\r\n"]
45+
[7.22, "o", " \u001b[36mmy-saas-app\u001b[0m 89 memories \u001b[32m(active)\u001b[0m\r\n"]
46+
[7.32, "o", " cortex 34 memories\r\n"]
47+
[7.42, "o", " infra-scripts 12 memories\r\n"]
48+
[7.52, "o", " Total: 135 memories across 3 projects\r\n"]
49+
[7.62, "o", "\r\n"]
50+
[9.42, "o", "\u001b[32m\u276f\u001b[0m "]
51+
[9.465, "o", "c"]
52+
[9.51, "o", "o"]
53+
[9.555, "o", "r"]
54+
[9.6, "o", "t"]
55+
[9.645, "o", "e"]
56+
[9.69, "o", "x"]
57+
[9.735, "o", " "]
58+
[9.78, "o", "s"]
59+
[9.825, "o", "h"]
60+
[9.87, "o", "o"]
61+
[9.915, "o", "w"]
62+
[9.96, "o", " "]
63+
[10.005, "o", "m"]
64+
[10.05, "o", "y"]
65+
[10.095, "o", "-"]
66+
[10.14, "o", "s"]
67+
[10.185, "o", "a"]
68+
[10.23, "o", "a"]
69+
[10.275, "o", "s"]
70+
[10.32, "o", "-"]
71+
[10.365, "o", "a"]
72+
[10.41, "o", "p"]
73+
[10.455, "o", "p"]
74+
[10.5, "o", " "]
75+
[10.545, "o", "-"]
76+
[10.59, "o", "-"]
77+
[10.635, "o", "t"]
78+
[10.68, "o", "y"]
79+
[10.725, "o", "p"]
80+
[10.77, "o", "e"]
81+
[10.815, "o", " "]
82+
[10.86, "o", "d"]
83+
[10.905, "o", "e"]
84+
[10.95, "o", "c"]
85+
[10.995, "o", "i"]
86+
[11.04, "o", "s"]
87+
[11.085, "o", "i"]
88+
[11.13, "o", "o"]
89+
[11.175, "o", "n"]
90+
[11.475, "o", "\r\n"]
91+
[12.075, "o", "\r\n"]
92+
[12.175, "o", " \u001b[1m# Decision memories for my-saas-app\u001b[0m (4 of 23)\r\n"]
93+
[12.275, "o", "\r\n"]
94+
[12.455, "o", " \u001b[33m[1]\u001b[0m importance:\u001b[36m9\u001b[0m 2025-03-18 \u001b[90m#database #orm\u001b[0m\r\n"]
95+
[12.535, "o", " Using Drizzle ORM \u2014 better edge runtime support, no binary dep\r\n"]
96+
[12.635, "o", "\r\n"]
97+
[12.815, "o", " \u001b[33m[2]\u001b[0m importance:\u001b[36m8\u001b[0m 2025-03-17 \u001b[90m#react #architecture\u001b[0m\r\n"]
98+
[12.895, "o", " Server components by default, use client only for state/effects\r\n"]
99+
[12.995, "o", "\r\n"]
100+
[13.175, "o", " \u001b[33m[3]\u001b[0m importance:\u001b[36m8\u001b[0m 2025-03-16 \u001b[90m#auth\u001b[0m\r\n"]
101+
[13.255, "o", " Clerk for auth, Supabase for DB only \u2014 no Supabase auth/storage\r\n"]
102+
[13.355, "o", "\r\n"]
103+
[13.535, "o", " \u001b[33m[4]\u001b[0m importance:\u001b[36m7\u001b[0m 2025-03-15 \u001b[90m#styling\u001b[0m\r\n"]
104+
[13.615, "o", " Tailwind 4 + CVA for component variants, no CSS modules\r\n"]
105+
[13.715, "o", "\r\n"]
106+
[15.515, "o", "\u001b[32m\u276f\u001b[0m "]
107+
[15.56, "o", "c"]
108+
[15.605, "o", "o"]
109+
[15.65, "o", "r"]
110+
[15.695, "o", "t"]
111+
[15.74, "o", "e"]
112+
[15.785, "o", "x"]
113+
[15.83, "o", " "]
114+
[15.875, "o", "s"]
115+
[15.92, "o", "e"]
116+
[15.965, "o", "a"]
117+
[16.01, "o", "r"]
118+
[16.055, "o", "c"]
119+
[16.1, "o", "h"]
120+
[16.145, "o", " "]
121+
[16.19, "o", "\""]
122+
[16.235, "o", "w"]
123+
[16.28, "o", "e"]
124+
[16.325, "o", "b"]
125+
[16.37, "o", "s"]
126+
[16.415, "o", "o"]
127+
[16.46, "o", "c"]
128+
[16.505, "o", "k"]
129+
[16.55, "o", "e"]
130+
[16.595, "o", "t"]
131+
[16.64, "o", " "]
132+
[16.685, "o", "t"]
133+
[16.73, "o", "i"]
134+
[16.775, "o", "m"]
135+
[16.82, "o", "e"]
136+
[16.865, "o", "o"]
137+
[16.91, "o", "u"]
138+
[16.955, "o", "t"]
139+
[17.0, "o", "\""]
140+
[17.3, "o", "\r\n"]
141+
[17.9, "o", "\r\n"]
142+
[18.0, "o", " Found \u001b[1m2 matches\u001b[0m across 1 project:\r\n"]
143+
[18.1, "o", "\r\n"]
144+
[18.25, "o", " \u001b[36m[my-saas-app]\u001b[0m \u001b[35mthread\u001b[0m (importance:7)\r\n"]
145+
[18.33, "o", " WebSocket drops after 100s \u2014 suspect Cloudflare proxy timeout\r\n"]
146+
[18.43, "o", "\r\n"]
147+
[18.58, "o", " \u001b[36m[my-saas-app]\u001b[0m \u001b[31merror\u001b[0m (importance:6)\r\n"]
148+
[18.66, "o", " Reconnection loop when server restarts during active WS session\r\n"]
149+
[18.76, "o", "\r\n"]
150+
[20.76, "o", "\u001b[32m\u276f\u001b[0m "]

demos/mock/cortex

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/env bash
2+
# Mock cortex CLI for demo recording
3+
4+
case "$1" in
5+
init)
6+
sleep 0.3
7+
echo ""
8+
echo " ✓ Cortex v1.0.0 installed"
9+
echo " ✓ Daemon started (PID 48291)"
10+
echo " ✓ MCP server registered with Claude Code"
11+
echo " ✓ Database created (~/.cortex/cortex.db)"
12+
echo ""
13+
echo " Cortex is ready. Open Claude Code — it will remember."
14+
echo ""
15+
;;
16+
status)
17+
sleep 0.3
18+
echo ""
19+
echo " Daemon: running (PID 48291, uptime 3d 14h)"
20+
echo " MCP Server: localhost:7434 (5 tools)"
21+
echo " Dashboard: localhost:7433"
22+
echo " Database: ~/.cortex/cortex.db (2.1 MB)"
23+
echo ""
24+
echo " Projects:"
25+
echo " my-saas-app 89 memories (active)"
26+
echo " cortex 34 memories"
27+
echo " infra-scripts 12 memories"
28+
echo " Total: 135 memories across 3 projects"
29+
echo ""
30+
;;
31+
show)
32+
sleep 0.3
33+
echo ""
34+
echo " # Decision memories for my-saas-app (showing 4 of 23)"
35+
echo ""
36+
echo " [1] importance:9 2025-03-18 #database #orm"
37+
echo " Using Drizzle ORM — better edge runtime support, no binary dep"
38+
echo ""
39+
echo " [2] importance:8 2025-03-17 #react #architecture"
40+
echo " Server components by default, use client only for state/effects"
41+
echo ""
42+
echo " [3] importance:8 2025-03-16 #auth"
43+
echo " Clerk for auth, Supabase for DB only — no Supabase auth/storage"
44+
echo ""
45+
echo " [4] importance:7 2025-03-15 #styling"
46+
echo " Tailwind 4 + CVA for component variants, no CSS modules"
47+
echo ""
48+
;;
49+
search)
50+
sleep 0.3
51+
echo ""
52+
echo " Found 2 matches across 1 project:"
53+
echo ""
54+
echo " [my-saas-app] thread (importance:7)"
55+
echo " WebSocket drops after 100s — suspect Cloudflare proxy timeout"
56+
echo ""
57+
echo " [my-saas-app] error (importance:6)"
58+
echo " Reconnection loop when server restarts during active WS session"
59+
echo ""
60+
;;
61+
esac

demos/record.py

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
#!/usr/bin/env python3
2+
"""Generate an asciinema .cast file for the Cortex demo, then convert to GIF."""
3+
4+
import json
5+
import os
6+
import subprocess
7+
import sys
8+
9+
CAST_FILE = "demos/cortex-demo.cast"
10+
GIF_FILE = "assets/cortex-demo.gif"
11+
12+
events = []
13+
t = 0.0
14+
15+
def out(text, delay=0.0):
16+
global t
17+
t += delay
18+
events.append([round(t, 4), "o", text])
19+
20+
def line(text, delay=0.1):
21+
out(text + "\r\n", delay)
22+
23+
def type_text(text, char_delay=0.045):
24+
for ch in text:
25+
out(ch, char_delay)
26+
27+
def prompt(delay=0.5):
28+
out("\x1b[32m❯\x1b[0m ", delay)
29+
30+
def enter(delay=0.3):
31+
out("\r\n", delay)
32+
33+
def pause(seconds):
34+
global t
35+
t += seconds
36+
37+
# --- Scene 1: cortex init ---
38+
prompt(0.8)
39+
type_text("cortex init")
40+
enter(0.3)
41+
pause(0.6)
42+
43+
line("")
44+
line(" \x1b[32m✓\x1b[0m Cortex v1.0.0 installed", 0.15)
45+
line(" \x1b[32m✓\x1b[0m Daemon started (PID 48291)", 0.15)
46+
line(" \x1b[32m✓\x1b[0m MCP server registered with Claude Code", 0.15)
47+
line(" \x1b[32m✓\x1b[0m Database created (~/.cortex/cortex.db)", 0.15)
48+
line("")
49+
line(" Cortex is ready. Open Claude Code \u2014 it will remember.", 0.1)
50+
line("")
51+
52+
# --- Scene 2: cortex status ---
53+
prompt(1.8)
54+
type_text("cortex status")
55+
enter(0.3)
56+
pause(0.5)
57+
58+
line("")
59+
line(" Daemon: \x1b[32mrunning\x1b[0m (PID 48291, uptime 3d 14h)", 0.12)
60+
line(" MCP Server: localhost:7434 (5 tools)", 0.1)
61+
line(" Dashboard: localhost:7433", 0.1)
62+
line(" Database: ~/.cortex/cortex.db (2.1 MB)", 0.1)
63+
line("")
64+
line(" Projects:", 0.1)
65+
line(" \x1b[36mmy-saas-app\x1b[0m 89 memories \x1b[32m(active)\x1b[0m", 0.12)
66+
line(" cortex 34 memories", 0.1)
67+
line(" infra-scripts 12 memories", 0.1)
68+
line(" Total: 135 memories across 3 projects", 0.1)
69+
line("")
70+
71+
# --- Scene 3: cortex show ---
72+
prompt(1.8)
73+
type_text("cortex show my-saas-app --type decision")
74+
enter(0.3)
75+
pause(0.5)
76+
77+
line("")
78+
line(" \x1b[1m# Decision memories for my-saas-app\x1b[0m (4 of 23)", 0.1)
79+
line("")
80+
line(" \x1b[33m[1]\x1b[0m importance:\x1b[36m9\x1b[0m 2025-03-18 \x1b[90m#database #orm\x1b[0m", 0.18)
81+
line(" Using Drizzle ORM \u2014 better edge runtime support, no binary dep", 0.08)
82+
line("")
83+
line(" \x1b[33m[2]\x1b[0m importance:\x1b[36m8\x1b[0m 2025-03-17 \x1b[90m#react #architecture\x1b[0m", 0.18)
84+
line(" Server components by default, use client only for state/effects", 0.08)
85+
line("")
86+
line(" \x1b[33m[3]\x1b[0m importance:\x1b[36m8\x1b[0m 2025-03-16 \x1b[90m#auth\x1b[0m", 0.18)
87+
line(" Clerk for auth, Supabase for DB only \u2014 no Supabase auth/storage", 0.08)
88+
line("")
89+
line(" \x1b[33m[4]\x1b[0m importance:\x1b[36m7\x1b[0m 2025-03-15 \x1b[90m#styling\x1b[0m", 0.18)
90+
line(" Tailwind 4 + CVA for component variants, no CSS modules", 0.08)
91+
line("")
92+
93+
# --- Scene 4: cortex search ---
94+
prompt(1.8)
95+
type_text('cortex search "websocket timeout"')
96+
enter(0.3)
97+
pause(0.5)
98+
99+
line("")
100+
line(" Found \x1b[1m2 matches\x1b[0m across 1 project:", 0.1)
101+
line("")
102+
line(" \x1b[36m[my-saas-app]\x1b[0m \x1b[35mthread\x1b[0m (importance:7)", 0.15)
103+
line(" WebSocket drops after 100s \u2014 suspect Cloudflare proxy timeout", 0.08)
104+
line("")
105+
line(" \x1b[36m[my-saas-app]\x1b[0m \x1b[31merror\x1b[0m (importance:6)", 0.15)
106+
line(" Reconnection loop when server restarts during active WS session", 0.08)
107+
line("")
108+
109+
prompt(2.0)
110+
pause(2.0)
111+
112+
# --- Write cast file ---
113+
header = {
114+
"version": 2,
115+
"width": 82,
116+
"height": 26,
117+
"env": {"SHELL": "/bin/bash", "TERM": "xterm-256color"}
118+
}
119+
120+
os.makedirs(os.path.dirname(CAST_FILE), exist_ok=True)
121+
with open(CAST_FILE, "w") as f:
122+
f.write(json.dumps(header) + "\n")
123+
for ev in events:
124+
f.write(json.dumps(ev) + "\n")
125+
126+
print(f"Cast file: {CAST_FILE} ({len(events)} events)")
127+
128+
# --- Convert to GIF ---
129+
os.makedirs(os.path.dirname(GIF_FILE), exist_ok=True)
130+
result = subprocess.run(
131+
["agg", "--theme", "dracula", "--font-size", "14", CAST_FILE, GIF_FILE],
132+
capture_output=True, text=True
133+
)
134+
135+
if result.returncode != 0:
136+
print(f"agg error: {result.stderr}")
137+
sys.exit(1)
138+
139+
size = os.path.getsize(GIF_FILE)
140+
print(f"GIF created: {GIF_FILE} ({size / 1024 / 1024:.1f} MB)")

0 commit comments

Comments
 (0)