- Go to the release page of cli/cli, and get the compatible build for Perlmutter. The latest version as of July 1, 2024 is GitHub CLI 2.52.0 linux amd64
- Untar the file, and move the single binary executable
gh
to path which is included in the list of the envPATH
, or add the path to it in your$HOME/.bashrc.ext
; - Similarly, move the
share/man
subdiretory into a place already pointed to by the envMANPATH
, or the new path to$HOME/.bashrc.ext
; - Add bash (or other shell) completion by adding
eval "$(gh completion -s bash)"
into$HOME/.bashrc.ext
. After opening a new terminal, you would be able to test the installation withwhich gh
,man gh
and use thetab
key for sub-command completion (tab once to auto complete the command, tab twice to list all possible completions).
My additions to $HOME/.bashrc
look like:
export PATH=$HOME/bin:$PATH
export MANPATH="$(manpath -g):$HOME/.local/share/man"
eval "$(gh completion -s bash)"
Create a GitHub Personal Access Token, and give it proper scopes and expiration date. Save the token in a secure place. On a Perlmutter login node, run
gh auth login
and follow the prompt to choose "GitHub.com" --> "HTTPS" --> "Paste an authentication token".
# Relevant sub-commands
$ gh gist
clone (Clone a gist locally)
delete (Delete a gist)
list (List your gists)
view (View a gist)
create (Create a new gist)
edit (Edit one of your gists)
rename (Rename a file in a gist)
$ gh gist list
# publish file 'hello.py' as a public gist
$ gh gist create --public hello.py
# create a gist with a description
$ gh gist create hello.py -d "my Hello-World program in Python"
# create a gist containing several files
$ gh gist create hello.py world.py cool.txt
# read from standard input to create a gist
$ gh gist create -
# create a gist from output piped from another command
$ cat cool.txt | gh gist create
# Relevant sub-commands
$ gh workflow
disable (Disable a workflow)
list (List workflows)
view (View the summary of a workflow)
enable (Enable a workflow)
run (Run a workflow by creating a workflow_dispatch event)