mirror of
git://f0xx.org/ac/ac-scripts
synced 2026-07-29 03:57:56 +03:00
33 lines
1.0 KiB
Bash
Executable File
33 lines
1.0 KiB
Bash
Executable File
#!/bin/sh
|
|
# Bundle Cursor rules + agent transcripts for secondary laptop handoff.
|
|
# Usage: sh export-cursor-handoff.sh [-o /path/to/ac-cursor-handoff.tgz]
|
|
set -eu
|
|
|
|
OUT="${HOME}/ac-cursor-handoff-$(date +%Y%m%d).tar.gz"
|
|
while [ $# -gt 0 ]; do
|
|
case "$1" in
|
|
-o) OUT="${2:?}"; shift 2 ;;
|
|
-h|--help) sed -n '2,4p' "$0"; exit 0 ;;
|
|
*) echo "unknown: $1" >&2; exit 1 ;;
|
|
esac
|
|
done
|
|
|
|
ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
|
CURSOR_PROJ="${HOME}/.cursor/projects"
|
|
STAGE="$(mktemp -d)"
|
|
trap 'rm -rf "$STAGE"' EXIT
|
|
|
|
mkdir -p "$STAGE/handoff"
|
|
[ -d "$ROOT/.cursor/rules" ] && cp -a "$ROOT/.cursor/rules" "$STAGE/handoff/"
|
|
[ -f "$ROOT/AGENTS.md" ] && cp "$ROOT/AGENTS.md" "$STAGE/handoff/"
|
|
|
|
for d in "$CURSOR_PROJ"/*androidcast* "$CURSOR_PROJ"/*ac*; do
|
|
[ -d "$d" ] || continue
|
|
base="$(basename "$d")"
|
|
[ -d "$d/agent-transcripts" ] && cp -a "$d/agent-transcripts" "$STAGE/handoff/cursor-${base}-transcripts"
|
|
done
|
|
|
|
tar czf "$OUT" -C "$STAGE" handoff
|
|
echo "wrote $OUT"
|
|
echo "see ac-docs/docs/CURSOR_SECONDARY_LAPTOP.md"
|