Hands-on review: gh 2.86.0. Public issue reads and JSON filtering, checked October 7, 2026.
Watch the GitHub CLI example
Made with Explainroo from an actual read-only run. The terminal is animated; this is not a live recording of an agent.
Read the video transcript
Your coding agent can read GitHub through a terminal. Give it GitHub CLI and a clear task. Start with the command's help. It tells the agent which flags and output fields are available. Name the repository and limit the result. Ask for issue numbers and states as structured output. This read command returned an open issue in our directory repository. The terminal here is rebuilt from that run. Use a filter when the next step only needs the issue number. The same command works in your own scripts. Give the agent a read task first. Review the command before it posts comments or changes a pull request. Find a command-line tool for the service you use.
GitHub CLI gives a coding agent commands for issues, pull requests and Actions runs. If the agent already has a shell, it's a useful place to start for GitHub work.
We tried the issue-reading command in gh 2.86.0 on October 7, 2026. We named a public repository, asked for JSON and filtered the result. This review covers that read-only task. We didn't run an end-to-end agent benchmark or test write commands.
Install and check the command
Follow the official installation instructions for your operating system. Then check the installed version:
gh --version
If you haven't connected GitHub CLI to your account, use its login command:
gh auth login
The authentication documentation explains the browser flow and token options. Follow the account's permissions when choosing credentials. Don't paste a token into an agent prompt. Our test used an existing authenticated installation.
gh is GitHub CLI. GitHub Copilot CLI is a different tool; it isn't needed for the commands here.
Read a few issues from a named repository
First look up the available flags:
gh issue list --help
Then read up to three issues:
gh issue list \
--repo vincentsch/awesome-ai-cli \
--limit 3 \
--json number,state
Our run returned this JSON and exited with status 0:
[{"number":1,"state":"OPEN"}]
The result is from our public directory repository at the time of the run. Its issues can change. No issue or comment was changed by this command.
--repo matters because an agent can run a command from another working directory. Naming the repository avoids relying on the current checkout. --limit bounds the number of issues; the documented default is 30. gh issue list lists open issues by default. Add --state closed or --state all when that is the task.
The issue list reference lists the filters and JSON fields. This command's JSON is an array. An empty [] means no issues matched this request; it isn't an error by itself. Check the exit status before using the result.
Filter the result for a script
If the next step needs only the issue number, ask for that field:
gh issue list \
--repo vincentsch/awesome-ai-cli \
--limit 3 \
--json number,state \
--jq '.[].number'
Our run printed:
1
The filter runs on the JSON result. The formatting reference explains --jq; you don't need a separate jq installation for this flag.
That makes a useful building block for a script. You can use the same command from a terminal, a project task or an agent's shell. The JSON scripting guide covers checking output before passing values to another command.
Give the agent the task
You can copy this prompt into an agent that has shell access:
Use gh to read up to 3 open issues in
vincentsch/awesome-ai-cli.
Check gh issue list --help. Return the numbers and states.
If the command fails, report the error and stop.
Ask before posting comments or changing anything.
This is an example prompt, not a transcript of an agent run. The video above reconstructs the terminal commands we executed.
What worked and what this test doesn't cover
The repository flag, field selection and jq filter worked in the installed version we tested. The output was short and usable without scraping a terminal table. The help command described the available options.
This test doesn't establish how well an agent handles a large repository, pagination or failed authentication. We also didn't test writing comments, creating issues or merging pull requests.
Those are separate commands that change GitHub. Don't assume they have a dry run because another CLI does. Review the intended target and command before approving them.
If your agent client has no shell, a GitHub MCP connection may be more practical. For an agent that can run commands, we'd start with gh and a read task like this one. The CLI-first article explains why.