$ show aviator-co/av
The `av` CLI tool manages stacked Git branches and their associated GitHub pull requests in an automated workflow. It allows developers to create dependent branches, automatically rebase child branches when parents change, synchronize local state with GitHub (fetches, pushes, prunes merged branches), and interactively reorder or squash commits across a stack. The system uses a local JSON file database (`av.db`) to persist branch metadata and PR associations, a GraphQL client to communicate with GitHub, and a Bubbletea-based terminal UI for interactive prompts and progress spinners. It consists of Cobra command definitions, a git operations wrapper (mix of `go-git` and direct exec), and a state-machine sequencer for multi-step rebase operations with conflict handling. The architecture is modular with clear separation between git operations, GitHub API, state management, and user interface, making it a solid example of a domain-specific developer tool.
The LLM identified 3 files worth highlighting for reuse:
Implements a thread-safe JSON file database using a ReadTx/WriteTx pattern with mutex-based isolation. Provides atomic commit and abort semantics, automatic state file persistence, and a clean interface for reading and writing structured data. This could be extracted for any Go project needing a simple embedded, file-backed key-value store with transaction support, independent of the av-specific domain.
A JSON-serializable state machine for executing multi-branch rebase operations with conflict detection and user-invoked continuation. It plans a sequence of target branches, executes rebases in order, pauses on conflicts, and allows resume/abort/skip. The pattern is reusable for any long-running, interruptible workflow where persistent continuation state is needed (e.g., batch migrations, multi-step CI pipelines).
Provides an interactive stack reordering system using a command pattern (pick, squash, fixup, drop, edit). Allows users to reorder, combine, or remove commits across a stacked branch hierarchy via a TUI editor. The state machine for command execution is decoupled from the UI, making the core logic reusable for other interactive transformation tasks. The commit separation and autosquash logic are implemented with care.