Embedded Shell

61 views
Skip to first unread message

Stuart Douglas

unread,
Nov 16, 2021, 11:29:27 PM11/16/21
to Quarkus Development mailing list
Hi Everyone,

By now I think (hope) most people will be familiar with the embedded console commands, that allow you control Quarkus in certain ways, such as starting continuous testing and opening the dev UI.

I think it would be really useful to make this extensible, but at the moment it is not really possible as single letter commands are *very* prone to conflicts, and also it is not really possible to add additional parameters to the command.

To this end I have come up with a proof of concept that embeds a more full featured shell in the application:



Basically if you press ':' the terminal goes into alternate buffer mode, so your standard output is hidden. You can then enter extensible terminal commands with full tab completion support. When you are done you press 'ESC' and your terminal comes back.

I have also added the ability to run another application from the shell. With the proof of concept you can type ':psql' and psql will start in your current terminal and automatically connect to your dev services database (assuming you have psql installed locally).

I think this opens up a lot of really interesting possibilities in terms of tooling, but it will be a fair bit of work to get it past the proof of concept phase (and I have not even looked at getting it to work on windows), so I thought I should get some early feedback before I go any further with it.

Stuart

Andy Damevin

unread,
Nov 17, 2021, 3:08:27 AM11/17/21
to Douglas, Stuart, Quarkus Development mailing list
Where do you go to get all those great ideas? I find it very promising and I also see a lot of potential for the dev xp 👌 
I nearly don't use the dev-ui (maybe I just don't have the reflex), anyway I would enjoy some of its features in the terminal.

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CAD%2BL2czzkkkKwVW87odtcXBKQ0RDfq2Nxm8GENmUXDR8-%2B8EaA%40mail.gmail.com.


--
Andy Damevin

Sergey Beryozkin

unread,
Nov 17, 2021, 4:52:25 AM11/17/21
to Andy Damevin, Douglas, Stuart, Quarkus Development mailing list
Hi Stuart

Nice,

Does it pick up the system properties of the outer terminal/dev console ? With Dev Services for Kerberos, it would be nice to run kinit, etc but it needs to get a path (as KRB5_CONFIG) to the generated config file prepared by DevServices for Kerberos

Sergey

Stuart Douglas

unread,
Nov 17, 2021, 5:11:46 AM11/17/21
to Sergey Beryozkin, Andy Damevin, Quarkus Development mailing list
On Wed, 17 Nov 2021 at 20:52, Sergey Beryozkin <sbia...@redhat.com> wrote:
Hi Stuart

Nice,

Does it pick up the system properties of the outer terminal/dev console ? With Dev Services for Kerberos, it would be nice to run kinit, etc but it needs to get a path (as KRB5_CONFIG) to the generated config file prepared by DevServices for Kerberos

It's not an actual Linux shell, just a way to run commands provided by build steps with tab completion etc.

Stuart

Sergey Beryozkin

unread,
Nov 17, 2021, 5:25:49 AM11/17/21
to Stuart Douglas, Andy Damevin, Quarkus Development mailing list
On Wed, Nov 17, 2021 at 10:11 AM Stuart Douglas <sdou...@redhat.com> wrote:


On Wed, 17 Nov 2021 at 20:52, Sergey Beryozkin <sbia...@redhat.com> wrote:
Hi Stuart

Nice,

Does it pick up the system properties of the outer terminal/dev console ? With Dev Services for Kerberos, it would be nice to run kinit, etc but it needs to get a path (as KRB5_CONFIG) to the generated config file prepared by DevServices for Kerberos

It's not an actual Linux shell, just a way to run commands provided by build steps with tab completion etc.

I see, will be very useful for sure, perhaps launching a shell might happen later :-)

Thanks, Sergey

Ioannis Canellos

unread,
Nov 17, 2021, 5:35:43 AM11/17/21
to Stuart Douglas, Quarkus Development mailing list
This is amazing!

I am wondering if it made sense to provide a goal/command that would let users enter directly the shell, without the `:` thing.
And maybe a shell command to tail the logs?




--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CAD%2BL2czzkkkKwVW87odtcXBKQ0RDfq2Nxm8GENmUXDR8-%2B8EaA%40mail.gmail.com.


--

Max Rydahl Andersen

