Bash proxy wrapper for the terminal

Run any command through your proxy.

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

One command. Scoped proxy. Verified exit.

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.

02

env or proxychains mode

Choose `env` mode for apps that honor HTTP_PROXY / HTTPS_PROXY / ALL_PROXY, or `proxychains` mode for TCP CLIs that ignore env vars.

03

Exit-country verification

Optionally check your public IP country via ipinfo.io before running the command, so you know you are actually exiting where you expect.

Workflow

From install to first proxied command in a minute.

Step 1

Install with Homebrew

`brew install andrewmmc/tap/hamta` pulls hamta and its runtime dependencies, jq and curl.

Step 2

Create your config

Run `hamta init` to scaffold ~/.config/hamta/config.json, then set your proxy URL, mode, and expected exit country.

Step 3

Prefix any command

`hamta curl https://ipinfo.io`, `hamta npm install react`, `hamta opencode`, `hamta bash` — anything you want routed through the proxy.

Design

Small, simple, predictable.

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

  • scopeone command, one proxy
  • safetyverify exit country first
  • clarityplain JSON config
  • portabilitybash + jq + curl

Install

Free. Install with Homebrew.

hamta is open source and installs in one command. Homebrew handles the runtime dependencies for you.

FAQ

Common questions.

What is hamta for?

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.

How is it different from just exporting HTTP_PROXY?

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.

What is the difference between `env` and `proxychains` modes?

`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.

What proxy URL schemes are supported?

`http://`, `socks4://`, `socks5://`, and `socks5h://`. In proxychains mode, `socks5h://` is written as a SOCKS5 proxy and DNS leak protection comes from `proxy_dns`.

Does hamta prevent DNS leaks?

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.

What are the runtime dependencies?

`jq` and `curl` are required. `proxychains-ng` is only required if you use `proxy.mode = "proxychains"`. Homebrew installs jq and curl automatically.

What license is hamta released under?

hamta is open source. See the LICENSE file in the GitHub repository for details.

Try hamta today.

One command to install. One prefix to route any tool through your proxy. No shell hacks, no global state.