Skip to main content

interactive terminal in the browser

Project description

pyxterm.js

A fully functional terminal in your browser.

screenshot

This is a Flask websocket backend combined with the Xterm.js Javascript terminal emulator in the frontend. It works out of the box and can run any application you want, including bash.

While useful on its own, the real purpose of this is to show a basic proof of concept on how to bring Xterm.js, Python, Flask, and Websockets together to make a useful tool.

It is a

  • starting point to build your own web app with a terminal
  • learning tool to understand what a pty is, and how to use one in Python
  • way to see Flask and Flask-SocketIO
  • way to play around with Xterm.js is a meaningful environment

Installation

Option 1

This option installs system-wide or to your virtual environment. Should probably only be used if you're using a virtual environment.

pip install pyxtermjs
pyxtermjs  # run it from anywhere

Option 2

This option installs system-wide and isolates all of pyxterm.js's dependencies, guaranteeing there are no dependency version conflicts. Requires pipsi to be installed.

pipsi install pyxtermjs
pyxtermjs  # run it from anywhere

Option 3

This option lets you play around with the source code. Requires poetry to be installed.

git clone https://github.com/cs01/pyxterm.js.git
cd pyxterm.js
poetry install
python pyxtermjs/app.py

Documentation

>> pyxtermjs --help
usage: app.py [-h] [-p PORT] [--debug] [--command COMMAND]
              [--cmd-args CMD_ARGS]

A fully functional terminal in your browser.
https://github.com/cs01/pyxterm.js

optional arguments:
  -h, --help            show this help message and exit
  -p PORT, --port PORT  port to run server on (default: 5000)
  --debug               debug the server (default: False)
  --command COMMAND     Command to run in the terminal (default: bash)
  --cmd-args CMD_ARGS   arguments to pass to command (i.e. --cmd-args='arg1
                        arg2 --flag') (default: )

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyxtermjs-0.3.0.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

pyxtermjs-0.3.0.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file pyxtermjs-0.3.0.0.tar.gz.

File metadata

  • Download URL: pyxtermjs-0.3.0.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.11.5 CPython/3.6.2+ Darwin/17.7.0

File hashes

Hashes for pyxtermjs-0.3.0.0.tar.gz
Algorithm Hash digest
SHA256 0ffb1e8101a576652aadda032025b3017497ab234fdd01019d1b5e773226f128
MD5 2558d6af5f52e697de82902e844c201b
BLAKE2b-256 90f37c7d9cc054c9848ce98c847e87507aa3606d2ff10cc1d22e918db8040562

See more details on using hashes here.

File details

Details for the file pyxtermjs-0.3.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyxtermjs-0.3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.11.5 CPython/3.6.2+ Darwin/17.7.0

File hashes

Hashes for pyxtermjs-0.3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2b896097f0895c3c5a0343f9e444c024fb4176e49c28cc8462b27782d6e1aac
MD5 a87c82b267d7e0572bfccea350b91efb
BLAKE2b-256 0dafd8144b89cf9971e9047cef4623e1d826bd0618d0a60670e0ce0c16bf81f6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page