Expand description
List and optionally batch‑merge GitHub pull requests interactively, or create issues with associated branches.
Provides a colorized TUI to select multiple PRs then apply a composite
operation (approve & merge, Dependabot rebase, enable auto-merge). Alternatively, create a GitHub issue
and an associated branch from the default branch. Mirrors the run() pattern
used by gch so the binary main stays trivial.
§Flow
- Parse flags (
--search,--merge-state,issue). - If
issueis present:- Prompt for issue title via [
ytil_tui::text_prompt]. - Prompt for whether to checkout the branch via [
ytil_tui::yes_no_select]. - Create issue via [
ytil_gh::issue::create]. - Develop the issue via [
ytil_gh::issue::develop] (creates branch and optionally checks it out).
- Prompt for issue title via [
- Otherwise:
- Detect current repository via [
ytil_gh::get_repo_view_field]. - Fetch PR list via [
ytil_gh::pr::get] (GitHub CLIgh pr list) forwarding the search filter. - Apply optional in‑process merge state filter.
- Present multi‑select TUI via [
ytil_tui::minimal_multi_select]. - Execute chosen high‑level operation over selected PRs, reporting per‑PR result.
- Detect current repository via [
§Flags
--search <FILTER>or--search=<FILTER>: forwarded togh pr list --search. Optional.--merge-state <STATE>or--merge-state=<STATE>: client‑side filter over fetched PRs. Accepted (case‑insensitive) values for [PullRequestMergeState]:Behind|Blocked|Clean|Dirty|Draft|HasHooks|Unknown|Unmergeable|Unstable.issue: switch to issue creation mode (prompts for title, creates issue and branch).
Use -- to terminate flag parsing (subsequent arguments ignored by this tool).
§Usage
ghl # list all open PRs interactively
ghl --search "fix ci" # filter by search terms
ghl --merge-state Clean # filter by merge state only
ghl --search="lint" --merge-state Dirty # combine search + state (supports = or space)
ghl issue # create issue and branch interactively§Errors
- Flag parsing fails (unknown flag, missing value, invalid [
PullRequestMergeState]). - GitHub CLI invocation fails (listing PRs via [
ytil_gh::pr::get], approving via [ytil_gh::pr::approve], merging via [ytil_gh::pr::merge], commenting via [ytil_gh::pr::dependabot_rebase], creating issue via [ytil_gh::issue::create]). - TUI interaction fails (selection UI errors via [
ytil_tui::minimal_multi_select] and [ytil_tui::minimal_select], issue title prompt via [ytil_tui::text_prompt], branch checkout prompt via [ytil_tui::yes_no_select]). - GitHub CLI invocation fails (issue and branch creation via [
ytil_gh::issue::create] and [ytil_gh::issue::develop]).
§Future Work
- Add dry‑run mode printing planned operations without executing.
- Provide additional bulk actions (labeling, commenting).
- Introduce structured logging (JSON) for automated auditing.
Structs§
- Renderable
Listed 🔒Issue - Renderable
Pull Request - Newtype wrapper implementing colored
Displayfor a [PullRequest]. - Selectable
OpIter 🔒 - An iterator over the variants of SelectableOp
Enums§
- Op 🔒
- Atomic pull request operations executed by
ghl. - Selectable
Op 🔒 - User-selectable high-level operations to apply to chosen PRs.
Functions§
- create_
branch_ 🔒from_ issue - Interactively creates a GitHub branch from a selected issue.
- create_
issue_ 🔒and_ branch_ from_ default_ branch - Create a GitHub issue and develop it with an associated branch.
- create_
pr 🔒 - Prompts the selection of a branch and creates a pull request for the selected one.
- format_
pr 🔒 - Format concise identifying PR fields for log / status lines.
- main 🔒
- List and optionally batch‑merge GitHub pull requests interactively or create issues with associated branches.
- pr_
title_ 🔒from_ branch_ name - Parses a branch name to generate a pull request title.