unread,
Nov 18, 2021, 8:37:36 AM11/18/21
to Stuart Douglas, Quarkus Development mailing list

Cool stuff Stuart.

To be clear with respect to terminology, this is more a REPL (read-eval-print-loop, think jshell/) than a full shell (i.e bash/zsh is a shell), right?

The commands you can run are made available via the extensions similar to dev-ui; one could even imagine actions in devui can be directly exposed both in ui and terminal.

What are you using to implement it ? aesh ? picocli ? a mix ?

My only concern around this is to not make it too flexible (i.e. allow running a full-blown shell) as its a sinkhole of security issues, bug fixing - especially across different operating systems but also just to give a decent UX to users.

I would have been fine with a hierarchy of extensions with commands to browse...less sexy but way more repeatable and possible to scope.

/max

Ladislav Thon

unread,
Nov 19, 2021, 4:25:31 AM11/19/21
to Stuart Douglas, Quarkus Development mailing list
Almost getting close to the WildFly CLI? :-) And I think that's good! I always liked that (once I knew it exists).

One thing that surprised me in the video is the sudden switch to the alternate screen buffer. Given that everything occurs on the primary buffer, even the psql exectuion, it would feel more natural if the prompt was also on the primary buffer. But I know next to nothing about terminal programming, so I don't know if there are any troubles with that.

LT

st 17. 11. 2021 v 5:29 odesílatel Stuart Douglas <sdou...@redhat.com> napsal:

Martin Kouba

unread,
Nov 19, 2021, 7:33:44 AM11/19/21
to lad...@gmail.com, Stuart Douglas, Quarkus Development mailing list
On 19. 11. 21 10:25, Ladislav Thon wrote:
> Almost getting close to the WildFly CLI? :-) And I think that's good! I
> always liked that (once I knew it exists).
>
> One thing that surprised me in the video is the sudden switch to the
> alternate screen buffer. Given that everything occurs on the primary
> buffer, even the psql exectuion, it would feel more natural if the
> prompt was also on the primary buffer. But I know next to nothing about
> terminal programming, so I don't know if there are any troubles with that.

I was surprised too but in a different way - I think that it would be
reasonable to execute the commands and even see the output of
interactive commands (such as psql) in an alternate buffer because some
apps may log a lot of stuff periodically and one could get easily lost.

>
> LT
>
> st 17. 11. 2021 v 5:29 odesílatel Stuart Douglas <sdou...@redhat.com
> <mailto:sdou...@redhat.com>> napsal:
>
> Hi Everyone,
>
> By now I think (hope) most people will be familiar with the embedded
> console commands, that allow you control Quarkus in certain ways,
> such as starting continuous testing and opening the dev UI.
>
> I think it would be really useful to make this extensible, but at
> the moment it is not really possible as single letter commands are
> *very* prone to conflicts, and also it is not really possible to add
> additional parameters to the command.
>
> To this end I have come up with a proof of concept that embeds a
> more full featured shell in the application:
>
> https://drive.google.com/file/d/1uOC9U3n6jVyV4xcrjM3Vbg8WT1UNQ7hx/view?usp=sharing
> <https://drive.google.com/file/d/1uOC9U3n6jVyV4xcrjM3Vbg8WT1UNQ7hx/view?usp=sharing>
>
> https://github.com/stuartwdouglas/quarkus/tree/terminal-experiments
> <https://github.com/stuartwdouglas/quarkus/tree/terminal-experiments>
>
> Basically if you press ':' the terminal goes into alternate buffer
> mode, so your standard output is hidden. You can then enter
> extensible terminal commands with full tab completion support. When
> you are done you press 'ESC' and your terminal comes back.
>
> I have also added the ability to run another application from the
> shell. With the proof of concept you can type ':psql' and psql will
> start in your current terminal and automatically connect to your dev
> services database (assuming you have psql installed locally).
>
> I think this opens up a lot of really interesting possibilities in
> terms of tooling, but it will be a fair bit of work to get it past
> the proof of concept phase (and I have not even looked at getting it
> to work on windows), so I thought I should get some early feedback
> before I go any further with it.
>
> Stuart
>
> --
> You received this message because you are subscribed to the Google
> Groups "Quarkus Development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to quarkus-dev...@googlegroups.com
> <mailto:quarkus-dev...@googlegroups.com>.
> <https://groups.google.com/d/msgid/quarkus-dev/CAD%2BL2czzkkkKwVW87odtcXBKQ0RDfq2Nxm8GENmUXDR8-%2B8EaA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Quarkus Development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to quarkus-dev...@googlegroups.com
> <mailto:quarkus-dev...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/quarkus-dev/CALbocO%3DB6vzLG-DWGpZkieOi-NW%2BRn%3DfGG0F9kWNCvQqeyuWRQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/quarkus-dev/CALbocO%3DB6vzLG-DWGpZkieOi-NW%2BRn%3DfGG0F9kWNCvQqeyuWRQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

