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.spring-doc.cn

Binary Release

Manually
  • spring-cli-standalone-<version>-windows.x86_64.zip - bundled x86 JDKspring-doc.cn

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

Manually
  • spring-cli-standalone-<version>-linux.x86_64.zip - bundled x86 JDKspring-doc.cn

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

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

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

  • spring-cli-standalone-<version>-osx.aarch64.zip - bundled arm JDKspring-doc.cn

Homebrew Tap

The Tap formula chooses between x86 and aarch64, depending on your brew setup.spring-doc.cn

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

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

Getting Snapshot Binaries

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

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

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.spring-doc.cn

Create a JAVA_HOME environment variable that points to your Java 17 installation. For example, for bash shells, you can run the following commands:spring-doc.cn

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

This is required by OpenRewrite, which is used internally.spring-doc.cn

Build Instructions

To build the jar yourself, run the following commands:spring-doc.cn

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':spring-doc.cn

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.spring-doc.cn

The interactive mode provides command option completion, but you can also rely on positional option values.spring-doc.cn

Command Completion

In non-interactive mode, you can get command completion in your shell by running the following command:spring-doc.cn

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.spring-doc.cn

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