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/

108 questions
0
votes
1 answer

Spring Shell - How To Disable All or Some Of The Built-In Commands

Using Spring Shell 3.0 I would like to disable some of the built-in commands, e.g. stacktrace, script. Is this possible to achieve?
D-Dᴙum
  • 7,689
  • 8
  • 58
  • 97
0
votes
0 answers

Spring Shell not initializing

I am trying to create a CLI application that has several commands using Spring Shell, having dependencies on another project and Spring. This is my pom: es.uca.dss.sigeca cli 1.0
0
votes
1 answer

how to authenticate users managed by keycloak in Spring Shell CLI app and store the token retrieved securely

Im developing a spring shell app whose main job is to make requests to a Spring boot rest API and display the results to the user. The problem is the users of the rest API are managed by keycloak, meaning I have to authenticate the CLI user to send…
someone
  • 1
  • 2
0
votes
0 answers

How to open a new terminal tab using Spring boot dependency Spring Shell

I have certain use case which requires opening of a new terminal tab/window from current terminal window, both terminal will be running in different context. For eg. a chat application is running on the main terminal and whenever a new chat request…
JCodeX
  • 19
  • 1
  • 9
0
votes
0 answers

How to remove the empty new line after spring-shell tables?

I use Spring Shell TableBuilder to draw tables. After each table it draws an empty line. How is possible to remove the empty line at the end of the Spring Stell tables? I looked at the examples but they draw the line too.
ckid
  • 1
0
votes
0 answers

Spring Shell another properties location

how can I set another properties file location in Spring Shell? When I try java -jar ovh-email-creator.jar --spring.config.location=application.yaml I got a No command found for '--spring.config.location=application.yaml' error because spring try…
0
votes
1 answer

Is there a way to define a ShellOption without value to check if it exists or not?

I'm using Spring Shell for one of my projects, and I need a parameter to run my command with a different behavior like --without-logs. Basically I need a ShellOption parameter to check if the parameter is given by the user or…
0
votes
1 answer

How to implement multi-part / sub commands in Spring Shell?

I am using Spring Shell 3.0.0 to implement a command line application. The application deals with several types of objects and has several commands for each type of object, for example: list-foos list-bars describe-foo XYZ To improve usability, I…
0
votes
0 answers

Is there a group key for spring shell?

I have 2 shell mehtods like this: @ShellMethod(key = ["context set"]) fun setContext(dbContext: String) { println("Set db context to $dbContext") } @ShellMethod(key = ["context clear"]) fun clearContext() { println("Clear db context") } I…
0
votes
1 answer

Unable to use optional parameters in Spring-shell

I'm trying to write some code in spring-shell I'm getting some issues. Please find the code below @ShellComponent public class CommandDemo { @ShellMethod(value = "This command is used to greet a user") public void greet( …
Sankar
  • 39
  • 2
  • 9
0
votes
1 answer

How to prevent automatic assignment of arguments in the absence of their switch in spring shell version 2.x?

I have switched to spring shell version 2. Consider I have a command accepting one argument: @shellMethod public void greet(@ShellOption String name){ System.out.println(String.format("Hello %s", name); } The behavior in case of entering greet…
kvs
  • 178
  • 2
  • 12
0
votes
1 answer

Spring shell command line application returning null from a shell method

I have a simple CLI application that prints out your name from the official docs here. @ShellComponent public class Cli { @ShellMethod("Say my name") public String hi(@ShellOption(value = {"name"}) String arg1){ return "Hi " + arg1 + "!!"; …
0
votes
1 answer

Spring Shell: Is it possible to start spring shell at runtime on demand

I am runing a spring-boot app as a backend application within a docker container. I want to be able to exec in a container and start a shellMethod to execute some admin stuff. Is it possible start and stop a shell session within a container at…
FishingIsLife
  • 1,972
  • 3
  • 28
  • 51
0
votes
1 answer

The Availability Doesn't Function When The App Is Started From the Command LIne

I encounter a few unreasonable issues with a Spring Shell app which has the dependency as org.springframework.shell spring-shell-starter
vic
  • 2,548
  • 9
  • 44
  • 74
0
votes
0 answers

Support of "exit on error" for "script" command in spring-shell

Currently, when we trigger a "script" command in spring-shell prompt, it executes all the commands present in a file, even if one of them threw any exception(other than ExitRequest). I found below code in Shell.evaluate(Input), it simply returns…
RDK
  • 144
  • 1
  • 1
  • 9