--
Martin Kouba
Software Engineer
Red Hat, Czech Republic

Ladislav Thon

unread,
Nov 19, 2021, 8:24:08 AM11/19/21
to Martin Kouba, Stuart Douglas, Quarkus Development mailing list
pá 19. 11. 2021 v 13:33 odesílatel Martin Kouba <mko...@redhat.com> napsal:
On 19. 11. 21 10:25, Ladislav Thon wrote:
> Almost getting close to the WildFly CLI? :-) And I think that's good! I
> always liked that (once I knew it exists).
>
> One thing that surprised me in the video is the sudden switch to the
> alternate screen buffer. Given that everything occurs on the primary
> buffer, even the psql exectuion, it would feel more natural if the
> prompt was also on the primary buffer. But I know next to nothing about
> terminal programming, so I don't know if there are any troubles with that.

I was surprised too but in a different way - I think that it would be
reasonable to execute the commands and even see the output of
interactive commands (such as psql) in an alternate buffer because some
apps may log a lot of stuff periodically and one could get easily lost.

Or that, yes, but then you'd expect scrollback, which the alternate screen buffer doesn't provide, so Quarkus would have to implement that itself, and all kinds of pain ensue. At least that's my cursory understanding.

LT

Martin Kouba

unread,
Nov 19, 2021, 8:33:15 AM11/19/21
to lad...@gmail.com, Stuart Douglas, Quarkus Development mailing list
On 19. 11. 21 14:23, Ladislav Thon wrote:
> pá 19. 11. 2021 v 13:33 odesílatel Martin Kouba <mko...@redhat.com
> <mailto:mko...@redhat.com>> napsal:
>
> On 19. 11. 21 10:25, Ladislav Thon wrote:
> > Almost getting close to the WildFly CLI? :-) And I think that's
> good! I
> > always liked that (once I knew it exists).
> >
> > One thing that surprised me in the video is the sudden switch to the
> > alternate screen buffer. Given that everything occurs on the primary
> > buffer, even the psql exectuion, it would feel more natural if the
> > prompt was also on the primary buffer. But I know next to nothing
> about
> > terminal programming, so I don't know if there are any troubles
> with that.
>
> I was surprised too but in a different way - I think that it would be
> reasonable to execute the commands and even see the output of
> interactive commands (such as psql) in an alternate buffer because some
> apps may log a lot of stuff periodically and one could get easily lost.
>
>
> Or that, yes, but then you'd expect scrollback, which the alternate
> screen buffer doesn't provide, so Quarkus would have to implement that
> itself, and all kinds of pain ensue. At least that's my cursory
> understanding.

Aha, didn't know this. In that case, the current behavior is a
reasonable compromise.

