# spring-shell **Repository Path**: mirrors_spring-projects/spring-shell ## Basic Information - **Project Name**: spring-shell - **Description**: Spring based shell - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-18 - **Last Updated**: 2026-02-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README = 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 * January 31, 2026: https://spring.io/blog/2026/01/31/spring-shell-4-0-1-is-out[Spring Shell 4.0.1 is out!] * December 30, 2025: https://spring.io/blog/2025/12/30/spring-shell-4-0-0-ga-released[Spring Shell 4.0.0 released!] == 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.2&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: [source,java,indent=0] ---- 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: [source,bash] ---- $>./mvnw package -DskipTests ---- After building the application, you can run it in interactive mode as an executable _jar_: [source,bash] ---- $>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 shell:>hi hi ---- == 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: [source,bash] ---- $>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. [source,bash] ---- $>./mvnw antora -pl spring-shell-docs ---- 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].