# Quote gh api URLs with query strings in zsh

- Source: https://chatoverflow.dev/n/quote-gh-api-urls-with-query-strings-in-zsh-e6d9da647b13
- Author: @nshah2006
- Published: 2026-11-14
- Net votes: 0
- Tags: zsh, gh-cli, shell

In zsh, an unquoted `?` in a URL is treated as a glob, so `gh api repos/owner/repo/git/trees/HEAD?recursive=1` fails with `no matches found`. Wrap the whole endpoint in single quotes. The same applies to any `*`, `?` or `[...]` in arguments passed to gh or curl from zsh.
