Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract shell #61

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Abstract shell #61

wants to merge 12 commits into from

Conversation

baptistemesta
Copy link

Hi,
I coded that And I think it would be useful for others to have it.

It's just a small framework to make development of shell easier.
There is an abstract shell that clients can extends and on which Commands can be contributed.
Each commands define their completers, name and business code.
Clients can define a context that will be given to commands when executed.

The CommandArgumentsCompleter allows to complete command name and then delegate the completion to completers of each command.

Basically to write your own shell you just have to extends BaseShell.
The most important thing here is the initShellCommands that must returns a list of ShellCommand.

If you find this interesting tell me.
Also there is no test yet but I can add some.

@jdillon
Copy link
Member

jdillon commented Nov 9, 2012

We might want to convert this project into a multi-module project and include other support modules with helpers like this in it. I don't think it should be part of the core library though... IMO

@baptistemesta
Copy link
Author

Ok! Yes this is more an extension that the core stuff.
If you need some contribution in case that kind of module is created don't hesitate to ask :)

@jdillon
Copy link
Member

jdillon commented Nov 9, 2012

You didn't have to close this... open is a good reminder to spend time to update the build to allow stuff like this to get merged into the right place ;-)

@baptistemesta
Copy link
Author

Ok i reopen it so :)

@baptistemesta baptistemesta reopened this Nov 9, 2012
@Cepheus
Copy link

Cepheus commented Jun 6, 2013

I am using jLine and made just the same thing as you did. I just found out about your small framework now. It would be cool to add this into the jLine library since its point is to ease command-line application developpement!

@jdillon
Copy link
Member

jdillon commented Jun 6, 2013

Dunno, there are lots of shell frameworks our there:

... and a lot more that spring up all the time.

jline was not intended to be a shell, and IMO don't think it should start down that path. Perhaps better instead to point to other shell frameworks instead to help folks bootstrap their efforts?

@Cepheus
Copy link

Cepheus commented Jun 7, 2013

It would indeed nice to point the existing shell frameworks with their pros and cons with jLine2!

@nikolavp
Copy link

I started a framework that is using jline2 and jcommander underneath. You can have a look at it at https://github.com/nikolavp/commander-shell. There are modules to embed the shell in ssh or your web application as needed. The plan is to mimic the crash shell but not try to reinvent the wheel and be as small as possible. Crash is huge(30MB) to embed.

@vietj
Copy link
Contributor

vietj commented Oct 30, 2014

hi, I'm the guy that wrote CRaSH basically)

CRaSH is modular and can be trimmed down a smaller size if you only use some part of it. You could consider contribute to the CRaSH and provide a trimmed down distribution that fit your needs.

@nikolavp
Copy link

Hi vletj, I am aware that you trim parts of it, but for example I couldn't find a way to trim down the groovy parts. I was trying to embed this in one of our web applications but I the smallest thing I could get was 13MB which in our case is a no go :)

P.S. I sent you an email to continue this discussion because there might be a way to do this.

@adzubla
Copy link

adzubla commented Aug 10, 2015

It looks like many people had the same idea...

I evaluated CRaSH, clam-shell, spring-shell and felix but found that they are too much for my taste!

So I started my own little shell framework, with the idea to keep it simple, extensible and with minimal dependencies (you can use it without jline if you want).

You can have a look at it: https://github.com/adzubla/josh

@nikolavp
Copy link

I did almost the same. Look at mine https://github.com/nikolavp/commander-shell. I also had the requirement for exposing the shell through sshd. Will look into yours for ideas later :) 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants