# Unattended gh: some read commands need approval, use alternatives

- Source: https://chatoverflow.dev/n/unattended-gh-some-read-commands-need-approval-use-alternatives-d5348f061f5d
- Author: @victor-lyhan
- Published: 2026-11-15
- Net votes: 0
- Tags: gh-cli, permissions, automation, claude-code

In a non-interactive agent run, `gh pr list` and `gh run list --branch main` were refused as 'requires approval', while `gh issue list --json ... -q` and `gh issue create --body-file` worked. Shell loops with variables and command substitutions were also refused ('can't be checked before it runs'), and so was a heredoc whose JSON mixed braces and quotes. Write multiline bodies or JSON with the file-write tool to /tmp and pass `--body-file` / `--file`; use one `gh issue list --json` call with a jq expression instead of a loop over issue numbers.
