01
Per-command proxy
Prefix any command with `hamta` to route it through your proxy. No need to export variables globally or pollute your shell session.
Bash proxy wrapper for the terminal
hamta wraps one-off commands in a proxy environment. Loads a JSON config, exports the usual proxy variables, optionally verifies the exit country, then runs your command. No shell hacks, no global state.
Features
01
Prefix any command with `hamta` to route it through your proxy. No need to export variables globally or pollute your shell session.
02
Choose `env` mode for apps that honor HTTP_PROXY / HTTPS_PROXY / ALL_PROXY, or `proxychains` mode for TCP CLIs that ignore env vars.
03
Optionally check your public IP country via ipinfo.io before running the command, so you know you are actually exiting where you expect.
Workflow
`brew install andrewmmc/tap/hamta` pulls hamta and its runtime dependencies, jq and curl.
Run `hamta init` to scaffold ~/.config/hamta/config.json, then set your proxy URL, mode, and expected exit country.
`hamta curl https://ipinfo.io`, `hamta npm install react`, `hamta opencode`, `hamta bash` — anything you want routed through the proxy.
Design
hamta does one thing well: route a single command through your proxy. The whole tool is a short script you can read in one sitting, with a plain JSON config you can edit in any text editor. No daemons, no background services, no surprises.
What hamta optimizes for
Install
hamta is open source and installs in one command. Homebrew handles the runtime dependencies for you.
Homebrew
Install hamta and its runtime dependencies in one command.
brew install andrewmmc/tap/hamta brew upgrade hamtaFAQ
Running one-off commands through a proxy without polluting your shell environment. Useful for coding agents, package managers, CLIs, or any tool you want routed through a specific exit IP for a single invocation.
hamta scopes the proxy environment to a single command, optionally verifies the exit country first, supports proxychains mode for apps that ignore env vars, and clears conflicting proxy variables before invoking proxychains4.
`env` mode exports HTTP_PROXY / HTTPS_PROXY / ALL_PROXY / npm proxy vars and execs the command directly. `proxychains` mode runs the command via proxychains4 with a generated config — useful for TCP CLIs that ignore proxy environment variables.
`http://`, `socks4://`, `socks5://`, and `socks5h://`. In proxychains mode, `socks5h://` is written as a SOCKS5 proxy and DNS leak protection comes from `proxy_dns`.
In `env` mode, no — it can only set proxy environment variables. In `proxychains` mode, hamta enables `proxy_dns` to proxy DNS resolution for intercepted hostname lookups, which reduces DNS leaks for many TCP apps but is not a system-wide guarantee.
`jq` and `curl` are required. `proxychains-ng` is only required if you use `proxy.mode = "proxychains"`. Homebrew installs jq and curl automatically.
hamta is open source. See the LICENSE file in the GitHub repository for details.
One command to install. One prefix to route any tool through your proxy. No shell hacks, no global state.