Daftshell - Alpha

Concept

The commandline interface is one of the most powerful computing tools today. BUT, also with one of the highest learning curves to doing really powerful things. So many different -flags --options and so on.

Even if you argue that they aren't "so" bad - they still have inherited so many anachronisms and cludges from older systems that there is no standard interface, and idiosyncracies.

Daft Shell aims to bring simple english-like grammar to the commandline, whilst not sacrificing power.

instead of typing:

grep -l TODO *.txt | xargs -n 1 -J % cp % /home/daniel/calandar/jobs

you could type

copy all .txt files containing TODO to jobs in my calandar 

or how about

send all pictures bigger than 5m to resize 1024x768

or better:

resize to 1024x768 all pictures bigger than 5m 

This is the shell your granny could learn to use.

...

OK. Well, maybe not your granny. But say you have a server which you (the super sysop administrator uber-coder) and the web-design monkey are working on. You can use CSH and vi, but when you're busy, the web-monkey still needs to be able to move files around and be reasonably productive. The Daft Shell should be able to make things a bit easier. Although giving him a decent graphical ftp client may also work...

Getting Started

The main sourceforge project page has most of the info. Basically, you'll need SVN to download the current source. (if you have a mac, or linux, it's probably already got SVN.).

Once you've got the source code,

python daftshell.py
gives you the MOST basic interface ever.

python daftshell_curses.py
gives you the "real" curses GUI. (Work in Progress...).

Grammar

The aim is to be as english-like as possible. Unfortunately english has a lot of extra verbosity, which we have to deal with. We also need to be able to work without it, so as to allow quick working for advanced users

	$ s *.jpg > 5m resize 1024x768

is shorthand for

	$ send all .jpg files bigger than 5 megabytes to resize 1024x768

for instance.

basic commands take instructions, and instructions take values.

for instance

	$ copy apples from tree to basket

and from and to can be in any order you wish.

	$ copy to basket apples from tree
	$ copy apples from tree to basket
	$ copy to basket from tree apples

however if some words are left out (for brevity) then there is a "default" order which is followed. One interesting idea would be an algorithm that learned what order you normally put options in... but not for now. You could end up with very personalised machines, totally unoperable by others.

	$ copy tree/apples to basket
	$ cp tree/apples basket	

all of these should execute exactly the same. Some people think in weird ways, so we should be able to cope.

We also can cope with "and".

	$ move apples and pears from basket and bag to pie

and a few pronouns wouldn't be a bad idea.

	$ copy apples to thumbnails and resize them to 640x480

you could argue that you don't need pronouns:

	$ cp apples thumbnails and resize 640x480

is still reasonably comprehensable and unambiguous. it would be nice if that also worked. :-)

The order isn't really important either:

	$to basket move all apples

Status

Currently, still just a prototype, really. I spent more time working on the grammar parser, and getting the curses 'gui' to work with the parser nicely than on trying to impliment many day to day real functions/programs.

My current plan is to 'out source' as much as possible of the functions to standard unix/shell programs, so parse 'show all .txt files' would actually run 'ls *.txt' and then display the output. This needs a bit of re-factoring, and then a bunch of basics should be easy to write. I haven't had time for quite a while to work on this, thus the 'alpha' status for so long.