-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Seamlessly bridge the gap between local shell to your browser
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
- 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.
- Node.js (>v14)
- npm (latest version)
- nvm
- storage: >91MB
- shell: (any of your running & working shell binaries on linux/unix) OR powershell (on windows)
npm install -g @waxory/sheh
sheh help- git clone the repo
github.com/waxodium/sheh
git clone https://github.com/waxodium/sheh.git
cd sheh
npm install && npm run devSheh'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
Frontend
The system is built on three primary pillars starting from first to last as low to high level:
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:
(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,SIGQUITcorrectly 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
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)
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)
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.