>
> LT
>
>
> >
> > LT
> >
> > st 17. 11. 2021 v 5:29 odesílatel Stuart Douglas
> <sdou...@redhat.com <mailto:sdou...@redhat.com>
> > <mailto:sdou...@redhat.com <mailto:sdou...@redhat.com>>> napsal:
> <mailto:quarkus-dev%2Bunsu...@googlegroups.com>
> >     <mailto:quarkus-dev...@googlegroups.com
> <mailto:quarkus-dev%2Bunsu...@googlegroups.com>>.
>  <https://groups.google.com/d/msgid/quarkus-dev/CAD%2BL2czzkkkKwVW87odtcXBKQ0RDfq2Nxm8GENmUXDR8-%2B8EaA%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/quarkus-dev/CAD%2BL2czzkkkKwVW87odtcXBKQ0RDfq2Nxm8GENmUXDR8-%2B8EaA%40mail.gmail.com?utm_medium=email&utm_source=footer>>.
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Quarkus Development mailing list" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to quarkus-dev...@googlegroups.com
> <mailto:quarkus-dev%2Bunsu...@googlegroups.com>
> > <mailto:quarkus-dev...@googlegroups.com
> <mailto:quarkus-dev%2Bunsu...@googlegroups.com>>.
> <https://groups.google.com/d/msgid/quarkus-dev/CALbocO%3DB6vzLG-DWGpZkieOi-NW%2BRn%3DfGG0F9kWNCvQqeyuWRQ%40mail.gmail.com?utm_medium=email&utm_source=footer
> --
> You received this message because you are subscribed to the Google
> Groups "Quarkus Development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to quarkus-dev...@googlegroups.com
> <mailto:quarkus-dev...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/quarkus-dev/CALbocOmLa-WgGfOC8Yz%3DQhtEj5swuBbUW3Xne0fv7NyPy6MfVA%40mail.gmail.com
> <https://groups.google.com/d/msgid/quarkus-dev/CALbocOmLa-WgGfOC8Yz%3DQhtEj5swuBbUW3Xne0fv7NyPy6MfVA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Michał Szynkiewicz

unread,
Nov 19, 2021, 8:35:22 AM11/19/21
to Martin Kouba, Ladislav Thon, Stuart Douglas, Quarkus Development mailing list
Getting a configured psql looks really nice, maybe with a tiny little exception of the output printed in the primary screen.

I'm wondering if having a list of useful commands, such as `docker exec ... psql... ` (with all necessary credentials) in a summary of application start-up wouldn't be an easier to maintain alternative for dev services.

To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/0f9e32c6-fe91-3646-d6af-81c52b8bb746%40redhat.com.

ståle pedersen

unread,
Nov 19, 2021, 6:40:02 PM11/19/21
to Quarkus Development mailing list
On Friday, November 19, 2021 at 2:24:08 PM UTC+1 lad...@gmail.com wrote:
pá 19. 11. 2021 v 13:33 odesílatel Martin Kouba <mko...@redhat.com> napsal:
On 19. 11. 21 10:25, Ladislav Thon wrote:
> Almost getting close to the WildFly CLI? :-) And I think that's good! I
> always liked that (once I knew it exists).
>
> One thing that surprised me in the video is the sudden switch to the
> alternate screen buffer. Given that everything occurs on the primary
> buffer, even the psql exectuion, it would feel more natural if the
> prompt was also on the primary buffer. But I know next to nothing about
> terminal programming, so I don't know if there are any troubles with that.

I was surprised too but in a different way - I think that it would be
reasonable to execute the commands and even see the output of
interactive commands (such as psql) in an alternate buffer because some
apps may log a lot of stuff periodically and one could get easily lost.

Or that, yes, but then you'd expect scrollback, which the alternate screen buffer doesn't provide, so Quarkus would have to implement that itself, and all kinds of pain ensue. At least that's my cursory understanding.

I just want to quickly say that that is not correct :)
Eg the less command is using the alternate buffer, but it has "scrollback". Scrollback is just a feature built into the program/command to refresh the buffer with the "correct" lines, noting more. There is no functional difference between the alternate and main buffer afaik.

ståle

Stuart Douglas

unread,
Nov 19, 2021, 8:58:42 PM11/19/21
to sta...@gmail.com, Quarkus Development mailing list


On Sat, 20 Nov 2021, 10:40 am ståle pedersen, <sta...@gmail.com> wrote:


On Friday, November 19, 2021 at 2:24:08 PM UTC+1 lad...@gmail.com wrote:
pá 19. 11. 2021 v 13:33 odesílatel Martin Kouba <mko...@redhat.com> napsal:
On 19. 11. 21 10:25, Ladislav Thon wrote:
> Almost getting close to the WildFly CLI? :-) And I think that's good! I
> always liked that (once I knew it exists).
>
> One thing that surprised me in the video is the sudden switch to the
> alternate screen buffer. Given that everything occurs on the primary
> buffer, even the psql exectuion, it would feel more natural if the
> prompt was also on the primary buffer. But I know next to nothing about
> terminal programming, so I don't know if there are any troubles with that.

I was surprised too but in a different way - I think that it would be
reasonable to execute the commands and even see the output of
interactive commands (such as psql) in an alternate buffer because some
apps may log a lot of stuff periodically and one could get easily lost.

