Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Bug 734031 (intro): Various documentation tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
joewalker committed Mar 8, 2012
1 parent 1e383dd commit e15aef9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 50 deletions.
70 changes: 24 additions & 46 deletions README.md
Expand Up @@ -2,66 +2,44 @@
GCLI - Graphic Command Line GCLI - Graphic Command Line
=========================== ===========================


GCLI is a command line component. It is used in Ace/Skywriter/Cloud9/etc GCLI is a graphical command line component. It is being integrated with
It can be easily embedded in any web page and JavaScript application. Firefox developer tools and with editors like Orion and Ace. It can be embedded
in web pages and JavaScript applications.


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? Why?
---- ----
There are a number of problems with common command lines:
Command lines have advantages over graphical UIs in speed of entry and the
ability to contain an almost unlimited set of commands without becoming
cluttered. On the other hand GUIs typically come with better discoverability.
GCLI is an experiment to see if we can improve the discoverability of command
lines whilst retaining the speed and powerful command set of traditional CLIs.

There are a number of problems with the design of traditional command lines:


* They assume a curses-style 80x24 (or similar) character array for output. * 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 Even system consoles are capable of graphics these days. It ought to be
capable of graphics these days. possible to have richer output.
* They assume serial access to the output. * They assume serial access to the output - one command at a time.
This made sense when multi-tasking was expensive, however with modern This made sense when multi-tasking was expensive, however with modern
processors single-tasking is starting to look expensive. processors single-tasking is starting to look expensive.
* They are so loosely coupled that the integration is typically nothing more * They are so loosely coupled that the integration is typically nothing more
than argv/stdout/stderr/stdin. than argv/stdout/stderr/stdin.
That level of integration made sense on memory constrained devices, but with That level of integration made sense on memory constrained devices, but with
more resources, we can provide much richer integration. 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 Getting Started
----- ---------------
Some of the benefits that are currently working:


* Output can be HTML, so tables can be laid out better than the space based git clone git://github.com/joewalker/gcli.git
formatting that 'ls' uses. cd gcli
* All commands can run in the background. '&' becomes the default. # Load index.html into your web browser (except Chrome)
* Commands can write to the output whenever they want, without risk of colliding # For Chrome:
with another task, this means that commands can safely ask for clarification npm install .
or further input whenever they want. ./gcli.js
* Output can contain command links, so the output of 'ls' can contain icons to # Visit http://localhost:9999/
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: When you see the '»' prompt, type 'help' to see a list of commands.


* 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.
3 changes: 0 additions & 3 deletions index.html
Expand Up @@ -41,13 +41,10 @@
}); });


// 'deps' should be the same as in lib/server/build.js:buildStandard // 'deps' should be the same as in lib/server/build.js:buildStandard
var start = new Date().getTime();
var deps = [ 'gcli/index', 'gclitest/index', 'demo/index' ]; var deps = [ 'gcli/index', 'gclitest/index', 'demo/index' ];
require(deps, function(gcli, gclitest) { require(deps, function(gcli, gclitest) {
gclitest.run({ useFakeWindow: true }); gclitest.run({ useFakeWindow: true });
gcli.createView({ useTooltip: true }); gcli.createView({ useTooltip: true });

console.log('Startup time (inc tests): ' + (new Date().getTime() - start)/1000 + 's');
}); });
</script> </script>


Expand Down
2 changes: 1 addition & 1 deletion lib/server/build.js
Expand Up @@ -301,7 +301,7 @@ function createUndefineFunction(project) {
} }


/** /**
* * Test build file
*/ */
exports.buildMain = function() { exports.buildMain = function() {
var firefoxHome = main.gcliHome + '/../devtools'; var firefoxHome = main.gcliHome + '/../devtools';
Expand Down

0 comments on commit e15aef9

Please sign in to comment.