Questions tagged [spring-shell]
Spring Shell is an interactive shell that can be easily extended with commands using a Spring based programming model
108
questions
0
votes
0
answers
20
views
How to enable always interactive mode for spring-shell command prompt
My requirement is to execute spring-shell program with my-command as a first command then application should prompt again in interactive mode for next command.
Ex:-
$ $JAVA_HOME/bin/java -jar demo-0.0....
0
votes
1
answer
38
views
Run Spring Shell Command after starte Docker Image
I use a Github Action to start a Spring Boot image on a vServer. This Spring Boot application contains the Spring Shell Component and I can run my init-users command.
When I start the image locally or ...
0
votes
0
answers
7
views
ValueProviderSupport from package org.springframework.shell.standard.ValueProviderSupport not supported in spring-shell-starter :3.1.3
Currently our project has spring-shell-starter with version 2.0.1.RELEASE we have tried upgrading to spring-shell-starter :3.1.3
but facing an issue with "Cannot resolve symbol '...
0
votes
0
answers
13
views
How to extract documentation from SpringShell @ShellMethod annotations
I am developing a shell from SpringShell and use the @ShellMethod to annotate the methods that are invoquable from the Shell. The annotation includes a brief description of the command/method.
@...
0
votes
0
answers
17
views
Spring Shell (version:3.1.2) Problem:Can't input Chinese characters by using StringInput component
Chinese characters disappear in StringInput component and doesn't display in the screen just like I never input it,but it works in traditional command in Spring Shell
I hope this problem can be solved,...
1
vote
0
answers
46
views
Is there any way to disable denoting command-line options or flags, in Spring Shell when using the '-' character?
I'm creating a console calculator-application of Roman numbers, as a practice, and using Java, Spring Shell 3.1.2. Right now it works correctly with Roman numbers like:
calc "V + V"
result: ...
0
votes
0
answers
40
views
How can I update the Spring shell prompt without invoking a shell command?
I have an application using Spring shell version 2.1.11 (we are limited to Java 11) that provides commands to manage external services and a timer task to check the status of those services in the ...
0
votes
0
answers
11
views
IOError Stream close when i'm using spring shell
When I use my application with Scanner() I received error:
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
shell:>2023-06-...
1
vote
1
answer
34
views
Viewing all possible Application property values
Where is the best place to look at to find an exhaustive list of Spring Application.properties list?
I have looked everywhere but I was unable to find a complete list of possible Spring application....
0
votes
1
answer
108
views
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?
0
votes
0
answers
183
views
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:
<groupId>es.uca.dss.sigeca</groupId&...
0
votes
1
answer
51
views
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, ...
0
votes
0
answers
85
views
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 ...
0
votes
0
answers
20
views
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 ...
1
vote
1
answer
155
views
Spring shell 3 - StringInputContext not prompting for input?
I set up a new project using spring-boot(-shell) 3.0.3 and I'm just trying to capture some inputs and return them. When I pass in the arguments using ShellOption everything works fine, but I wanted to ...
0
votes
0
answers
63
views
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....
0
votes
1
answer
129
views
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 ...
0
votes
1
answer
47
views
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
...
0
votes
0
answers
40
views
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 = ["...
1
vote
2
answers
360
views
Spring Shell components don't show up
I'm trying to use the Spring Shell built-in components StringInput, PathInput, ConfirmationInput, SingleSelect and MultiSelect. Each time I try and use one of these by executing the run() method they ...
0
votes
1
answer
836
views
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 ...
1
vote
1
answer
164
views
How to pass varargs in Spring shell with kotlin
I am trying to write a spring shell app and pass some var args. Basicaly I want to pass
fetch FA-207542 FA-207984 FA-211258 FA-202298
Documentation here is still TBD
@ShellMethod(value = "...
0
votes
1
answer
114
views
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 %...
0
votes
1
answer
215
views
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 = ...
0
votes
1
answer
205
views
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 ...
0
votes
1
answer
39
views
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
<dependency>
<groupId>org.springframework.shell</groupId>
<artifactId&...
1
vote
0
answers
87
views
NullPointerException while starting Spring Shell on Heroku worker node
Recently we are facing an issue that we cannot start our Spring Shell app on our Heroku worker node anymore. Directly after the shell app has started the console just prints java.lang....
0
votes
0
answers
458
views
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 ...
0
votes
1
answer
594
views
Run spring boot shell as daemon
I have an Spring boot web-application with an interactive shell for configuration. I want to run my app as daemon to start server. When I run it normally using java -jar app.jar I get an interactive ...
1
vote
2
answers
3k
views
Autowired/Dependencies injection doesn't work in a Spring Shell project
I started a new project from https://www.baeldung.com/spring-shell-cli
I was trying to use dependency injection or Autowired annotation on my BannerProvider class. But Spring raise an exception.
My ...
1
vote
1
answer
876
views
Spring Shell fails when running in jar
I am building a shell application using Spring shell. At this point, everything is running fine on intelliJ, meaning I can run my commands without any problems.
I am using JPA with hibernate being the ...
0
votes
1
answer
641
views
Spring shell with command line runner interface
I have a problem while running spring boot spring shell application. I have implemented commandlinerunner but its never called during application startup.
@Component
public class ParamReader ...
1
vote
1
answer
4k
views
java.lang.ClassNotFoundException: org.springframework.core.ErrorCoded
I am using below dependencies in my spring boot shell application.
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>...
6
votes
1
answer
842
views
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 ...
0
votes
0
answers
161
views
Using a JavaFX TextArea control as the terminal of an spring-shell app
I am working in a tool which requires the user to interact with a console and for each typed command there is a graphic representation with the result of the command. I would like to have a single ...
0
votes
1
answer
558
views
Using Spring Shell with Tomcat
As described here:
https://github.com/indrabasak/spring-shell-example
most of spring shell projects are launched by this way:
mvn clean install
then
java -jar target/[generated_jar]jar
Now, ...
-1
votes
1
answer
665
views
How can i access through ssh spring shell cli
I am trying to implement a simple cli application ( executable jar file running in linux docker image) using spring-shell library. After i started the Docker image with "docker run -it -p 8080:8080 ...
2
votes
1
answer
1k
views
Integrating Spring-Shell with the MongoDb driver
Is it me, or are the MongoDb drivers and Spring-Shell deeply incompatible? To start, I'm not talking about the Spring-Data-Mongo stuff, I'm talking about the actual java client that the MongoDb folks ...
2
votes
1
answer
2k
views
Change spring-shell.log location
I'm having some trouble with my spring-shell.log. Not a big problem but really annoying. Once I run my application from outside of my workspace, spring shell tries to save the spring-shell.log in a ...
5
votes
1
answer
2k
views
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,
...
2
votes
1
answer
1k
views
How to mask an input string in Spring-Shell
I am using Spring-Shell and I would like to mask the input when typing the password field for a particular method.
Looking on the internet and here in the forum, I found many people suggesting to use ...
1
vote
1
answer
101
views
Print Fixed Lines with Spring Shell
I want to develop a small Sprint Shell project where I display static information which potentially updates when an event is received. Is this functionality possible with Spring Shell, or is it even ...
3
votes
1
answer
2k
views
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 ...
2
votes
1
answer
1k
views
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?
1
vote
1
answer
505
views
Parameter resolving /converter for dynamically registered commands
I am working on a Spring Shell 2 CLI and i am trying to generate commands at runtime from a defined interface through reflection.
Update: The implementation of the interface is also generated at ...
0
votes
1
answer
704
views
How do I set color of user input in Spring Shell 2?
I have a similar question to:
Commands color in spring shell 2 but I am more interested in how I can override the color of user input.
When I open my Spring Shell 2 application and start typing a ...
0
votes
2
answers
121
views
Go back to Spring shell prompt after printing to Stdout
I'm currently working with Spring Shell. My problem is that whenever I print something to stdout, the program doesn't go back to the prompt unless the user presses the Enter button. Are there possible ...
0
votes
1
answer
386
views
Executing OS Commands from Spring Shell
I'm using
org.springframework.shell:spring-shell-starter:2.0.0.RELEASE
With gradle and Spring
My question is:
Is there anyway to open vi or vim to edit a file in the OS from the shell?. if not ...
0
votes
1
answer
512
views
Commands color in spring shell 2
In SPRING SHELL 2 the default incorrect command and error output colors are red. Is it possible to define custom colors for these purposes?
Thank you!
0
votes
1
answer
133
views
Spring shell vs JMX
While studying about spring-boot, I stumbled upon shell support (CRsh (boot v1.x)
Spring-Shell (boot v2.x)).
What I am not able to understand is we already have a rich support for JMX which has been ...