Skip to content
waxodium edited this page May 17, 2026 · 5 revisions

Sheh: Shell Exposed HTTP

Seamlessly bridge the gap between local shell to your browser

NPM Version License


πŸ’‘ Overview

Sheh (Shell Exposed HTTP) is Gotty inspired. Sheh Is a command line tool that broadcast you terminal to your browser locally and with local network. To use your terminal through the browser. Works for every shells in existence

πŸ›  Features

  • Zero-Config Routing: Map shell scripts to URL paths instantly.
  • JSON-First: Automatically parses shell output into structured JSON responses.
  • Environment Agnostic: Runs anywhere if with Node.js
  • Local Server: Launch with localhost and with your local network.
  • Browser Terminal: Full UX experience in the terminal, that even your phone can easily controls it
  • Cross-platform: With Node.js, sheh able to work on all platform Linux, Unix, Windows. Across multiple shells Unix/Linux and powershell.

Requirement:

  • Node.js (>v14)
  • npm (latest version)
  • nvm
  • storage: >91MB
  • shell: (any of your running & working shell binaries on linux/unix) OR powershell (on windows)

Installation / Run from source

Install from sheh official npm registry (reccomended)

npm install -g @waxory/sheh
sheh help

Run from source

  1. git clone the repo github.com/waxodium/sheh
git clone https://github.com/waxodium/sheh.git
cd sheh
npm install && npm run dev

How sheh Works?

Sheh's project tree structure

.
β”œβ”€β”€ main.js
β”œβ”€β”€ public/
β”‚Β Β  β”œβ”€β”€ css/
β”‚Β Β  β”‚Β Β  └── xterm.min.css
β”‚Β Β  β”œβ”€β”€ index.html
β”‚Β Β  └── lib/
β”‚Β Β      β”œβ”€β”€ xterm-addon-fit.min.js
β”‚Β Β      └── xterm.min.js
└── src/
    β”œβ”€β”€ child.js
    └── server.js

Backend

express ws node-pty node

Frontend

xterm.js morgan

The system is built on three primary pillars starting from first to last as low to high level:

1. The PTY

Sheh uses a native PTY or (Pseudo-Terminal) environment. This allows it to

  • maintain a live connection to the shell. Resulting a support for interactive commands and any custom loops program that has I/O

  • Works across any shells

    sh, bash, zsh, ksh, dash, tcsh, csh, powershell, fish, nu, elvish, 
    murex, osh/ysh, ngs, xonsh, ion, yash
    
    • Inlcuding niche shells project:

    CGTerm, fcsh, arsh

    (niche shells are not major projects. But it would most likely to work with sheh)

    • Loops Program with I/O

    Sheh would definitly works on any well loops program with I/O that AT LEAST handle SIGINT, SIGTERM, SIGKILL, SIGSEGV, SIGQUIT correctly by standard will able to interact with sheh. That loops program will becomes a loop of prompts handling all of the SIGNAL and executing sheh.

    Jump to: How to apply your shell to sheh

2. The Websocket

To achieve low-latency interaction, Sheh converts terminal data into a stream transmitted via WebSockets. This makes sure that as soon as a character is typed in the browser, it is sent to the underlying process, and the output is instantly broadcasted back.

This is considered as a bridge. And they're managed from the ./src/server.js (goto server.js)

3. XTerm as frontend

Finally on the client side, Sheh uses xterm.js and some custom written UX to render a full-featured terminal in the browser. This provides:

  • Standard terminal emulation.

  • Mobile-responsive layouts with on-screen modifier keys:

    • sticky CTRL and ALT key
    • ESC, TAB, HOME, END keys.
    • the arrow keys for up, down, left and right: ↑ ↓ ← β†’.
    • the dash key -, slash /, backslash \ and Pipe key |.
    • touch gestures for (pinch-to-zoom) to scale in and out of the terminal text.

The UI source wrote on ./public/index.html (goto index.html)

How to apply your shell to sheh

To apply your custom shell, your program has to follow the at minimum standard to be able to use Sheh. It needs just SIGINT, SIGTERM, and SIGKILL, along with a looped user input-reader and raw outputting support, to allow Sheh to function correctly. Thus, it's not a guarantee, but it has been proven that unique custom-written shells can also apply Sheh's logic showcased from the niche shells supports list with just any programming language that able to follow the at minimum standard as their program.