Session Control
proxy on / proxy off / proxy env
Commands that change your current shell (on, off, use, switch, best)
must go through the proxy shell function installed by
shell integration. Everything else works with the full
binary name as well.
Session Control
proxy on / proxy off / proxy env
Profiles & TUI
proxy switch / proxy use / proxy dash
Measurement
proxy benchmark / proxy best / proxy speedtest
Diagnostics
proxy status / proxy diagnose / proxy monitor
Accepted by every subcommand, before or after it.
| Option | Environment variable | Purpose |
|---|---|---|
--config-file <PATH> | TSPM_CONFIG | Use a specific config.json |
--settings-file <PATH> | TSPM_SETTINGS | Use a specific settings.json |
--lang <ru|en> | TSPM_LANG | Interface language for this run only |
-h, --help | Help for the command | |
-V, --version | Version |
NO_COLOR (set to any non-empty value) disables coloured output.
# Keep work and personal proxies in separate filesTSPM_CONFIG=~/work-proxies.json proxy besttspm --config-file ~/work-proxies.json profile liston, off, env)proxy on # Export proxy variables into this shellproxy off # Unset themtspm env on # Print the statements without applying themproxy on is shorthand for evaluating the output of env on. Both set every
variable in both letter cases (http_proxy and HTTP_PROXY, and so on) plus
GRADLE_OPTS and JAVA_TOOL_OPTIONS, because different tools read different
names. off unsets exactly the same set.
Values are POSIX-quoted, so a host containing shell syntax is inert.
status)proxy status # Proxy state, IPv4, IPv6, and locationproxy status --json # The same, machine-readableThe JSON form is stable enough to script against:
proxy status --json | jq -r .ipv4profile, use, switch)proxy profile list # Every profile, with the active one markedproxy switch # Interactive arrow-key pickerproxy use work # Switch by key
proxy profile set work \ --name "Work SOCKS" \ --host 127.0.0.1 \ --port 1080 \ --protocol socks5 # Create or update, then make it active
proxy profile remove work # Deleteprofile set saves the profile as active but does not touch the variables of
the shell you are in. With the proxy on, run proxy use work (or proxy on)
afterwards to apply it.
--protocol accepts http, https, socks4, socks4a, socks5, socks5h.
Omitted fields keep their current value on an existing profile.
Profiles are validated before being saved: the host must be a plausible hostname or IP, the port must be non-zero, and the protocol must be supported. An unknown profile key exits non-zero, so this works as expected:
proxy use work || proxy bestproxy import ./proxies.jsonproxy import https://example.com/subscription.txtFour input shapes are recognised: a full config.json, a bare map of profile
key to profile, an array of profiles, or a newline-separated list of proxy URLs
(socks5://host:port, # comments allowed). Invalid entries are reported and
skipped; the rest still import.
benchmark, best, ping, speedtest)proxy benchmark # Latency and availability of every profileproxy best # Benchmark, then switch to the fastestproxy ping # Latency to the endpoints in config.jsonproxy ping --timeout 2000 # With a 2 s timeoutproxy speedtest # Real download throughputbenchmark tests the profiles one after another, probing all ping targets of
each profile at once. Unreachable profiles sort last and are shown as a timeout
rather than a number.
dash)proxy dash| Key | Action |
|---|---|
↑ ↓ / k j | Move the selection |
Space | Make a profile active without leaving (saved; the shell is not updated) |
Enter | Apply the profile and exit, updating the shell |
b | Switch to the fastest profile |
i | Import from a URL or file |
e | Open config.json in $VISUAL / $EDITOR |
s | Benchmark everything and sort by latency |
1 2 | Profiles tab / config tab |
q, Esc | Quit |
For Enter to update your shell you need the proxy_dash function from the
shell integration; run proxy dash, not the bare binary.
diagnose, monitor)proxy diagnose # Local socket, session variables, and endpoint reachabilityproxy monitor # Health check; picks the fastest reachable profile on failuremonitor probes health_check_url from config.json through the proxy that is
currently in your environment — ALL_PROXY, all_proxy or http_proxy. If the
check fails, or none of those is set, it benchmarks the profiles and saves the
fastest reachable one as active. It does not change the shell you run it in:
apply the new profile there with proxy on, or run proxy on in a new shell.
diagnose lists http_proxy, https_proxy, ALL_PROXY and GRADLE_OPTS from
your session. For the complete set that proxy on exports, run
env | grep -i proxy.
run)proxy run curl https://example.comproxy run -- curl -sS https://example.comproxy run npm installRuns a single command with the proxy variables applied, leaving your shell
untouched. The child’s exit code is propagated, so proxy run ... && next-step
behaves as expected. Flags are passed through; -- is optional but harmless.
git)proxy git status # Show the current global git proxyproxy git on # Point git at the active profileproxy git off # Remove itexport)proxy export envfile > .envproxy export docker # --build-arg flagsproxy export curl # -x flagExits non-zero when no profile is active, so a redirect cannot silently produce an empty file.
config, settings, lang)proxy config path # Which config.json is in useproxy config show # Print itproxy settings pathproxy settings showproxy settings set --config-path ~/proxies.jsonproxy lang en # Persist the interface languageinit, completions, prompt, debug)tspm init zsh # Integration scripttspm completions zsh # Completions onlyproxy prompt # Prompt indicatorproxy debug on # Log the shell hand-offcompletions supports zsh, bash, fish and powershell. init already
includes completions, so you only need one of the two.
Turn debug on when proxy dash fails to update your shell; it logs the
hand-off to ~/.tspm-debug.log.