A Rust CLI tool for managing proxy configurations.
- Enable/disable proxy settings
- Automatic detection of best regional proxy
- SSH configuration management for proxy hosts
- Shell integration for bash, zsh, and other shells
- Environment-based configuration for custom deployments
Download the latest release from GitHub Releases for your platform and add it to your PATH.
curl -fsSL https://raw.githubusercontent.com/adrianmross/proxyctl-rs/main/install.sh | bash-
Clone the repository:
git clone https://github.com/adrianmross/proxyctl-rs.git cd proxyctl-rs -
Build the project:
cargo build --release
-
Install the binary:
sudo cp target/release/proxyctl-rs /usr/local/bin/
# Enable proxy and add SSH hosts (auto-detects if no URL provided)
proxyctl-rs on
# Enable proxy with specific URL and add SSH hosts
proxyctl-rs on --proxy http://proxy.example.com:8080
# Disable proxy and remove SSH hosts
proxyctl-rs off
# Enable proxy only (without touching SSH)
proxyctl-rs proxy on
# Disable proxy only (without touching SSH)
proxyctl-rs proxy off
# Detect best regional proxy
proxyctl-rs detect
# Add SSH proxy hosts (uses ~/.config/proxyctl-rs/hosts.txt by default)
proxyctl-rs ssh add
# Add SSH proxy hosts from custom file
proxyctl-rs ssh add --hosts-file /path/to/custom/hosts.txt
# Remove SSH proxy hosts
proxyctl-rs ssh remove
# Show combined status
proxyctl-rs status
# Show only proxy status
proxyctl-rs status proxy
# Show only SSH status
proxyctl-rs status ssh
# Run diagnostic checks
proxyctl-rs doctor run
# Inspect configuration values
proxyctl-rs doctor configThe tool automatically integrates with your shell by modifying your shell profile (.zshenv, .bash_profile, etc.).
You can target a shell specifically:
# Detects shell automatically, but you can override
export SHELL=/bin/bash
proxyctl-rs onProxy entries in managed profiles are wrapped with:
### MANAGED BY PROXYCTL-RS START (DO NOT EDIT)
export http_proxy="..."
...
### MANAGED BY PROXYCTL-RS END (DO NOT EDIT)proxyctl-rs uses a configuration directory at ~/.config/proxyctl-rs/ (or equivalent on Windows/macOS) to store settings.
config.toml: Main configuration file in TOML formathosts.txt: List of proxy hosts for SSH configuration
# Default hosts file name (relative to config dir)
default_hosts_file = "hosts"
# Custom no_proxy domains (overrides defaults completely)
# Can be an array or comma-delimited string
no_proxy = ["example.com", "internal.domain"]
# Enable/disable WPAD proxy discovery
enable_wpad_discovery = true
# Custom WPAD URL (optional, defaults to generic WPAD)
wpad_url = "http://wpad.local/wpad.dat"
[proxy_settings]
# Enable/disable specific proxy environment variables
enable_http_proxy = true
enable_https_proxy = true
enable_ftp_proxy = true
enable_no_proxy = true
[shell_integration]
# autodetect the shell from $SHELL
detect_shell = true
# fallback when detection is disabled or missing
default_shell = "bash"
# manage additional shell profiles explicitly
shells = ["bash", "zsh"]
# optional paths to update
profile_paths = ["~/.bash_profile", "~/.zshenv"]# Proxy hosts for SSH configuration
internal.server1
internal.server2
dev.example.com
The tool modifies ~/.ssh/config to add proxy commands for configured hosts.
This project includes a dev container for VS Code. Open in VS Code and use "Dev Containers: Reopen in Container" to get started.
cargo buildcargo testcargo run -- <args>You can override default values using environment variables for testing the detection features without any custom configuration. Create a .env file in the project root based on the provided .env.example:
# Default domains to exclude from proxy (comma-separated)
DEFAULT_NO_PROXY=localhost,127.0.0.1,.local
# Default WPAD URL for proxy discovery
DEFAULT_WPAD_URL=http://wpad.company.com/wpad.datThis project uses semantic versioning. To create a new release:
./scripts/release.sh 1.2.3- Update the version in
Cargo.toml - Create a git tag:
git tag v1.2.3 - Push the tag:
git push origin v1.2.3
GitHub Actions will automatically:
- Build binaries for multiple platforms (Linux, macOS, Windows)
- Create a GitHub release with the binaries
- Publish to crates.io (requires
CRATES_IO_TOKENsecret to be set in repository settings)
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
MIT