Or that, yes, but then you'd expect scrollback, which the alternate screen buffer doesn't provide, so Quarkus would have to implement that itself, and all kinds of pain ensue. At least that's my cursory understanding.

I just want to quickly say that that is not correct :)
Eg the less command is using the alternate buffer, but it has "scrollback". Scrollback is just a feature built into the program/command to refresh the buffer with the "correct" lines, noting more. There is no functional difference between the alternate and main buffer afaik.

ståle

There is a difference, you need to manually implement it in the alternate buffer. You can't just scroll up and down the terminal window.

Stuart



To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/02c42c7f-9211-44fa-9e9b-706e6759a30en%40googlegroups.com.p

Stuart Douglas

unread,
Nov 19, 2021, 9:03:32 PM11/19/21
to Max Rydahl Andersen, Quarkus Development mailing list


On Fri, 19 Nov 2021, 12:37 am Max Rydahl Andersen, <mand...@redhat.com> wrote:

Cool stuff Stuart.

To be clear with respect to terminology, this is more a REPL (read-eval-print-loop, think jshell/) than a full shell (i.e bash/zsh is a shell), right?

The commands you can run are made available via the extensions similar to dev-ui; one could even imagine actions in devui can be directly exposed both in ui and terminal.

What are you using to implement it ? aesh ? picocli ? a mix ?

Aesh, although to do it properly I will need to make some changes.

My only concern around this is to not make it too flexible (i.e. allow running a full-blown shell) as its a sinkhole of security issues, bug fixing - especially across different operating systems but also just to give a decent UX to users.


The intention is just to allow extensions to provide commands, and potentially embed other programs like the psql example.

I would have been fine with a hierarchy of extensions with commands to browse...less sexy but way more repeatable and possible to scope.

Yea, I think if I take this further it should be namespaced on extension name.

Browsing would also be possible but tab completion mostly enables you to easily search for features, and imho is more usable.

Stuart

Stuart Douglas

unread,
Nov 19, 2021, 9:07:54 PM11/19/21
to Ladislav Thon, Quarkus Development mailing list


On Fri, 19 Nov 2021, 8:25 pm Ladislav Thon, <lad...@gmail.com> wrote:
Almost getting close to the WildFly CLI? :-) And I think that's good! I always liked that (once I knew it exists).

One thing that surprised me in the video is the sudden switch to the alternate screen buffer. Given that everything occurs on the primary buffer, even the psql exectuion, it would feel more natural if the prompt was also on the primary buffer. But I know next to nothing about terminal programming, so I don't know if there are any troubles with that.

Technically possible, but needs changes in Aesh, and makes the already complex status display code even more complex. Given that I am going to need changes anyway I will likely try and scrap the alternate buffer, and just have an extra line in the status display, although if it looks to complex I will just go with the alternate buffer.

Stuart




LT

st 17. 11. 2021 v 5:29 odesílatel Stuart Douglas <sdou...@redhat.com> napsal:
Hi Everyone,

By now I think (hope) most people will be familiar with the embedded console commands, that allow you control Quarkus in certain ways, such as starting continuous testing and opening the dev UI.

I think it would be really useful to make this extensible, but at the moment it is not really possible as single letter commands are *very* prone to conflicts, and also it is not really possible to add additional parameters to the command.

To this end I have come up with a proof of concept that embeds a more full featured shell in the application:



Basically if you press ':' the terminal goes into alternate buffer mode, so your standard output is hidden. You can then enter extensible terminal commands with full tab completion support. When you are done you press 'ESC' and your terminal comes back.

I have also added the ability to run another application from the shell. With the proof of concept you can type ':psql' and psql will start in your current terminal and automatically connect to your dev services database (assuming you have psql installed locally).

I think this opens up a lot of really interesting possibilities in terms of tooling, but it will be a fair bit of work to get it past the proof of concept phase (and I have not even looked at getting it to work on windows), so I thought I should get some early feedback before I go any further with it.

Stuart

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CAD%2BL2czzkkkKwVW87odtcXBKQ0RDfq2Nxm8GENmUXDR8-%2B8EaA%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.

Georgios Andrianakis

unread,
Nov 22, 2021, 5:57:40 AM11/22/21
to Stuart Douglas, Ladislav Thon, Quarkus Development mailing list
I think this has a lot of potential!

