socks-cli is a solution to make CLI commands use the specified socks5 proxy, by setting up special environment variables, such as
ALL_PROXY. It works on linux and macOS with bash and python installed.
Here is an incomplete list of supported commands:
Clone the code.
socksproxyenv, and fill your socks5 server into it.
source socks-cli/activatebefore your CLI commands:
$ source socks-cli/activate Serving HTTP proxy on 127.0.0.1 port 54967 ... Done! Some environment variables have been changed to: GIT_PROXY_COMMAND=/Users/x/socks-git/sh/socksified-connect.sh GIT_SSH=/Users/x/socks-git/sh/socksified-ssh.sh ALL_PROXY=socks5h://127.0.0.1:1080 HTTP_PROXY=http://127.0.0.1:54967 HTTPS_PROXY=http://127.0.0.1:54967 $ git clone firstname.lastname@example.org:git/git.git Cloning into 'git'... remote: Counting objects: 213208, done. remote: Compressing objects: 100% (372/372), done. Receiving objects 2.0% (1/213208), 620.00 KiB | 121.00 KiB/s ...
Optionally, you can call
source socks-cli/deactivateto deactivate
For more details, please see socksproxyenv.sample.