cli: `gh` Command not Being Registered
Whenever I try to run the gh command, Command Prompt says it doesn’t recognise it as a command. PowerShell exibits the same behaviour. (Adding an environment variable named gh and setting the path to C:\Program Files (x86)\GitHub CLI\gh.exe allows PowerShell to use it, but I want to use Command Prompt)
How can I manually register gh as a command? (I also would want to know this so I can set up another tool (charmbracelet/glow) so I could use that too)
Version Information
| Software | Version |
|---|---|
| GitHub CLI | 1.1.0 |
| Windows | 6.1 (Build 7601) (Windows 7 SP1) |
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 24 (7 by maintainers)
The
ghcommand doesn’t work on powershell or cmd. I installed using thechoco install ghand I addedC:\Program Files (x86)\GitHub CLImanually to path.Yes I hv restarted the shell and everything. I am on Windows 10 Pro
yea I removed it and installed it again somehow it works lol 😂
sometimes you just gotta do it again with software 😅
I am having the same issue. I just installed the GitHub CLI with the
gh_1.4.0_windows_amd64.msiinstaller. I manually addedC:\Program Files (x86)\GitHub CLI\to myPATHand still no dice. It does work when I use the full file path, just like this:I’m running Windows 10 Pro x64. I don’t have the option of reinstalling Windows as it’s a work machine.
(I also tried amending the install path, but the installer wouldn’t play ball).
The experience is okay with me! I run into issues all the time, my computer specifically is configured a bit weird so I usually just have to work a bit harder to get things working.
gh.exedoes work by typing in the full command. So instead ofgh auth login, I do"C:\Program Files (x86)\GitHub CLI\gh.exe" auth login. It does work, but it’s just terribly inconvenient.I’m just going to stick with Git to clone repos for now until I can get this working again. For everything else that I need the GH CLI for, I guess I’ll just type
gh.exe’s file path.I’m actually just doing a reinstall of Windows due to graphics driver problems; so I’ll see if that can help. 😃
For people who haven’t tried it, use the age old “log out and log back in” 😃 Worked for me.