Guillaume Smet

unread,
Nov 23, 2021, 7:33:03 AM11/23/21
to Stuart Douglas, Ladislav Thon, Quarkus Development mailing list
Hi,

I was initially very enthusiastic about this but I thought a bit more this morning and I'm not sure it's going to be very practical. Let me explain:
- I can totally see the need for a way to start a client properly configured, be it psql or any other clients - it's a real pain to figure out the command line when you need it
- but... when working on an app, I would like to have both dev mode always available with the stacktraces and so on AND a psql client around

What bugs me in this prototype is that you end up with the thing embedded and you have either the dev mode or the client. And in most cases, I would like to have one terminal tab with the dev mode and another with my psql client.

Maybe what we really need is an easy way to start a properly configured client in a terminal rather than embedding things in dev mode?

Does it make sense?

Max Rydahl Andersen

unread,
Nov 23, 2021, 11:33:52 AM11/23/21
to Stuart Douglas, guillau...@gmail.com, Ladislav Thon, Quarkus Development mailing list
Totally. 

I would actually much rather have the dev console put the command I need to run In my clipboard for me to run where it fits me best.


/max
--

You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.

Stuart Douglas

unread,
Nov 23, 2021, 3:21:06 PM11/23/21
to Guillaume Smet, Ladislav Thon, Quarkus Development mailing list
On Tue, 23 Nov 2021 at 23:33, Guillaume Smet <guillau...@gmail.com> wrote:
Hi,

I was initially very enthusiastic about this but I thought a bit more this morning and I'm not sure it's going to be very practical. Let me explain:
- I can totally see the need for a way to start a client properly configured, be it psql or any other clients - it's a real pain to figure out the command line when you need it

- We could also just have a command to print the PSQL connection string to the console (unrelated to this, but we could even just have an INFO log message every time)
 
- but... when working on an app, I would like to have both dev mode always available with the stacktraces and so on AND a psql client around

What bugs me in this prototype is that you end up with the thing embedded and you have either the dev mode or the client. And in most cases, I would like to have one terminal tab with the dev mode and another with my psql client.

 
Maybe what we really need is an easy way to start a properly configured client in a terminal rather than embedding things in dev mode?

We should definitely make it easy to launch in a separate terminal, but I still think embedded mode can be useful if you just want to check something quickly.

Also is more to the CLI than just embedding clients, it will be possible to run Quarkus specific commands such as limiting the running tests, or pretty much anything from the Dev UI. e.g. you could have things like ':test include-package com.acme.somefeature' to limit which tests are being run.

Stuart

Does it make sense?

Julien Viet

unread,
Nov 24, 2021, 2:48:43 AM11/24/21
to Stuart Douglas, Guillaume Smet, Ladislav Thon, Quarkus Development mailing list
Hi,

did you check vertx-shell [1] that can help to implement an embedded terminal ?

Julien

https://vertx.io/docs/vertx-shell/java/
> --
> You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CAD%2BL2cy2Y7tFWUO2WXXCM5RAAXVSz3wwrMR9D_GtwF3WxOwxgA%40mail.gmail.com.

Julien Viet

unread,
Nov 24, 2021, 2:49:21 AM11/24/21
to Stuart Douglas, Guillaume Smet, Ladislav Thon, Quarkus Development mailing list
actually I meant a remote terminal :-) and not embedded

Max Rydahl Andersen

unread,
Nov 24, 2021, 3:13:48 AM11/24/21
to Stuart Douglas, jul...@julienviet.com, Guillaume Smet, Ladislav Thon, Quarkus Development mailing list
Vertx shell is more for where you want to be able to remote connect, right ?

This wouldn’t fit well for command mode and it would also require another port opened i reckon ?

/max

Stuart Douglas

unread,
Nov 24, 2021, 3:20:02 AM11/24/21
to Max Rydahl Andersen, Julien Viet, Guillaume Smet, Ladislav Thon, Quarkus Development mailing list


On Wed, 24 Nov 2021, 7:13 pm Max Rydahl Andersen, <mand...@redhat.com> wrote:
Vertx shell is more for where you want to be able to remote connect, right ?

This wouldn’t fit well for command mode and it would also require another port opened i reckon ?

Yea, this looks like something different.

The PoC uses Aesh and is all based around ANSI control characters.

Stuart

