Scripting with GitHub CLI
GitHub CLI (`gh`) can be extended and scripted by combining it with standard Unix tools. Aliases shorten common commands, PAGER settings route output through `less` or `delta`, and `fzf` plus `cut` turn `gh pr list` into an interactive PR checkout. When output is piped, `gh` emits tab-delimited, untruncated, uncolored text for scripts, and it comes pre-installed in GitHub Actions for tasks like enabling auto-merge or creating releases. `gh api` handles REST and GraphQL calls with auth, pagination, caching and built-in jq filtering, demonstrated by dynamically building a search for issues involving members of a team.
Related posts
- Migration Automation: Easing the Jenkins → GHA shift with help from AI
Slack Engineering mediumAdeptSlack built a conversion tool to move 242 Jenkins pipelines to GitHub Actions by layering corrections on top of GitHub's Actions Importer, which fully converted about 50% of pipelines, partially converted 45% and failed on 5%. Eight unsupported Jenkins steps caused over 90% of the partial conversions. A largely regex/string-replace Python pass swaps rate-limited marketplace actions for internal GitHub Enterprise mirrors, adds guidance comments (e.g. for secrets) and strips noise. LLM prompts handle the action-to-action rewrites that string methods can't, such as replacing rtCamp/action-slack-notify with Slack's internal action, and were 100% accurate across about two dozen spot-checked outputs. The tool is projected to cut migration effort from about 1,700 to about 360 hours.
- How the GitHub CLI can now enable triangular workflows
GitHub Engineering mediumAdeptGitHub CLI v2.71.2 makes `gh pr` commands resolve a branch's push and pull targets the same way Git does, so triangular workflows work. In a triangular workflow a branch pulls from one ref, such as upstream's default branch, and pushes to another, such as the same-named branch on a fork. The post shows how to set this up in `.git/config` with a branch's `merge` key, the per-branch `pushremote` key, or the repo-wide `remote.pushDefault`, and notes that `pushremote` overrides `remote.pushDefault`. To find a pull request's headRef, the CLI checks `@{push}` first, then `pushremote`, then `remote.pushDefault`, and it treats the branch's pullRef as the PR's baseRef, so if `git push` and `git pull` are configured correctly, `gh pr` should just work.
- How AI Assistants Can Decode GitHub Repos for UI Writers
Docker mediumAdeptAn LLM agent can reliably flag user-facing copy changes in a branch when it is given narrow tools and expert hints about what "user-facing" means. GitHub Copilot's repo chat could not even count open PRs. A first prompt that gave the model bash and raw git diff also failed: diffs were huge, important files were buried and extra tools invited hallucination. The working two-step flow first lists only likely UI files (using --files-only and --no-pager with an alpine/git container) and saves the list. It then diffs just those files against main with --no-color --minimal, guided by frontend-engineer hints about JSX text nodes, notifications, toasts and Error constructors. This produced an accurate list of copy changes on a real Docker PR.
- How to Build GitHub Copilot Extensions
Neon mediumAdept
GitHub Copilot extensions are plain HTTP servers that GitHub calls whenever a user mentions the extension in Copilot Chat, so they can be written in any language. The walkthrough builds a Python FastAPI server whose POST /completion endpoint injects a system prompt, forwards the conversation to the Copilot chat completions API using the x-github-token header, and streams the response back as server-sent events. Registration means creating a GitHub App with read-only Copilot Chat and Editor Context permissions, setting its Copilot app type to Agent, and exposing the local server through an ngrok tunnel. Production extensions such as Neon's also need RAG, function calling and analytics, which the post pitches Layer's platform to handle.
- Continuous AI for accessibility: How GitHub transforms feedback into inclusion
GitHub Engineering mediumAdeptGitHub built an event-driven accessibility feedback pipeline on GitHub Actions, Copilot and the GitHub Models API that turns every user report into a tracked, prioritized issue. Issue creation triggers Copilot analysis that uses stored, PR-editable prompt files instead of fine-tuning. The analysis fills about 80% of 40+ metadata fields and suggests WCAG criteria, severity, affected user groups, team assignment and a reproduction checklist. A second Action parses Copilot's comment to apply labels and board status. Humans verify at each stage, and their corrections are logged to refine the prompts. About 75–80% of reports match existing audit findings and get reprioritized by real-world impact, and issues close only once the user confirms the fix works.