docs / reference/commandsspringboot-cli

CLI commands ​

Run springboot-cli --help for the installed CLI's help, or springboot-cli <command> --help for command-specific help. Running springboot-cli without arguments also prints the top-level help.

Create a project ​

bash
springboot-cli create <project-name> [options]

Creates a Maven Spring Boot project from Spring Initializr and adds the springboot-cli configuration and package-by-layer starter files.

OptionDescriptionDefault
-g, --groupId <groupId>Maven group ID.com.example
-a, --artifactId <artifactId>Maven artifact ID and application name.<project-name>
-d, --dependencies <deps>Comma-separated Spring Initializr dependency IDs.web,data-jpa,lombok
-j, --java-version <version>Java version: 21, 25, or 26.21
-b, --spring-boot-version <version>Spring Boot version.4.1.1
-f, --forceDelete and replace an existing non-empty project directory.Off

In an interactive terminal, omitted values can be prompted or selected from Spring Initializr metadata. In a non-interactive session the default versions and dependencies are used. --force recursively deletes a non-empty target directory before creating the new project.

See Create a project.

Run an application ​

bash
springboot-cli run

Runs Maven's spring-boot:run goal. The project Maven Wrapper is preferred; system Maven is used when no wrapper is present. An optional project-root .env file is passed to the Maven process.

Run tests ​

bash
springboot-cli test [pattern] [--fails-only]

Runs Maven's test goal. pattern is passed to Surefire as -Dtest=<pattern> and may be a test class or a comma-separated list of test classes.

bash
springboot-cli test ProductServiceTest
springboot-cli test ProductServiceTest,OrderServiceTest
springboot-cli test --fails-only

--fails-only reruns classes with failures or errors found in target/surefire-reports/TEST-*.xml. If no reports contain failed tests, nothing is run. This option takes precedence over pattern.

Add a component ​

bash
springboot-cli add <component> [options]

Supported components are controller, service, repository, entity, dto, config, listener, and exception.

OptionDescription
-n, --name <name>Logical component name. If omitted, the CLI prompts for one.
-f, --forceOverwrite the target component file if it exists.

Generated classes are starter skeletons. add entity creates a plain class; use schema apply for JPA mappings from an entity schema.

Scaffold a CRUD set ​

bash
springboot-cli scaffold <resource> [options]

Generates an entity, DTO, repository, service, and controller for the resource.

OptionDescription
-n, --name <name>Use this logical name instead of <resource>.
-f, --forceOverwrite generated files that already exist.

Apply an entity schema ​

bash
springboot-cli schema apply [--force]

Generates JPA entity classes using the project entity schema file, which defaults to schema.json in the project root. -f, --force overwrites existing entity files. See the entity schema reference.

Generate Docker files ​

bash
springboot-cli dockerize [--force]

Generates Dockerfile, docker-compose.yml, and .dockerignore. -f, --force overwrites existing files. The command creates configuration; it does not build or run the image.

Inspect and upgrade dependencies ​

bash
springboot-cli deps list
springboot-cli deps upgrade

list shows Maven dependencies and checks Maven Central for newer stable versions. upgrade updates eligible explicit dependency versions and a declared Spring Boot parent version. BOM-managed dependencies are not changed.

Check environment keys ​

bash
springboot-cli env sync

Compares the keys in project-root .env.example with .env and reports missing keys. It does not create or edit the files.

bash
springboot-cli completion <shell>

Prints a completion script to standard output for bash, zsh, or fish. Redirect the output to the shell's completion directory. See Shell completions.

Global options ​

OptionDescription
-h, --helpShow help for the CLI or a command.
-v, --versionShow the installed springboot-cli version.

Project commands validate springboot-cli.json when loading the project. The current config supports Maven monolith projects; see the configuration reference.