All Projects → cloudcmd → Gritty

cloudcmd / Gritty

Licence: mit
web terminal emulator

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Gritty

Leash
Browser Shell
Stars: ✭ 108 (+71.43%)
Mutual labels:  terminal, console, emulator
Galacritty
WIP GTK terminal emulator based on Alacritty
Stars: ✭ 136 (+115.87%)
Mutual labels:  terminal, console, tty
Dte
A small, configurable console text editor (moved to https://gitlab.com/craigbarnes/dte)
Stars: ✭ 98 (+55.56%)
Mutual labels:  terminal, console, tty
Zui
⬢ Zsh User Interface library – CGI+DHTML-like rapid application development with Zsh
Stars: ✭ 95 (+50.79%)
Mutual labels:  terminal, console, tty
Tty Markdown
Convert a markdown document or text into a terminal friendly output.
Stars: ✭ 275 (+336.51%)
Mutual labels:  terminal, console, tty
Jquery.terminal
jQuery Terminal Emulator - JavaScript library for creating web-based terminals with custom commands
Stars: ✭ 2,623 (+4063.49%)
Mutual labels:  terminal, emulator, console
Xterm.js
A terminal for the web
Stars: ✭ 12,019 (+18977.78%)
Mutual labels:  terminal, console, tty
Ruby jard
Just Another Ruby Debugger. Provide a rich Terminal UI that visualizes everything your need, navigates your program with pleasure, stops at matter places only, reduces manual and mental efforts. You can now focus on real debugging.
Stars: ✭ 669 (+961.9%)
Mutual labels:  terminal, console, tty
Tty Font
Terminal fonts
Stars: ✭ 44 (-30.16%)
Mutual labels:  terminal, console, tty
Finalcut
A text-based widget toolkit
Stars: ✭ 244 (+287.3%)
Mutual labels:  terminal, console, tty
Upterm
A terminal emulator for the 21st century.
Stars: ✭ 19,441 (+30758.73%)
Mutual labels:  terminal, console, tty
Tty Pager
Terminal output paging - cross-platform, major ruby interpreters
Stars: ✭ 37 (-41.27%)
Mutual labels:  terminal, console, tty
Asciichart
Nice-looking lightweight console ASCII line charts ╭┈╯ for NodeJS, browsers and terminal, no dependencies
Stars: ✭ 1,107 (+1657.14%)
Mutual labels:  terminal, console
Tui Consolelauncher
Linux CLI Launcher for Android
Stars: ✭ 861 (+1266.67%)
Mutual labels:  terminal, console
Closestx11color
Find the closest xterm-256 colors (between 0 and 255) to an arbitrary HTML hexa color (e.g. #ABCDEF)
Stars: ✭ 13 (-79.37%)
Mutual labels:  terminal, console
Tldr
📚 Collaborative cheatsheets for console commands
Stars: ✭ 36,408 (+57690.48%)
Mutual labels:  terminal, console
C Sharp Console Gui Framework
A GUI framework for C# console applications
Stars: ✭ 838 (+1230.16%)
Mutual labels:  terminal, console
Radian
A 21 century R console
Stars: ✭ 878 (+1293.65%)
Mutual labels:  terminal, console
Video To Ascii
It is a simple python package to play videos in the terminal using characters as pixels
Stars: ✭ 960 (+1423.81%)
Mutual labels:  terminal, console
Wonders
🌈 Declarative JavaScript framework to build command-line applications.
Stars: ✭ 34 (-46.03%)
Mutual labels:  terminal, console

Gritty License NPM version Dependency Status Build Status Coverage Status

Web terminal emulator. Based on node-pty and xterm.js.

Gritty

Install

npm i gritty -g

Usage

Usage: gritty [options]
Options:
  -h, --help              display this help and exit
  -v, --version           output version information and exit
  --path                  output path of a gritty and exit
  --port                  set port number
  --command               command to run in terminal (shell by default)
  --auto-restart          restart command when on exit
  --no-auto-restart       do not restart command on exit

Windows

On Windows there is no build tools by default. When can't install gritty try to install windows-build-tools first.

npm i windows-build-tools -g
npm i gritty -g

Gritty

Use as standalone

Start gritty, and go to url http://localhost:1337

API

Client API

gritty(element [, options])

const prefix = '/gritty'; // default
const env = {}; // default
const fontFamily = 'Courier'; // default

gritty('body', {
    prefix,
    env,
    fontFamily,
});

Server API

gritty.listen(socket, [, options])

Gritty could be used as middleware:

const prefix = '/gritty'; // default

const auth = (accept, reject) => (username, password) => {
    accept();
};

gritty.listen(socket, {
    prefix,
    auth, // optional
});

gritty(options)

Middleware function:

const prefix = '/gritty'; // default

gritty({
    prefix,
});

Usage as middleware

To use gritty in your programs you should make local install:

npm i gritty socket.io express --save

And use it this way:

// server.js

const gritty = require('gritty');
const http = require('http');
const express = require('express');
const io = require('socket.io');

const app = express();
const server = http.createServer(app);
const socket = io.listen(server);

const port = 1337;
const ip = '0.0.0.0';

app.use(gritty());
app.use(express.static(__dirname));

gritty.listen(socket, {
    command: 'mc', // optional
    autoRestart: true, // default
});

server.listen(port, ip);
<!-- index.html -->

<div class="gritty"></div>
<script src="/gritty/gritty.js"></script>
<script>
    const options = {
        prefix: 'console',
        command: 'bash', // optional
        autoRestart: true, // optional
        cwd: '/', // optional
        env: {
            TERMINAL: 'gritty',
            CURRENT: getCurrentFile,
        }
    };
    
    gritty('.terminal', options);
    
    function getCurrentFile() {
        return 'filename.txt';
    }
</script>

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].