From 22873cb199bd2cd77e9fc81403012696ec1c6909 Mon Sep 17 00:00:00 2001 From: Hammad Majid Date: Thu, 17 Sep 2026 04:29:29 +0500 Subject: [PATCH 1/3] chore(demo): add setup script that builds a throwaway Root for recordings Co-Authored-By: Claude Fable 5.1 --- demo/setup.sh | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100755 demo/setup.sh diff --git a/demo/setup.sh b/demo/setup.sh new file mode 100755 index 0000000..3b363fa --- /dev/null +++ b/demo/setup.sh @@ -0,0 +1,104 @@ +#!/usr/bin/env bash +# Builds a self-contained demo environment for recording cdd, so the +# recording never touches your real Root, config, or History. +# +# demo/setup.sh # builds /tmp/cdd-demo +# DEMO_DIR=~/x demo/setup.sh +# +# Layout it creates: +# $DEMO_DIR/root a fake Root with five Kinds and a few Projects +# $DEMO_DIR/xdg/config XDG_CONFIG_HOME holding cdd/config.toml +# $DEMO_DIR/xdg/data XDG_DATA_HOME holding cdd/history +# $DEMO_DIR/bin/cdd the binary built from this checkout +set -euo pipefail + +DEMO_DIR="${DEMO_DIR:-/tmp/cdd-demo}" +ROOT="$DEMO_DIR/root" +CONFIG="$DEMO_DIR/xdg/config" +DATA="$DEMO_DIR/xdg/data" +BIN="$DEMO_DIR/bin" +REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)" + +rm -rf "$DEMO_DIR" +mkdir -p "$ROOT" "$CONFIG/cdd" "$DATA/cdd" "$BIN" + +# --- Projects ----------------------------------------------------------- +# Each Project is a git repository unless noted. Commit dates are spread +# out so `cdd scan` seeds a varied History. +git_demo() { git -c user.name=demo -c user.email=demo@example.com -c commit.gpgsign=false "$@"; } + +repo() { # repo + local dir="$ROOT/$1"; mkdir -p "$dir" + git_demo -C "$dir" init -q -b main + echo "# ${1##*/}" > "$dir/$3" + local when; when="$(ago "$2")" + GIT_AUTHOR_DATE="$when" GIT_COMMITTER_DATE="$when" git_demo -C "$dir" -c init.defaultBranch=main add -A + GIT_AUTHOR_DATE="$when" GIT_COMMITTER_DATE="$when" git_demo -C "$dir" commit -q -m "initial commit" +} + +ago() { # ago -> ISO timestamp, GNU or BSD date + date -u -d "$1 days ago" +%Y-%m-%dT%H:%M:%SZ 2>/dev/null \ + || date -u -v-"$1"d +%Y-%m-%dT%H:%M:%SZ +} + +repo domain/kryft.dev 1 README.md +repo domain/wowaitech.com 3 README.md +repo domain/candidex.dev 12 README.md +repo tools/cdd 0 main.go +repo tools/grg 6 main.go +repo tools/dotfiles 40 README.md +repo ops/internal 2 README.md +repo ops/backups 90 README.md +repo lab/bubbletea-play 5 main.go +repo uni/compilers 20 notes.md + +# clean vs. dirty vs. untracked vs. ahead +echo "wip" >> "$ROOT/domain/wowaitech.com/README.md" # modified +touch "$ROOT/tools/grg/scratch.go" # untracked +echo "wip" >> "$ROOT/ops/internal/README.md"; touch "$ROOT/ops/internal/new.txt" # both + +upstream="$DEMO_DIR/upstream.git" +git_demo init -q --bare "$upstream" +git_demo -C "$ROOT/domain/kryft.dev" remote add origin "$upstream" +git_demo -C "$ROOT/domain/kryft.dev" push -q -u origin main +echo "more" >> "$ROOT/domain/kryft.dev/README.md" +git_demo -C "$ROOT/domain/kryft.dev" commit -q -am "second commit" # ahead by 1 + +mkdir -p "$ROOT/lab/notes" # not a repository +mkdir -p "$ROOT/.archive/old-thing" "$ROOT/uni/.hidden" # hidden, never listed + +# --- Config and History --------------------------------------------------- +cat > "$CONFIG/cdd/config.toml" <> "$hist" +printf '%s\tjump\t%s\n' "$(ago 1)" domain/kryft.dev >> "$hist" +printf '%s\tjump\t%s\n' "$(ago 2)" ops/internal >> "$hist" + +cat < Date: Thu, 17 Sep 2026 04:29:29 +0500 Subject: [PATCH 2/3] docs(demo): add VHS tape recorded against the demo environment Co-Authored-By: Claude Fable 5.1 --- demo/demo.tape | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 demo/demo.tape diff --git a/demo/demo.tape b/demo/demo.tape new file mode 100644 index 0000000..f356cc2 --- /dev/null +++ b/demo/demo.tape @@ -0,0 +1,34 @@ +# Records demo/demo.gif against the environment built by demo/setup.sh. +# Run `demo/setup.sh` first; it never touches your real Root or History. +# +# demo/setup.sh && vhs demo/demo.tape + +Output demo/demo.gif + +Set Shell fish +Set FontSize 16 +Set Width 1200 +Set Height 640 +Set Padding 20 +Set Theme "Catppuccin Mocha" +Set TypingSpeed 60ms + +Env XDG_CONFIG_HOME /tmp/cdd-demo/xdg/config +Env XDG_DATA_HOME /tmp/cdd-demo/xdg/data + +Hide +Type "set -gx PATH /tmp/cdd-demo/bin $PATH" Enter +Type "cdd init fish | source" Enter +Type "cd /tmp/cdd-demo/root/lab/notes" Enter +Type "clear" Enter +Show + +Type "cdd" Sleep 800ms Enter +Sleep 2.5s +Down Sleep 600ms +Down Sleep 600ms +Type "grg" Sleep 1.5s +Enter +Sleep 800ms +Type "pwd" Enter +Sleep 2.5s From aab11f901661d389b1f94bc5c44a4bcb9713f2a2 Mon Sep 17 00:00:00 2001 From: Hammad Majid Date: Thu, 17 Sep 2026 04:29:29 +0500 Subject: [PATCH 3/3] docs(readme): point the Demo section at the VHS recording Co-Authored-By: Claude Fable 5.1 --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4cba0a7..78908c9 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,8 @@ A TUI that lets you jump to recent Projects. ## Demo - + +![cdd demo](demo/demo.gif) ## Install