English | 中文
proxy-sw is a macOS-first CLI for managing terminal proxy environment variables for local proxy tools like Clash.
Version 1 now focuses on shell proxy environment management with automatic no_proxy generation.
- Manages shell
http_proxy,https_proxy,all_proxy, andno_proxy - Automatically detects local private networks and adds them to
no_proxy - Stores defaults in
~/.config/proxy-sw/config.yaml - Ships as a single Go binary
- Designed for Homebrew tap installation
- Keeps macOS system proxy support under
proxy-sw system ...for advanced use, including syncing generatedno_proxyvalues to macOS proxy bypass domains onsystem on
Out of scope for v1:
- Starting or checking Clash itself
- Linux or Windows proxy management
- Tool-specific proxy config for git, npm, pip, and similar tools
brew tap kelaocai/tap
brew install proxy-swWhen upgrading from an older installed version, run:
brew update
brew upgrade proxy-swAfter install, proxy-sw reads and writes its default config at:
~/.config/proxy-sw/config.yaml
Until the first tagged release is published, build locally:
git clone https://github.com/kelaocai/proxy-sw.git
cd proxy-sw
make buildFor a local user-style install without Homebrew:
make install-local
export PATH="$HOME/.local/bin:$PATH"
proxy-sw --helpproxy-sw set --host 127.0.0.1 --port 7897
proxy-sw on
proxy-sw detect
proxy-sw doctor
proxy-sw status
proxy-sw offFor most users, this is the full setup flow:
proxy-sw set --host 127.0.0.1 --port 7897
proxy-sw on
proxy-sw detect
proxy-sw doctorThis saves your proxy defaults to ~/.config/proxy-sw/config.yaml, and proxy-sw on writes the managed proxy block into your shell config file such as ~/.zshrc.
Turn it off later with:
proxy-sw offAdvanced usage:
onautomatically regeneratesno_proxyfrom current local private networksset --no-proxy-add a,badds customno_proxyentriesset --no-proxy-clear-customclears customno_proxyentriesproxy-sw system on|off|statusmanages macOS system proxy when you explicitly need it, andsystem onsyncs the generatedno_proxylist into macOS proxy bypass domainsproxy-sw system statusshows the current macOS bypass domain list asbypassproxy-sw listandproxy-sw use "Wi-Fi"are only needed forproxy-sw system ...
Default config path used by set, on, status, detect, doctor, and system:
~/.config/proxy-sw/config.yaml
Example:
host: 127.0.0.1
port: 7897
shell_type: zsh
no_proxy_custom:
- internal.example.com
- "*.corp.local"
network_service: Wi-Fi- Tag a release like
v0.1.0 - GitHub Actions builds macOS arm64 and amd64 archives
- The release workflow publishes assets to GitHub Releases
- The tap sync workflow updates
packaging/homebrew/proxy-sw.rbinto the tap repo