zigfetch

Fetch zig packages, utilizing libcurl.

zigfetch behaves similarly to zig fetch, utilizing the capabilities of libcurl for its functionality.

Since the HTTP support within Zig's standard library isn't currently stable, this proxy issue make it even harder, resulting in multiple errors occurring during dependency downloads when building Zig projects.

This poses a significant challenge for Chinese developers owing to the Great Firewall.

As a consequence, zigfetch was developed; this tool operates via libcurl to ensure that both the http_proxy and https_proxy environment variables function correctly.

1
./zig-out/bin/zigfetch --help
 USAGE:
     ./zig-out/bin/zigfetch [OPTIONS] [--] [package-dir or url]

 OPTIONS:
  -h, --help                       Show help
  -V, --version                    Show version
  -v, --verbose                    Show verbose log
  -t, --timeout INTEGER            Libcurl http timeout in seconds(default: 60)
  -n, --no-dep                     Disable fetch dependencies
  -d, --debug-hash                 Print hash for each file

This is a demo for socks5 proxy setup:

1
2
3
4
export http_proxy="socks5://127.0.0.1:1080"
export https_proxy=$http_proxy
export all_proxy=$http_proxy
export GIT_SSH_COMMAND='ssh -o ProxyCommand="nc -X 5 -x 127.0.0.1:1080 %h %p"'

GIT_SSH_COMMAND is used for fetch git+http(s) dependencies.

Last modified January 4, 2025: update docs (04296e3)