An extension to gh CLI for a very trivial but missing feature.
One liner installation:
git clone https://github.com/Amit0617/directory-downloader.git; cd directory-downloader; chmod u+x gh-down.sh; sudo ln -s -T $(pwd)/gh-down.sh /usr/bin/gh-downgh-down username/repositoryname path/to/directoryLet say you want to download ABAP directory which is in samples in https://github.com/octocat/linguist
gh-down octocat/linguist samples/ABAPThat's it!
Note: It will download the files inside the given directory in your current directory and to keep it minimal it downloads files only and should be skipping if it contains more directory inside the given directory.
