For the latest stable version, please use Spring Cli 0.9.0!

Installation

The Spring CLI is available in various formats allowing user to pick their favourite installation method. Downloadable artifacts are available from the Release Page.

Binary Release

  • Windows

  • Linux

  • Mac

  • Generic

Manually
  • spring-cli-standalone-<version>-windows.x86_64.zip - bundled x86 JDK

  • spring-cli-installer-<version>-windows-x86_64.msi - msi installation with bundled x86 JDK

Manually
  • spring-cli-standalone-<version>-linux.x86_64.zip - bundled x86 JDK

  • spring-cli-installer-<version>-1.x86_64.rpm - rpm installation with bundled x86 JDK

  • spring-cli-installer<version>-1_amd64.deb_ - dep installation with bundled x86 JDK

Homebrew Tap
brew tap spring-projects-experimental/spring-cli
brew install spring-cli
Manually
  • spring-cli-standalone-<version>-osx.x86_64.zip - bundled x86 JDK

  • spring-cli-standalone-<version>-osx.aarch64.zip - bundled arm JDK

Homebrew Tap

Tap formula will choose between x86 and aarch64 depending on your brew setup.

brew tap spring-projects-experimental/spring-cli
brew install spring-cli
Manually
  • spring-cli-<version>.jar - plain fatjar, needs separate JDK17 installation

  • spring-cli-<version>.zip - plain fatjar with start scripts, needs separate JDK17 installation

Getting Snapshot Binaries

As the project is evolving quickly in the early days, you can download the Spring Boot uber-jar, Linux and Mac native binaries from the output of GitHub’s Continuous Integration Action.

  • Browse CI artifacts here. Select a CI run by clicking on the latest CI run. On the bottom of that page you will see the section Artifacts and inside that you will see the uber-jar package as a artifacts.zip file.

You can also build the uber-jar from source code, see below.

Building from source

Java 17 installation required

Even if you are using the Spring CLI on a Java 11 or Java 8 based project, the CLI itself needs to have access to an installation of Java 17.

Create a JAVA_HOME environment variable that points to your Java 17 installation. For example, for bash shells

export JAVA_HOME=jdk-install-dir
export PATH=$JAVA_HOME/bin:$PATH

This is required by OpenRewrite, which is used internally.

Build Instructions

git clone https://github.com/spring-projects-experimental/spring-cli $HOME/temp/spring-cli

cd $HOME/temp/spring-cli

./gradlew clean build -x test

Now create an alias to invoke the CLI with the command 'spring'

alias spring='java -jar $HOME/temp/spring-cli/build/libs/spring-cli-0.7.2-SNAPSHOT.jar'

Interactive mode

In addition to running the Spring Boot uber-jar via an alias or running the native binary using spring at the command line, you can enter an interactive mode where the Spring CLI will remain up and running. In this case you do not need to add the spring keyword to execute the commands.

The interactive mode provides command option completion but you can also rely on positional option values.

Command Completion

In non-interactive mode, you can get command completion in your shell by executing the following:

eval "$(java -jar $HOME/temp/spring-cli/build/libs/spring-cli-0.7.4.jar completion bash)"
Homebrew formula sets bash completion if you’ve configured it docs.brew.sh/Shell-Completion.

Getting Help

The command spring help will show help for all the commands.

To get help on a specific command, just type spring help and the command plus sub-command name, e.g. `spring help boot new`bg