Stephane Epardaud

unread,
Dec 1, 2021, 5:05:34 AM12/1/21
to Stuart Douglas, Max Rydahl Andersen, Julien Viet, Guillaume Smet, Ladislav Thon, Quarkus Development mailing list
This looks pretty awesome, and the psql client really interests me because I've wanted to connect to the dev service psql sooooo many times :)



--
Stéphane Épardaud

Stuart Douglas

unread,
Dec 1, 2021, 6:25:57 PM12/1/21
to Stephane Epardaud, Max Rydahl Andersen, Julien Viet, Guillaume Smet, Ladislav Thon, Quarkus Development mailing list
On Wed, 1 Dec 2021 at 21:06, Stephane Epardaud <stephane...@gmail.com> wrote:
This looks pretty awesome, and the psql client really interests me because I've wanted to connect to the dev service psql sooooo many times :)

I have changed it to just print a connection command for now, partly because people were skeptical, and partly because I would need to fix a low level input stealing issue that would be a fair bit of work (basically I need to implement a way to Pause Aesh from reading from the terminal, otherwise some keystrokes go to psql and some to Quarkus, in the demo video I hacked around it by blocking the Quarkus thread after the first stolen keystroke).

I have also been thinking about other use cases:

- Tab completion to open paths in the browser
- Include/Exclude tests with completion
- Set a config value (also with tab completion)
- Directly execute SQL (although we can't really do tab completion here, but would work for all databases)
- Enable/disable security, or change users (security set-user alice --roles=admin,user)
- Easily change log levels with tab completion
- Probably some Kafka stuff (change offsets to re-process messages maybe?)
- Reset the database
- Open the docs (with tab completion based on installed extensions)

I'm sure there are heaps more we can come up with as well.

Unless there are major objections I am going to go ahead with this, while keeping the alternate screen buffer approach, and not embedding external programs (so I don't have to fix the input stealing issue straight away). Both of these decisions may be revised in future, but this gives us a starting point that we can build on.

Stuart

Max Rydahl Andersen

unread,
Dec 2, 2021, 5:09:46 AM12/2/21
to Stuart Douglas, Stephane Epardaud, Julien Viet, Guillaume Smet, Ladislav Thon, Quarkus Development mailing list

I think thats a good approach. The console is already quite "busy" now and adding in embedded
terminal to run things like psql is not a great experience. Having "commands" available to give you the info
needed to then open a dedicated terminal is better.

For your list of ideas being able to get similar info as are in some of devui panels
like which entities hibernate have detected and their mappings would be useful; especially
when doing cli or other httpserverless development where there is no devui.

/max

Stuart Douglas

unread,
Dec 7, 2021, 12:22:11 AM12/7/21
to Max Rydahl Andersen, Stephane Epardaud, Julien Viet, Guillaume Smet, Ladislav Thon, Quarkus Development mailing list
Draft PR is here: https://github.com/quarkusio/quarkus/pull/21977

At the moment it provides:
- Set config properties
- Open URL in browser (with RESTEasy Reactive)
- Set log levels for a logger
- Print PSQL connection string for dev services databases

I am thinking it is probably best to get it in and iterate on it, rather than trying to add all the features in one big hit. Once their core is in it also means other people can contribute if they have any ideas for functionality.

Stuart

Alexey Loubyansky

unread,
Dec 7, 2021, 2:09:56 AM12/7/21
to Stuart Douglas, Max Rydahl Andersen, Stephane Epardaud, Julien Viet, Guillaume Smet, Ladislav Thon, Quarkus Development mailing list

Georgios Andrianakis

unread,
Dec 7, 2021, 2:24:46 AM12/7/21
to Alexey Loubyansky, Stuart Douglas, Max Rydahl Andersen, Stephane Epardaud, Julien Viet, Guillaume Smet, Ladislav Thon, Quarkus Development mailing list

Jason Greene

unread,
Dec 7, 2021, 7:26:15 AM12/7/21
to sdou...@redhat.com, Max Rydahl Andersen, Stephane Epardaud, Julien Viet, Guillaume Smet, Ladislav Thon, Quarkus Development mailing list
This looks cool! Nice work

On Dec 6, 2021, at 11:21 PM, Stuart Douglas <sdou...@redhat.com> wrote:


Reply all
Reply to author
Forward
0 new messages