-
Notifications
You must be signed in to change notification settings - Fork 1
assets: demo GIF for the reach-layer flow #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,42 +1,116 @@ | ||
| #!/usr/bin/env bash | ||
| # Illustrative Miranda demo for the README GIF — scripted (not a live capture) so the | ||
| # story is tight and reproducible. Rendered via assets/demo.tape with charmbracelet/vhs. | ||
| # Illustrative Miranda demo for the README GIF — authored output, not a live | ||
| # capture, so the story stays tight and reproducible. Rendered by | ||
| # assets/demo.tape with charmbracelet/vhs: | ||
| # | ||
| # vhs assets/demo.tape # run from the repo root | ||
| # | ||
| # Honesty rule for this file: every line it prints is a line the current `mir` | ||
| # prints. The overview screen is go/internal/cli/overview_model.go's Render() | ||
| # output; the attach banner is overview.go's; the `mir share` block — header, | ||
| # QR, both invite lines, the wait line — was captured verbatim from a real run | ||
| # against relay.sourceful-labs.net. That invite has long since expired. The | ||
| # tmux screen and the shell prompt are the user's own programs, not mir's. | ||
| set -u | ||
|
|
||
| C=$'\033[0m'; DIM=$'\033[2m'; B=$'\033[1m' | ||
| G=$'\033[32m'; CY=$'\033[36m'; YL=$'\033[33m'; MG=$'\033[35m'; GY=$'\033[90m' | ||
| PR="${DIM}~${C} ${MG}\$${C} " # local prompt | ||
| RP="${CY}macmini${C}:${DIM}~${C} ${MG}\$${C} " # "remote" prompt | ||
| C=$'\033[0m'; DIM=$'\033[2m'; B=$'\033[1m'; MG=$'\033[35m' | ||
| STATUS=$'\033[30;42m' # tmux's default status bar: black on green | ||
| ALT_ON=$'\033[?1049h\033[?25l' # overview.go: altScreenOn | ||
| ALT_OFF=$'\033[?25h\033[?1049l' # overview.go: altScreenOff | ||
| CLS=$'\033[H\033[2J' # overview.go: clearScreen | ||
| PR="${DIM}~${C} ${MG}\$${C} " # the demo user's shell prompt | ||
|
|
||
| printf '\033[H\033[2J' # wipe the `bash assets/demo.sh` invocation line — start clean | ||
| cmd() { printf "%b%b%b\n" "$PR" "$B" "$1$C"; sleep 0.9; } | ||
|
|
||
| # cmd <text> — render a prompt and a typed command, with a beat before output. | ||
| cmd() { printf "%b%b%b\n" "$1" "$B" "$2$C"; sleep 0.55; } | ||
| out() { printf "%b\n" "$1"; sleep 0.18; } | ||
| # ── the overview, exactly as overviewModel.Render() draws it ────────────────── | ||
| overview() { | ||
| printf '%s%s' "$ALT_ON" "$CLS" | ||
| printf '\r\n' | ||
| printf ' %smir%s%s — your machines%s\r\n' "$B" "$C" "$DIM" "$C" | ||
| printf '\r\n' | ||
| printf ' ▸ ● workstation\r\n' | ||
| [ "${1:-}" = "windows" ] && printf ' %s3 windows — agent, build, logs%s\r\n' "$DIM" "$C" | ||
| printf ' ● builder\r\n' | ||
| printf ' ○ pi\r\n' | ||
| printf '\r\n' | ||
| printf ' %senter attach · s share · r rename · x retire · q quit · ? help%s\r\n' "$DIM" "$C" | ||
| } | ||
|
|
||
| sleep 0.4 | ||
| cmd "$PR" "mir up" | ||
| out " ${G}✓${C} serving ${B}macmini${C} ${DIM}·${C} wallet ${YL}G4XC6h…k4kN${C} ${DIM}·${C} relay.sourceful-labs.net" | ||
| out " ${G}✓${C} LAN-direct on ${DIM}(mDNS + QUIC)${C} ${DIM}·${C} persistent tmux ${DIM}·${C} ${DIM}the relay never sees your shell${C}" | ||
| sleep 0.7 | ||
| printf "\n%b\n\n" "${GY}── from your laptop, anywhere ───────────────────────────────${C}" | ||
| sleep 0.3 | ||
| # ── what the far end paints once the data channel is up: plain tmux. tmux | ||
| # takes the alt screen itself, which is why detaching puts the banner back. | ||
| tmux_screen() { | ||
| local rows cols left right | ||
| rows=$(tput lines); cols=$(tput cols) | ||
| left='[main] 0:agent* 1:build- 2:logs' | ||
| right='"workstation" 15:42 30-Aug-26 ' | ||
| printf '%s%s' "$ALT_ON" "$CLS" | ||
| printf 'workstation:~/src/ingest $ ./agent run --plan refactor.md\r\n' | ||
| printf '[13:58:04] step 4/9 rewrote loader.go, splitter.go\r\n' | ||
| printf '[14:19:40] step 5/9 go test ./... — 312 passed\r\n' | ||
| printf '[15:41:57] step 6/9 migrating fixtures … 41%%\r\n' | ||
| printf '%s▉%s' "$B" "$C" | ||
| printf '\033[?7l\033[%d;1H%s%s%*s%s%s\033[?7h' "$rows" "$STATUS" "$left" \ | ||
| "$(( cols - ${#left} - ${#right} ))" '' "$right" "$C" | ||
| } | ||
|
|
||
| printf '%s' "$CLS" # wipe the `bash assets/demo.sh` invocation line | ||
| sleep 0.8 | ||
|
|
||
| cmd "$PR" "mir list" | ||
| out " ${MG}📣${C} new device ${B}\"macmini\"${C} joined your wallet" | ||
| out " ${B}macmini${C} ${DIM}a1b2c3d4…${C} ${G}online${C} ${DIM}· LAN-direct${C}" | ||
| out " ${B}linux${C} ${DIM}d4e5f6a7…${C} ${G}online${C} ${DIM}· relay${C}" | ||
| # 1. bare `mir` opens your machines. | ||
| cmd "mir" | ||
| overview | ||
| sleep 2.2 | ||
|
|
||
| # 2. Enter attaches. overview.go leaves the alt screen, prints the banner on | ||
| # stderr, then the machine's own tmux paints over it. | ||
| printf '%s' "$ALT_OFF" | ||
| printf '[mir] attached to workstation — Ctrl-O then d comes back to your machines\r\n' | ||
| sleep 0.7 | ||
| tmux_screen | ||
| sleep 3.2 | ||
|
|
||
| # 3. Ctrl-O d comes back: tmux gives the screen up, then the overview redraws. | ||
| # The row now remembers what is running over there. | ||
| printf '%s' "$ALT_OFF" | ||
| overview windows | ||
| sleep 2.2 | ||
|
|
||
| cmd "$PR" "mir attach macmini" | ||
| out " ${DIM}[mir]${C} ${B}macmini${C} — peer-to-peer, ${CY}Noise-encrypted end-to-end${C} ${DIM}(no SSH, no port-forward)${C}" | ||
| sleep 0.5 | ||
| cmd "$RP" "uptime" | ||
| out " 14:32:07 up 3 days, 2:11, load average: 0.11, 0.09, 0.05" | ||
| # 4. q quits to the shell; one invite, read-only, gone in an hour. | ||
| printf '%s' "$ALT_OFF" | ||
| cmd "mir share --ttl 1h workstation" | ||
| printf 'Share "workstation" — read-only access until 16:42.\n' | ||
| printf '\n 📱 Have your guest scan this:\n\n' | ||
| sleep 0.3 | ||
| cmd "$RP" "whoami && hostname" | ||
| out "fredrik" | ||
| out "macmini" | ||
| sleep 0.4 | ||
| printf "%b%b" "$RP" "${B}▉${C}" | ||
| sleep 1.6 | ||
| /bin/cat <<'QR' | ||
| █████████████████████████████████████████████████████ | ||
| █████████████████████████████████████████████████████ | ||
| ████ ▄▄▄▄▄ ██▀█▀▄▄▄█▄▀▀▄▄▀▀ █ ▄ █▀ █▀▄█ ▄▄▄▄▄ ████ | ||
| ████ █ █ █▄ █▄▄███▄▄▄█▀ ▀█▀ █▄▀█▄██ ▀█ █ █ ████ | ||
| ████ █▄▄▄█ ██▀ █▄▄▀▄ ▄▄▄ ▄ ▄ ▄▄▄█ █▄▄▄█ ████ | ||
| ████▄▄▄▄▄▄▄█ ▀▄█▄▀ ▀▄▀ █ █▄█ ▀ █ █▄▀ █▄▀ █▄▄▄▄▄▄▄████ | ||
| ████ █▄▄▄▄ ██ ██ ▄▄▀ ▄▄▄██▄▄▄▄ ▄▄██▄▄▀▀█▄█▀████ | ||
| ████ █▀█▄▄▄▄▄ ▀████▀▀▀▄▄█▄▄ ▄▀▄▄▄█ ▀█▀ █▀██▄██ ▄████ | ||
| ████ ▀ ▄▄▀▀▄█▀█▄▄ █▄▄ ▀▀█▄██ █▄ ▄███▄▄ ▄▀█ ▄████ | ||
| █████▄ █▄▄█▀▀ ▀█▄▀███ ███ ▄▀▀▀ ██▀▀██ █▀█▀█▄▄ ████ | ||
| ████ ▄█ █▄▄ ▀ ▀██▄▀▄█ ▀▄█▀██▄▄▀▄█ ████ ▄▄▄ ▀▄ ████ | ||
| █████ █▄▀ ▄▀ ▀█▀▄██ ▄▄ ██▄██▄█ ▄▀▀█▀▄ ▀▀█▀▀▄▄▄▄ ▄████ | ||
| ████ ▄▄ ▄▄▄ ▄▀ ▄█ ██▄ █ ▄▄▄ ▄▄█▄ █▄ ▄▄▀ ▄▄▄ ▀█ ▄████ | ||
| ████▀▄▀▀ █▄█ ▄▄█▀ ▀▀▀█ ▄ █▄█ ▀ ▀▄▀▄ ▄▄ █▄█ █ ████ | ||
| ████▀██ ▄▄▄▄▀▀ ▄ █▄▄▄▄▄ ▄▄▄▄▄▀ █ ▄▄▀▄▄▄▄▄ ██ ████ | ||
| ████ ▄█▀▄█▄█▀▀▀ ▄▀ ██▀█▀ ▄██▄█▀ ███▀▄▀▀█▀ ▄▀▀▄█ ▄████ | ||
| ████ ▀█ █▀▄▀▄▀▀▄█▄▄▄█ █ ▄▄▄ ▄▄ ▄▄▀▀ ▀██ ▀▀▀████ | ||
| ████▀▄█▀ ▀▄▀█▄▄▄██▄▄▄▀▀█▀▀██▄ ▀▀▀▀▄ ▀▄▀██▄ █▄▀█ ▄████ | ||
| ████▄▀ ▀▀▀▄█▀███ █▄██ ▄▀ ▄█▄██▄▄▄█▄▄▀▄█▄ █▄▄▀▀ ████ | ||
| █████▀▀▀ █▄▀▄█▄█▀ ▀██ █ ██▀▀▀▀█▀▀▄▀▀▄▀ ▄▄▄ ▄ ▄████ | ||
| ████▄██▄▄█▄▄ █▄▄ █ ▀ ▄▄▄ ▄▄ ██ ▄███ ▄▄▄ ▄▀█ ████ | ||
| ████ ▄▄▄▄▄ █ ▀█▄ ▀ █ ▄█ █▄█ █ ▀▄ ▄ █▄█ █▄ ████ | ||
| ████ █ █ █▄▀ ▄ ███▄▄▀ ▄▄▄▄▄█▄ ██ ▄▄▄ ▄ ▄▄ ██▄▄████ | ||
| ████ █▄▄▄█ █ ▄ ▄▄█▄▄▄▄▄▀█ ▀██▀ ███ ▀▀█▄ ▄█▄ ▄▄▀█████ | ||
| ████▄▄▄▄▄▄▄█▄█▄██▄▄▄▄▄▄█▄▄▄▄▄▄█▄▄▄█▄▄███▄██▄█▄█▄▄████ | ||
| █████████████████████████████████████████████████████ | ||
| ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ | ||
| QR | ||
| printf '\n …or open: https://term.sourceful-labs.net/#join-eyJzIjoiaHR0cHM6Ly9yZWxheS5zb3VyY2VmdWwtbGFicy5uZXQiLCJ0IjoiYzRlNGJiODc5NWFjM2Y2NmMyODE3ZjM3NGNiYjY3ZDUifQ\n' | ||
| printf ' …or on the CLI: mir join eyJzIjoiaHR0cHM6Ly9yZWxheS5zb3VyY2VmdWwtbGFicy5uZXQiLCJ0IjoiYzRlNGJiODc5NWFjM2Y2NmMyODE3ZjM3NGNiYjY3ZDUifQ\n' | ||
| printf '\nwaiting for your guest (5 min)…\n' | ||
| sleep 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the committed
assets/miranda-demo.gif, the final frame still shows only the share header and QR; the…or open:, CLI join code, andwaiting for your guestlines emitted after the heredoc never appear. This means the rendered asset does not show the complete sharing flow promised by the tape comments, so extend the capture and re-render the GIF until those final lines are visible.Useful? React with 👍 / 👎.