You are looking at a line in your editor and want to send a colleague a link to it. Copying the repository URL and clicking through folders takes a minute. gh browse takes a second.
Inside the repository, give it a path, with a line number if you like:
gh browse src/app.py:42
gh browse main.go:312 --blame
gh browse 123
The first opens the file at line 42 on the default branch. --blame opens the blame view for that line. A plain number opens that issue or pull request.
The flags for the common pages save even more clicking: --settings, --releases, --actions, --wiki and --projects. -b picks a branch and -c a commit.
The one I’d remember is -n. It prints the URL instead of opening a browser, so it works over SSH and can go straight to the clipboard:
gh browse src/app.py:42 -n | pbcopy
Line links point at the branch, not a fixed commit, so the line can move when someone edits the file. For a link that has to stay correct, add -c to tie it to the last commit. And the path is relative to the repository root, not to the folder you are in.
Further reading: gh browse (GitHub CLI manual)
Going deeper: Moving on from hdtv: how to export your TV show list to Trakt.tv