pctl is a command-line tool for viewing and changing macOS system proxy settings.
From the repository root, use Go 1.27 or later:
go build -o pctl ../pctl status
./pctl set 127.0.0.1:7890
./pctl set -f --service "Wi-Fi" 127.0.0.1:7890
./pctl noproxy
./pctl noproxy --allstatusshows the effective macOS proxy settings and the saved settings for the primary network service. Use--service NAMEto inspect a specific service.set HOST:PORTenables HTTP, HTTPS, and SOCKS on the same endpoint and turns off PAC and automatic proxy discovery. Pass-fto replace an existing enabled configuration that differs from the requested settings. An exact match succeeds without writing changes.noproxydisables HTTP, HTTPS, SOCKS, PAC, and automatic proxy discovery. It preserves saved endpoints, PAC URLs, and bypass rules. Use--allto disable those modes across all configured network services in the current network location.
By default, write commands target the primary network service. If macOS reports different primary services for IPv4 and IPv6, or a single primary service cannot be resolved, pass --service NAME. Place flags before the endpoint when using set. Supply the endpoint explicitly and put IPv6 addresses in brackets, for example '[::1]:7890'. Changing settings can require administrator privileges.
Start the proxy server separately. pctl configures macOS to use the endpoint you provide.