Installation

The Spring CLI is available in various formats that let you pick your favorite 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-cli-projects/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

The Tap formula chooses between x86 and aarch64, depending on your brew setup.

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

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

Getting Snapshot Binaries

Latest snapshot binaries are available in a GitHub Releases early-access.

You can also build the uber-jar from source code, as described later on this page.

Building from source

Java 17 Installation Required

Even if you use the Spring CLI on a Java 11 or Java 8 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, you can run the following commands:

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

This is required by OpenRewrite, which is used internally.

Build Instructions

To build the jar yourself, run the following commands:

git clone https://github.com/spring-projects/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 a command of 'spring':

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

Interactive Mode

In addition to running the Spring Boot uber-jar with an alias or running the native binary by using spring at the command line, you can enter an interactive mode where the Spring CLI continues to run. In this case, you need not add the spring keyword to run 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 running the following command:

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

Getting Help

The spring help command shows help for all the commands.

To get help on a specific command, type spring help and the command plus sub-command name — for example, spring help boot new.