r/commandline • • Sep 04 '26

Command Line Interface Shellroute: a CLI that gives each shell its own proxy route

Enable HLS to view with audio, or disable this notification

Shellroute is an open-source CLI for giving one shell or command its own proxy route.

The video shows three independent terminals. The top stays on my normal connection in Lithuania. The two lower sessions connect to the US and Germany at the same time. Commands inside those sessions use their selected routes while the other terminal stays direct.

Quick start:

npm install -g shellroute
shellroute login
/connect US
curl https://ipinfo.io/ip

On first use, shellroute login creates the account and enters interactive mode. Run commands there normally. Scripts and agents can also route a single command without opening an interactive shell:

shellroute run DE -- curl https://ipinfo.io/ip

Related tools cover different jobs. Globalping is useful for public probes from many locations. Proxychains wraps a process when you already have a proxy. A VPN routes the whole device, while raw proxy credentials give you manual control. The difference here is scope: one shellroute session manages the route for one shell or command while other traffic stays unchanged.

Source: https://github.com/shellroute/shellroute-cli

Quickstart: shellroute.com/docs/quickstart

Disclosure: I built shellroute and run the service it connects to. The CLI code is partially AI-generated.

I am mainly looking for feedback on the proxied shell idea and where the CLI feels confusing.

9 Upvotes

13 comments sorted by

1

u/Ok_Music_4862 Sep 05 '26

Good work!.
Previous I've tried to use some CLI comes with VPN software. That was GUI first. So I can not able to use the CLI effectively in my server. In headless (CLI) mode it was not fully functional for - example I was unable to switch the location from CLI.

Curious to know: I can do it from here (as I see I can) and can close my terminal?

2

u/vitascivilis Sep 05 '26

Thanks! Yes, shellroute works entirely from the CLI on a headless server.

In interactive mode, start shellroute and connect from inside it:

shellroute
/connect US

To switch countries, run:

/connect DE

Closing the shell ends its route.

In direct mode, there is no global location to switch. Choose the country for each command:

shellroute run US -- your-command
shellroute run DE -- your-command

Each command gets its own proxy session, which shellroute cleans up when the command finishes.

There is also proxy mode for programs that need an explicit local proxy URL:

shellroute proxy --country US

It prints the local proxy URL and keeps running until stopped. To switch countries, stop it with shellroute proxy stop or Ctrl+C, then start it again with --country DE. It does not route the whole server automatically; configure your program to use the printed proxy URL.

If a long-running command or proxy must survive logout, run it under your usual process supervisor.

4

u/kantorcodes1 Sep 04 '26

if a shellroute run session loses its proxy while the child process is still running, what happens to the child? does it get killed, or can it keep going with direct networking?

3

u/vitascivilis Sep 04 '26

Short answer: if shellroute confirms that the proxy route is gone, it stops the command. It first gives the command and its child processes five seconds to exit cleanly, then force-stops anything still running. It does not silently switch them to your normal connection.

A temporary proxy error is different. That request fails, but the command stays running so it can retry.

One limitation: shellroute configures programs to use its proxy, but it is not a firewall. If a program ignores proxy settings or has its own "retry without a proxy" behavior, shellroute cannot prevent that program from connecting directly.

→ More replies (2)

1

u/ekool Sep 06 '26

This is neat. Any plans to add support for other proxies besides your hosted ones?

1

u/vitascivilis 4d ago

You asked whether it would support other proxies. It does now, since v0.2: shellroute upstream add your-proxy-name http://USER:PASSWORD@HOST:PORT, then shellroute run your-proxy-name -- <your command>. HTTP, HTTPS and SOCKS5 work, and your own proxy needs no Shellroute account. Docs: https://shellroute.com/docs/bring-your-own-proxy/

If you already use a provider, I'd like to know whether this fits how you work. What do you use it for today?

→ More replies (3)

1

u/vitascivilis Sep 06 '26

Thanks! Not right now. Shellroute currently handles route selection and access as part of the service, which is what lets you choose a country with /connect US without managing proxy URLs or credentials.

A bring-your-own-proxy mode could make sense for people who already have a provider, though. What kind of proxy do you use, and would you want it mainly for the interactive shell or shellroute run (i.e. direct mode)?

2

u/AutoModerator Sep 04 '26

Every new subreddit post is automatically copied into a comment for preservation.

User: vitascivilis, Flair: Command Line Interface, Post Media Link, Title: Shellroute: a CLI that gives each shell its own proxy route

Shellroute is an open-source CLI for giving one shell or command its own proxy route.

The video shows three independent terminals. The top stays on my normal connection in Lithuania. The two lower sessions connect to the US and Germany at the same time. Commands inside those sessions use their selected routes while the other terminal stays direct.

Quick start:

npm install -g shellroute
shellroute login
/connect US
curl https://ipinfo.io/ip

On first use, shellroute login creates the account and enters interactive mode. Run commands there normally. Scripts and agents can also route a single command without opening an interactive shell:

shellroute run DE -- curl https://ipinfo.io/ip

Related tools cover different jobs. Globalping is useful for public probes from many locations. Proxychains wraps a process when you already have a proxy. A VPN routes the whole device, while raw proxy credentials give you manual control. The difference here is scope: one shellroute session manages the route for one shell or command while other traffic stays unchanged.

Source: https://github.com/shellroute/shellroute-cli

Quickstart: shellroute.com/docs/quickstart

Disclosure: I built shellroute and run the service it connects to. The CLI code is partially AI-generated.

I am mainly looking for feedback on the proxied shell idea and where the CLI feels confusing.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.