{"id":50043110,"url":"https://github.com/marslo/gh-new","last_synced_at":"2026-05-21T04:07:22.455Z","repository":{"id":345884413,"uuid":"1187716942","full_name":"marslo/gh-new","owner":"marslo","description":"A GitHub CLI extension for smartly creating Pull Requests with an interactive base branch picker powered by fzf","archived":false,"fork":false,"pushed_at":"2026-05-19T05:54:59.000Z","size":1613,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-19T07:58:29.754Z","etag":null,"topics":["gh-cli","gh-extension"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marslo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-21T04:08:25.000Z","updated_at":"2026-05-19T05:55:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/marslo/gh-new","commit_stats":null,"previous_names":["marslo/gh-new"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/marslo/gh-new","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marslo%2Fgh-new","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marslo%2Fgh-new/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marslo%2Fgh-new/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marslo%2Fgh-new/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marslo","download_url":"https://codeload.github.com/marslo/gh-new/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marslo%2Fgh-new/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33288203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T02:57:32.698Z","status":"ssl_error","status_checked_at":"2026-05-21T02:57:31.990Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gh-cli","gh-extension"],"created_at":"2026-05-21T04:07:21.839Z","updated_at":"2026-05-21T04:07:22.448Z","avatar_url":"https://github.com/marslo.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gh-new\n\n\u003e A [GitHub CLI](https://cli.github.com/) extension for smartly creating Pull Requests with an interactive base branch picker powered by [fzf](https://github.com/junegunn/fzf).\n\n---\n\n[![pre-commit](https://img.shields.io/github/actions/workflow/status/marslo/gh-new/pre-commit.yml?logo=githubactions\u0026logoColor=white\u0026label=pre-commit)](https://github.com/marslo/gh-new/actions/workflows/pre-commit.yml)\n![gh extension](https://img.shields.io/badge/gh%20extension-install-ffd700?logo=github\u0026logoColor=white)\n![fzf](https://img.shields.io/badge/CLI-fzf-76d8d2?logo=gnubash\u0026logoColor=white)\n![Bash](https://img.shields.io/badge/Language-bash%20%2F%20jq-c7f484?logo=gnubash\u0026logoColor=white)\n![License](https://img.shields.io/badge/License-MIT-yellow?logo=opensourceinitiative\u0026logoColor=white)\n\n---\n\n## features\n\n- **Interactive base branch selection** — picks from remote branches sorted by most recent commit, with a live `git show` preview\n- **Auto-push** — detects if the current branch hasn't been pushed (or is behind remote) and pushes it before creating the PR\n- **Auto-title \u0026 body** — pre-fills from the latest commit message\n- **`auto-merge` label** — automatically applied if the label exists in the repo\n- **Label management** — add multiple labels via comma-separated values or repeated flags\n- **Draft support** — create the PR as a draft\n- **Pass-through** — forward any extra flags directly to `gh pr create`\n\n---\n\n## requirements\n\n| TOOL                                   | VERSION |\n|----------------------------------------|---------|\n| [gh](https://cli.github.com/)          | ≥ 2.36  |\n| [fzf](https://github.com/junegunn/fzf) | ≥ 0.60  |\n| bash                                   | ≥ 4.0   |\n\n---\n\n## installation\n\n```bash\ngh extension install marslo/gh-new\n```\n\n## setup (submodules + bash completion)\n\n```bash\ngh new --setup\n```\n\n```bash\n# `--force` re-install\ngh new --setup --force\n```\n\n## bash completion\n\n`--setup` prints the two lines you need to add to `~/.bashrc` (order matters):\n\n```bash\n# 1. gh native completion must be sourced first\neval \"$(gh completion -s bash)\"\n# or: source ~/.marslo/bash_completion.d/gh.bash.sh\n\n# 2. gh-new completion wraps __start_gh — must come after\nsource \"${BASH_COMPLETION_USER_DIR:-${HOME}/.local/share/bash-completion}/gh-ext.bash.sh\"\n```\n\n---\n\n## usage\n\n![help](./assets/gh-new-help.png)\n\n```\ngh new [OPTIONS]\n```\n\n### options\n\n| FLAG                  | DESCRIPTION                                                                                       |\n|-----------------------|---------------------------------------------------------------------------------------------------|\n| `-o`, `--open`        | Open the created PR in the browser                                                                |\n| `-l`, `--label LABEL` | Add label(s) — comma-separated or repeated; `auto-merge` is auto-applied if it exists in the repo |\n| `-v`, `--verbose`     | Show verbose output                                                                               |\n| `-a`, `--auto`        | If a PR already exists for the current branch, open it instead of creating a new one              |\n| `-d`, `--draft`       | Create the PR as a draft                                                                          |\n| `-D`, `--dryrun`      | Print the command without executing it                                                            |\n| `-h`, `--help`        | Show help                                                                                         |\n| `--` `GH_OPTS`        | Pass remaining args to `gh pr create` (e.g. `--web`, `--reviewer`)                                |\n\n---\n\n## examples\n\n```bash\n# interactively pick a base branch and create a PR\ngh new\n\n# create a PR and open it in the browser\ngh new --open\n\n# create a PR and add labels\ngh new --open --label 'bug' --label 'enhancement,documentation'\ngh new --open --label 'bug,enhancement'\n\n# open the browser form to create a PR (gh native web mode)\ngh new -- --web\n\n# create a PR with reviewers\ngh new -- --reviewer USER1,USER2\n\n# create a draft PR\ngh new --draft\n\n# if a PR already exists for the current branch, open it\ngh new --auto\n\n# dry-run to inspect the gh command before running\ngh new --dryrun\n```\n\n## fzf Key Bindings (inside the base branch picker)\n\n| KEY      | ACTION                                                 |\n|----------|--------------------------------------------------------|\n| `ctrl-o` | Toggle between summary and full diff preview           |\n| `ctrl-/` | Cycle preview window position (right → top → hidden)   |\n| `ctrl-y` | Copy the base branch's latest commit hash to clipboard |\n\n---\n\n## workflow\n\n```\ngh new\n  ↓\nauto-push current branch if not pushed or behind remote\n  ↓\nfzf: pick base branch (sorted by most recent commit, with git show preview)\n  ↓\ngh pr create --base \u003cselected\u003e --head \u003ccurrent\u003e --title \u003clast commit\u003e --body \u003clast commit body\u003e\n  ↓\nadd labels (skip 'auto-merge' if already applied, warn if label not found)\n  ↓\nopen PR in browser (if --open)\n```\n\n---\n\n## configuration\n\n| VARIABLE                   | PURPOSE                                              |\n|----------------------------|------------------------------------------------------|\n| `FZF_DEFAULT_OPTS`         | Global fzf options (colours, layout, keybindings, …) |\n| `BASH_COMPLETION_USER_DIR` | Where `--setup` installs the completion script       |\n\n---\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarslo%2Fgh-new","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarslo%2Fgh-new","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarslo%2Fgh-new/lists"}