TornaxO7
TornaxO7

Reputation: 1309

Download file from github in CLI?

I'm trying to download the tokyo-night-storm.yaml colorscheme file from zellij. I thought that I just could do

wget https://github.com/zellij-org/zellij/blob/main/example/themes/tokyo-night-storm.yaml

but I got the webpage instead of the theme-file. How can I retrieve the just the actual file and not the webpage?

Upvotes: 0

Views: 1676

Answers (3)

lord-skinner
lord-skinner

Reputation: 1

If you want to download files via gh cli without having to have the raw link on hand:

curl -L $(gh api /repos/<owner>/<repo>/contents/<file> --jq .download_url) > <output_file>

Upvotes: 0

Daweo
Daweo

Reputation: 36873

Replace /blob/ in URL using /raw/ that is do

wget https://github.com/zellij-org/zellij/raw/main/example/themes/tokyo-night-storm.yaml

Upvotes: 2

IamK
IamK

Reputation: 2994

You have to click the

enter image description here

raw button, and copy that link (direct link).

wget https://raw.githubusercontent.com/zellij-org/zellij/main/example/themes/tokyo-night-storm.yaml

Upvotes: 1

Related Questions