MCPcopy Index your code
hub / github.com/ekzhang/sshx

github.com/ekzhang/sshx @v0.4.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.4.1 ↗ · + Follow
387 symbols 872 edges 45 files 151 documented · 39%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

sshx

A secure web-based, collaborative terminal.

Features:

  • Run a single command to share your terminal with anyone.
  • Resize, move windows, and freely zoom and pan on an infinite canvas.
  • See other people's cursors moving in real time.
  • Connect to the nearest server in a globally distributed mesh.
  • End-to-end encryption with Argon2 and AES.
  • Automatic reconnection and real-time latency estimates.
  • Predictive echo for faster local editing (à la Mosh).

Visit sshx.io to learn more.

Installation

Just run this command to get the sshx binary for your platform.

curl -sSf https://sshx.io/get | sh

Supports Linux and MacOS on x86_64 and ARM64 architectures, as well as embedded ARMv6 and ARMv7-A systems. The Linux binaries are statically linked.

For Windows, there are binaries for x86_64, x86, and ARM64, linked to MSVC for maximum compatibility.

If you just want to try it out without installing, use:

curl -sSf https://sshx.io/get | sh -s run

Inspect the script for additional options.

You can also install it with Homebrew on macOS.

brew install sshx

CI/CD

You can run sshx in continuous integration workflows to help debug tricky issues, like in GitHub Actions.

name: CI
on: push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      # ... other steps ...

      - run: curl -sSf https://sshx.io/get | sh -s run
      #      ^
      #      └ This will open a remote terminal session and print the URL. It
      #        should take under a second.

We don't have a prepackaged action because it's just a single command. It works anywhere: GitLab CI, CircleCI, Buildkite, CI on your Raspberry Pi, etc.

Be careful adding this to a public GitHub repository, as any user can view the logs of a CI job while it is running.

Development

Here's how to work on the project, if you want to contribute.

Building from source

To build the latest version of the client from source, clone this repository and run, with Rust installed:

cargo install --path crates/sshx

This will compile the sshx binary and place it in your ~/.cargo/bin folder.

Workflow

First, start service containers for development.

docker compose up -d

Install Rust 1.70+, Node v18, NPM v9, and mprocs. Then, run

npm install
mprocs

This will compile and start the server, an instance of the client, and the web frontend in parallel on your machine.

Deployment

I host the application servers on Fly.io and with Redis Cloud.

Self-hosted deployments are not supported at the moment. If you want to deploy sshx, you'll need to properly implement HTTP/TCP reverse proxies, gRPC forwarding, TLS termination, private mesh networking, and graceful shutdown.

Please do not run the development commands in a public setting, as this is insecure.

Extension points exported contracts — how you extend this code

IPrediction (Interface)
(no doc) [13 implementers]
src/lib/typeahead.ts
Event (Interface)
* An event with zero or one parameters that ca n be subscribed to. The event is a function itself. * * Simplified port
src/lib/typeahead.ts
IDebounceReducer (Interface)
Port from `vs/base/common/decorators.ts`
src/lib/typeahead.ts
ICoordinate (Interface)
(no doc) [1 implementers]
src/lib/typeahead.ts

Core symbols most depended-on inside this repo

clone
called by 34
src/lib/typeahead.ts
send
called by 11
crates/sshx-server/src/web/socket.rs
segment
called by 11
crates/sshx/src/encrypt.rs
physicalCursor
called by 10
src/lib/typeahead.ts
insert
called by 10
crates/sshx-server/src/state.rs
moveTo
called by 9
src/lib/typeahead.ts
apply
called by 9
src/lib/typeahead.ts
eatGradually
called by 9
src/lib/typeahead.ts

Shape

Method 239
Function 77
Class 58
Enum 9
Interface 4

Languages

TypeScript50%
Rust50%

Modules by API surface

src/lib/typeahead.ts157 symbols
crates/sshx-server/src/session.rs32 symbols
crates/sshx-server/tests/common/mod.rs17 symbols
src/lib/action/touchZoom.ts13 symbols
crates/sshx/src/terminal/unix.rs13 symbols
crates/sshx-server/src/state.rs13 symbols
crates/sshx/src/controller.rs12 symbols
crates/sshx-server/src/grpc.rs11 symbols
crates/sshx/src/terminal/windows.rs10 symbols
crates/sshx-server/src/state/mesh.rs10 symbols
crates/sshx-core/src/lib.rs10 symbols
crates/sshx-server/tests/with_client.rs9 symbols

For agents

$ claude mcp add sshx \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact