A WebSocket daemon for remote shell execution and interactive terminal sessions
Project description
shellwire
A WebSocket daemon for remote shell execution and interactive terminal sessions
shellwire runs as a WebSocket server, providing a bridge that lets remote clients execute shell commands with full system access. While fully compatible with Linux and macOS, it is uniquely engineered for Android devices. Android applications typically lack proper terminal access, making it difficult to run local AI agents or advanced tools on-device. Shellwire solves this by running inside Termux and exposing a WebSocket server, acting as a bridge to give Android apps a complete, desktop-grade shell environment.
Features
- Stable token auth — token generated once, persists across restarts
- Single client — one active connection at a time, with reconnection support
- Concurrent execution — up to 4 simultaneous commands
- Interactive PTY sessions (POSIX) — full pseudo-terminal support with dynamic resizing
- Environment Tracking — persistent working directory (CWD) and exported environment variables across commands
- Compound Command Rewriting — automatically rewrites bash chains (e.g.
A && B &->A && { B & }) for standard backgrounding - Termux / Android Optimized — Built-in resilience against mobile network handoffs, terminal DOZE states, and phantom process killers, ensuring extreme stability for long-running mobile environments.
- Robust Process Isolation — prevents zombie processes via process-group escalation kills (SIGTERM → SIGKILL) and protects against runaway output
- Health endpoint — HTTP GET
/healthon the same port
Installation
# Via pip
pip install shellwire
Or install from source:
git clone https://github.com/shantoislamdev/shellwire.git
cd shellwire
pip install -e ".[dev]"
Auto-venv Runners
If you clone the repository directly, you can use the included runner scripts which will automatically create a virtual environment (venv) and install dependencies for you:
- Unix / Linux:
./run.sh— Bootstraps the daemon insidevenv./test.sh— Runs the test suite insidevenv
- Windows:
run.bat— Bootstraps the daemon insidevenvtest.bat— Runs the test suite insidevenv
Quick Start
# Start the daemon (foreground)
shellwire start
# Start as background daemon
shellwire start --daemon
# Check status
shellwire status
# View your auth token
shellwire token show
# Stop the daemon
shellwire stop
On first start, a stable auth token is generated and displayed. Save it — you'll need it to connect your client.
Documentation
Documentation is available in the docs/ directory:
- Overview & Architecture: High-level overview and architectural flow.
- Daemon Guide: Server administration, CLI commands, configuration flags, and token management.
- Protocol Specification: Strict JSON schemas for all WebSocket messages (
auth,execute,start_session, etc.). - Client Integration: Developer guide for building custom WebSocket clients, including complete Kotlin examples.
Development
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run with coverage
pytest --cov=shellwire
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shellwire-0.1.3.tar.gz.
File metadata
- Download URL: shellwire-0.1.3.tar.gz
- Upload date:
- Size: 255.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9614a39d91ad5030a07a51889e2dad99f51dccc93f9f11a35c5e5662166d4c1a
|
|
| MD5 |
bc4a9cf78bd51f85312b6f15843841b9
|
|
| BLAKE2b-256 |
e1997f205bcb8e654cd858aa4143f22d18f7985c3c29f49d7da0653f2978b4bd
|
Provenance
The following attestation bundles were made for shellwire-0.1.3.tar.gz:
Publisher:
publish.yml on shantoislamdev/shellwire
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shellwire-0.1.3.tar.gz -
Subject digest:
9614a39d91ad5030a07a51889e2dad99f51dccc93f9f11a35c5e5662166d4c1a - Sigstore transparency entry: 1839375276
- Sigstore integration time:
-
Permalink:
shantoislamdev/shellwire@89d7e010064746bbb001f04a0ce4e04cce8671f6 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/shantoislamdev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@89d7e010064746bbb001f04a0ce4e04cce8671f6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file shellwire-0.1.3-py3-none-any.whl.
File metadata
- Download URL: shellwire-0.1.3-py3-none-any.whl
- Upload date:
- Size: 61.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a705f2f80f35cc0f26bb96522ae8dcca06107928f83080ddb6fe353e85f9243
|
|
| MD5 |
0a8c2abcccf4455a7e35d02a62aeac3a
|
|
| BLAKE2b-256 |
e4952857359d5fd0c3bef49159b36ae354e88138c55ace98864ee5711e51c22c
|
Provenance
The following attestation bundles were made for shellwire-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on shantoislamdev/shellwire
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shellwire-0.1.3-py3-none-any.whl -
Subject digest:
5a705f2f80f35cc0f26bb96522ae8dcca06107928f83080ddb6fe353e85f9243 - Sigstore transparency entry: 1839375441
- Sigstore integration time:
-
Permalink:
shantoislamdev/shellwire@89d7e010064746bbb001f04a0ce4e04cce8671f6 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/shantoislamdev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@89d7e010064746bbb001f04a0ce4e04cce8671f6 -
Trigger Event:
push
-
Statement type: