Get started with spring-cli
spring-cli is a small terminal tool for creating and working with opinionated Spring Boot projects. It downloads a starter from Spring Initializr, adds a layered project structure, and provides commands for common project tasks.
What you need
- The spring-cli executable for your operating system.
- Internet access when creating a project, so the CLI can contact Spring Initializr.
- A
tarutility to unpack the Spring Initializr project archive. - A supported JDK to build and run the generated application: Java 21, 25, or 26.
- The generated Maven Wrapper, or system Maven if the wrapper is unavailable.
The CLI itself is a native executable and does not require Bun, Node.js, or a JVM to start. The generated Spring Boot application does need Java to build and run.
Create your first project
Create a project with explicit Maven coordinates and the Spring Web dependency:
spring-cli create catalog \
--groupId com.example \
--artifactId catalog \
--dependencies web
cd catalog
spring-cli runTo run the generated test suite, open another terminal in the project and use:
spring-cli testIf you omit options, spring-cli can prompt for project details. Its default Java version is 21, Spring Boot version is 4.1.1, and dependency set is web,data-jpa,lombok.
What spring-cli adds
Each project includes a spring-cli.json configuration file, a Maven project from Spring Initializr, and a package-by-layer starting structure. The CLI uses that config to find the project root when you run commands from the project or one of its subdirectories.