Bash proxy wrapper for the terminal

Run a command through your proxy without changing your shell.

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.

Environment mode depends on application proxy support; proxychains mode intercepts supported TCP traffic and is not a system-wide VPN.

Features

One command. Scoped proxy. Verified exit.

01

Per-command proxy

Prefix a supported 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 supported 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

Trust the tap with brew trust andrewmmc/tap, then run brew install andrewmmc/tap/hamta to install 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 a command

hamta curl https://ipinfo.io, hamta npm install react, or another command compatible with the selected mode.

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

Command reference

Every way to use hamta.

Set up, inspect, diagnose, verify, or proxy any supported command.

hamta init

Create the default config at ~/.config/hamta/config.json.

hamta config

Print the current configuration.

hamta doctor

Check dependencies, config, proxy reachability, and the current exit IP.

hamta verify

Test proxy verification without running another command.

hamta [--mode env|proxychains] [--] <command> [args...]

Run a command through the configured proxy, with an optional one-off mode override.

hamta --help

Show command usage and options.

hamta --version

Print the installed hamta version.

Install

Free. Install with Homebrew.

hamta is open source. Trust the tap once, then Homebrew installs hamta with the required jq and curl dependencies.

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 supported 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 and installed automatically with hamta through Homebrew. Proxychains mode additionally requires proxychains-ng 4.16 or newer, installed separately with brew install proxychains-ng.

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 supported tools through your proxy. No shell hacks, no global state.