GithubHelp home page GithubHelp logo

guniorobot / gcli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mozilla/gcli

1.0 2.0 0.0 6.32 MB

Command-line component for Firefox and Ace

License: Other

JavaScript 99.11% Python 0.89%

gcli's Introduction

GCLI - Graphic Command Line

GCLI is a command line component. It is used in Ace/Skywriter/Cloud9/etc It can be easily embedded in any web page and JavaScript application.

Getting Started

GCLI uses submodules, so make sure you checkout with the following:

git clone git://github.com/joewalker/gcli.git --recursive
cd gcli
python static.py

Then in a browser, visit 'http://localhost:9999/' and where you see the '>' prompt, type 'help' to see a list of commands, 'sh ls -la' executes the list command using a shell provided by the python server.

Why?

There are a number of problems with common command lines:

  • They assume a curses-style 80x24 (or similar) character array for output. This hasn't made much sense for the last 10 years, even system consoles are capable of graphics these days.
  • They assume serial access to the output. This made sense when multi-tasking was expensive, however with modern processors single-tasking is starting to look expensive.
  • They are so loosely coupled that the integration is typically nothing more than argv/stdout/stderr/stdin. That level of integration made sense on memory constrained devices, but with more resources, we can provide much richer integration.

Command lines are often better than UIs for speed of entry and for things like history/scripting/etc, but on the other hand UIs are typically have better discoverability, so it would be good to retain the speed/text basis, but make CLIs easier to use.

Ideas

Some of the benefits that are currently working:

  • Output can be HTML, so tables can be laid out better than the space based formatting that 'ls' uses.
  • All commands can run in the background. '&' becomes the default.
  • Commands can write to the output whenever they want, without risk of colliding with another task, this means that commands can safely ask for clarification or further input whenever they want.
  • Output can contain command links, so the output of 'ls' can contain icons to copy/move/delete the listed files.
  • An AST of the input is created, so we can identify exactly what in the command line is incorrect before return is pressed, and require a fix before the user is allowed to continue.
  • The input parameters are typed. Enter "set historyLength 7" and then press UP. The system knows that the type of the 'historyLength' setting is a number, so we can do an increment operation.

Some additional benefits that should be possible:

  • The command line display does not have to be a plain string. In addition to the error mark-up we can obscure passwords and when the user types "--password tiger" we can display "--password *****". Potentially long filenames could be displayed in shortened form (using "...") when they're not being edited.
  • We could generate a menu system that would allow selection and even execution of commands using a mouse in a why almost as familiar as a traditional GUI.

gcli's People

Contributors

joewalker avatar fjakobs avatar fitzgen avatar mikedeboer avatar jviereck avatar sunbox avatar dangoor avatar gozala avatar wittemann avatar waywardmonkeys avatar rikarends avatar

Stargazers

Gun.io Robot avatar

Watchers

Gun.io Robot avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.