= Spring Shell image:https://github.com/spring-projects/spring-shell/actions/workflows/ci.yml/badge.svg["CI", link="https://github.com/spring-projects/spring-shell/actions/workflows/ci.yml"]
== Latest news
- December 30, 2025: https://spring.io/blog/2025/12/30/spring-shell-4-0-0-ga-released[Spring Shell 4.0.0 released!]
- December 19, 2025: https://spring.io/blog/2025/12/19/spring-shell-4-0-0-rc1-released[Spring Shell 4.0.0-RC1 available now]
- December 9, 2025: https://spring.io/blog/2025/12/09/spring-shell-4-0-0-m2-released[Spring Shell 4.0.0-M2 is out!]
- October 24, 2025: https://spring.io/blog/2025/10/24/spring-shell-4-0-0-m1-released[Spring Shell 4.0.0-M1 is available!]
- August 4, 2025: https://spring.io/blog/2025/08/04/spring-shell-3-4-1-available[Spring Shell 3.4.1 is now available]
== About Spring Shell
Spring Shell helps you create Spring-powered, production-grade applications targeting the CLI space. It takes an opinionated view of the Spring platform so that new and existing users can quickly get the bits they need.
You can use Spring Shell to create stand-alone Java applications that can be started using java -jar or more sophisticated GraalVM native ways to create platform dependant apps.
Our primary goals are:
- Provide a fast and accessible getting started experience for shell development.
- Be opinionated, but get out of the way quickly as requirements start to diverge from the defaults.
== Installation and Getting Started
Go to https://start.spring.io[start.spring.io] and generate a new project with Spring Shell dependency. Here is a quick link to generate a Maven project with Spring Shell dependency: https://start.spring.io/#!type=maven-project&language=java&platformVersion=4.0.1&packaging=jar&configurationFileFormat=properties&jvmVersion=17&groupId=com.example&artifactId=demo&name=demo&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.demo&dependencies=spring-shell[Spring Initializr link].
Unzip the generated project and open it in your favorite IDE. Now edit the main application class DemoApplication and add the following command:
import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.shell.core.command.annotation.Command;
@SpringBootApplication public class DemoApplication {
@Command
public String hi() {
return "hi";
}
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
Build the application using Maven:
After building the application, you can run it in interactive mode as an executable jar:
$>java -jar target/demo-0.0.1-SNAPSHOT.jar
shell:>help AVAILABLE COMMANDS
Built-In Commands history: Display or save the history of previously run commands clear: Clear the terminal screen help: Display help about available commands quit, exit: Exit the shell version: Show version info script: Execute commands from a script file SpringShellApplication Commands hi: N/A
== Tutorials and Sample apps
You can find complete tutorials and sample applications in the spring-shell-samples repository:
- https://github.com/spring-projects/spring-shell/tree/main/spring-shell-samples/spring-shell-sample-hello-world[Hello World Spring Shell application]
- https://github.com/spring-projects/spring-shell/tree/main/spring-shell-samples/spring-shell-sample-spring-boot[Hello World Spring Shell application with Spring Boot]
- https://github.com/spring-projects/spring-shell/tree/main/spring-shell-samples/spring-shell-sample-petclinic[Spring Pet Clinic CLI application]
- https://github.com/spring-projects/spring-shell/tree/main/spring-shell-samples/spring-shell-sample-non-interactive[Non-interactive Spring Shell application]
- https://github.com/spring-projects/spring-shell/tree/main/spring-shell-samples/spring-shell-sample-secure-input[Spring Shell application to demonstrate secure input]
== Getting Help Are you having trouble with Spring Shell? We want to help!
Join our https://github.com/spring-projects/spring-shell/discussions[GitHub Discussion] section and post your question there.
== Reporting Issues Spring Shell uses https://github.com/spring-projects/spring-shell/issues[GitHub Issues] to record bugs and feature requests. If you want to raise an issue, please follow the recommendations below:
- Before you log a bug, please search the issue tracker to see if someone has already reported the problem.
- If the issue doesn't already exist, create a new issue.
- Please provide as much information as possible with the issue report. We need to know the Spring Boot and Shell version, operating system, and the JVM version you're using.
- If you need to paste code or include a stack trace, please use Markdown's +++```+++ escapes before and after your text.
- If possible, try to create a test case or project that replicates the problem and attach it to the issue.
== Building from Source Building and running tests:
$>git clone git@github.com:spring-projects/spring-shell.git $>cd spring-shell $>./mvnw install
== Building the Documentation
The documentation is built using Antora and can be run using the Antora Maven plugin.
After running the command, you can view the site for this branch in spring-shell-docs/target/site.
== License Spring Shell is Open Source software released under the https://www.apache.org/licenses/LICENSE-2.0.html[Apache 2.0 license].