Questions tagged [spring-shell]

Spring Shell is an interactive shell that can be easily extended with commands using a Spring based programming model

Spring Shell's features include

  • A simple, annotation driven, programming model to contribute custom commands
  • Use of Spring Boot auto-configuration functionality as the basis for a command plugin strategy
  • Tab completion, colorisation, and script execution
  • Customisation of command prompt, shell history file name, handling of results and errors
  • Dynamic enablement of commands based on domain specific criteria
  • Integration with the bean validation API
  • Already built-in commands, such as clear screen, gorgeous help, exit
  • ASCII art Tables, with formatting, alignment, fancy borders, etc.

The project homepage can be found at https://projects.spring.io/spring-shell/ while the latest documentation is available at http://docs.spring.io/spring-shell/docs/current/reference/htmlsingle/

81 questions
14
votes
2 answers

how to build console command in spring boot web application using spring shell?

I have created restfull web application using spring boot web starter which works well. I am able to access it through urls. But I have requirement to create console command which can compute and store some values at the backend. I want to be able…
vishal
  • 3,643
  • 11
  • 51
  • 96
11
votes
1 answer

CLI-Spring Shell in IntelliJ

I am working on a CLI Spring shell code in IntelliJ. I run it and give some parameters. But when I type insert and press enter, console doesn't take it and it appears as if nothing happened! My code: @Component public class HelloWorldCommands…
Sajad NasiriNezhad
  • 557
  • 1
  • 5
  • 22
8
votes
1 answer

Combining Spring shell and boot together

I am new to Spring, so after whole day of faling attempts I need to ask ;) Is it possible to combine Spring boot and Spring shell together? My use case is to build a jar which contains webapp (Spring-boot embeds jetty or tomcat by default) and at…
mrok
  • 2,570
  • 3
  • 25
  • 42
7
votes
5 answers

Executing a single command and exiting from Spring Shell 2

I stumbled upon this question from a while back, explaining how to get a Spring Shell application to exit after calling it from the command line with a single command. However, testing this in 2.0.0 with Spring Boot, it does not seem to be the case…
woemler
  • 6,659
  • 6
  • 38
  • 65
6
votes
1 answer

Send multiple commands in the same line

Is there are way to send several commands on the same line using the spring-shell. For example: shell> add 1 2; add 3 4 3 7 I've noticed that if I run my application from Intellij, I can copy paste several commands and it will work correctly: add 1…
0x26res
  • 7,536
  • 9
  • 48
  • 90
5
votes
2 answers

Start a Spring-Shell based application not interactive

Is it possible to start a specific command of a Spring-Shell app and then return/exit the shell after the command is finished? Further is it possible to expose the exit code (System.exit) of the app to the operating system shell? For my purpose i…
Cengiz
  • 4,898
  • 6
  • 45
  • 72
5
votes
2 answers

Spring shell colorized output

I want to colorize my console output in spring-shell. Something like: System.out.println("\red; red text"); I know about colorized JUL logging output, but it's not enought. How I can do that?
Alexey Kutuzov
  • 661
  • 6
  • 22
4
votes
3 answers

How to Integration Test Spring Shell v2.x

The new Spring Shell docs don't seem to provide any examples of how to integration test CLI commands in a Spring Boot context. Any pointers or examples would be appreciated.
codemonkey
  • 608
  • 5
  • 7
4
votes
1 answer

Long running Command execution interruption in Spring Shell

I am using Spring Shell to run some long running command. Is there anyway to interrupt a running command in Spring Shell using Control+C command without exiting the shell.
fellahst
  • 571
  • 1
  • 6
  • 16
4
votes
1 answer

"Bad File Descriptor" exception because of using nohup

My application can be launched via Terminal in linux OS as shell executable file. I have no issues while executing it normally, however when i execute it along with 'nohup' command , it logs below exception in 'nohup.out' file `Exception in thread…
shardul
  • 61
  • 6
4
votes
2 answers

Is it possible to tab-complete values in Spring Shell?

I'm currently trying to improve a Spring Shell application, and one of thing that would make it considerably better would be if it would support tab-completion for values as well as the options. As an example, if my CLI had a command getInfo --name…
Tetigi
  • 542
  • 1
  • 5
  • 20
4
votes
1 answer

What is difference between spring-shell and CRaSH?

The CRaSH project that used by spring-boot can provides interactive shell for Spring. And I found that spring-shell have similar features too. So what is difference between them? Why not spring-boot just using spring-sehll? Any comments or feedback…
bob
  • 957
  • 8
  • 16
2
votes
1 answer

Is there a way to run spring-shell 2.x in a non interactive mode

We are building a spring-shell application. currently, in interactive mode, I have to go like java -jar sample.jar shell:> mycommand arg1 agr2 is there a way to run this nun interactively, Something like this java -jar sample.jar mycommand arg1…
Azhar
  • 21
  • 1
2
votes
1 answer

Execute shell commands from Spring Shell

I have a case which I want to ask can I solve with Spring Shell. I have a main.jar application which have several Scheduled Spring Jobs deployed on Wildly server. In my case I can't stop or redeploy the main.jar because the service must be provided…
Peter Penzov
  • 7,110
  • 86
  • 300
  • 595
2
votes
1 answer

Start Spring Scheduled job from Linux Terminal

I have a case where I want to start Spring Scheduled job from Linux Terminal. Is there some way to trigger it from the terminal? For example can I use Spring Shell to start the Scheduled job?
Peter Penzov
  • 7,110
  • 86
  • 300
  • 595
1
2 3 4 5 6