fj/scripts/record-demo.sh
Stephen Way 71e536ffd8
Some checks are pending
ci / check (push) Waiting to run
release / build (darwin-aarch64, macos, aarch64-apple-darwin) (push) Waiting to run
release / build (darwin-x86_64, macos, x86_64-apple-darwin) (push) Waiting to run
release / build (rust:1.95-bookworm, linux-x86_64, docker, x86_64-unknown-linux-gnu) (push) Waiting to run
release / publish (push) Blocked by required conditions
open-source readiness: release workflow, homebrew template, templates, compat doc
Release infrastructure:
* .forgejo/workflows/release.yml: on v* tags, builds darwin-aarch64,
  darwin-x86_64, linux-x86_64 tarballs, computes SHA256SUMS, uploads to
  the Forgejo release, and writes a ready-to-commit fj.rb formula.
* dist/homebrew/fj.rb.tmpl + scripts/render-homebrew-formula.sh for
  local rendering. Publishes into rasterandstate/homebrew-tap.

Issue + PR templates:
* .forgejo/issue_template/{bug,feature,api-gap}.md so triage isn't
  guessing at the user's environment.
* .forgejo/pull_request_template.md with a fmt/clippy/test checklist
  and a "what to update" surface-changes section.

README demo scaffolding:
* scripts/record-demo.sh drives asciinema through a representative
  ~30s session covering --version, repo view (auto-detect), issue/pr
  list, api, --json-fields, browse.
* README has a commented-out asciicast embed waiting for the v0.1.0
  recording.

Compatibility:
* docs/compatibility.md: tested Forgejo versions, caveats for older
  Gitea (≤1.19), Forgejo-only endpoints we expose.
* `fj auth login` now probes /api/v1/version once and warns to stderr
  when the server reports a pre-7.x version. Parser is pure-fn tested
  (modern, old, unparseable cases).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 15:09:18 -07:00

52 lines
1.5 KiB
Bash
Executable file

#!/usr/bin/env bash
# Record an asciinema demo of fj. The result is a .cast file you can:
# - Upload to asciinema.org via `asciinema upload dist/demo.cast`
# - Embed as a static SVG/GIF via `agg` (https://github.com/asciinema/agg)
# - Link from README.md
#
# Requires: asciinema, fj (installed and authenticated), `jq` for nicer output.
#
# Usage:
# ./scripts/record-demo.sh # records dist/demo.cast
# ./scripts/record-demo.sh foo.cast # records to foo.cast
#
# The session below is deliberately short (~30 seconds) and covers what
# someone reading the README in their first 10 seconds cares about.
set -euo pipefail
OUT="${1:-dist/demo.cast}"
mkdir -p "$(dirname "$OUT")"
if ! command -v asciinema >/dev/null 2>&1; then
cat >&2 <<EOF
asciinema not found.
macOS: brew install asciinema
Linux: pipx install asciinema
EOF
exit 1
fi
if ! command -v fj >/dev/null 2>&1; then
echo "fj not found on PATH; build it first (cargo build --release)" >&2
exit 1
fi
# Drive a representative session through asciinema.
# Idle pauses keep readability up; trim them in post if you want a snappier
# embedded GIF.
asciinema rec \
--overwrite \
--idle-time-limit 2 \
--title "fj: a CLI for Forgejo" \
--command "bash $(dirname "$0")/_demo-session.sh" \
"$OUT"
echo ""
echo "✓ Recorded $OUT"
echo ""
echo "Next:"
echo " asciinema play $OUT # preview"
echo " asciinema upload $OUT # publish (returns a URL)"
echo " agg $OUT $OUT.gif # render to GIF"