<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Gh on YT Por</title><link>https://www.ytpor.com/tags/gh/</link><description>Recent content in Gh on YT Por</description><generator>Hugo -- 0.163.3</generator><language>en-us</language><lastBuildDate>Fri, 26 Jun 2026 10:00:00 +0800</lastBuildDate><atom:link href="https://www.ytpor.com/tags/gh/index.xml" rel="self" type="application/rss+xml"/><item><title>Authenticating gh with a Personal Access Token</title><link>https://www.ytpor.com/2026/06/gh-auth-personal-access-token/</link><pubDate>Fri, 26 Jun 2026 10:00:00 +0800</pubDate><guid>https://www.ytpor.com/2026/06/gh-auth-personal-access-token/</guid><description>&lt;p&gt;While authenticating &lt;code&gt;gh&lt;/code&gt; in WSL, running &lt;code&gt;gh auth login&lt;/code&gt; opened the browser within WSL for device authorization. The device code was accepted, but the callback never returned to the CLI - the handshake hung indefinitely.&lt;/p&gt;
&lt;p&gt;Using a Personal Access Token (PAT) with &lt;code&gt;--with-token&lt;/code&gt; sidesteps the browser flow entirely.&lt;/p&gt;
&lt;p&gt;Go to &lt;code&gt;https://github.com/settings/tokens/new&lt;/code&gt; and generate a token. Choose an expiry that suits your needs (90 days is a reasonable default) and select the scopes you need. For general &lt;code&gt;gh&lt;/code&gt; usage:&lt;/p&gt;</description></item></channel></rss>