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, all promptable options must be passed explicitly; otherwise the CLI exits with an error listing missing options and defaults. --force recursively deletes a non-empty target directory only after create options have been validated.

See Create a project.

List and run project scripts ​

bash
springboot-cli run [script]

Reads the scripts object from springboot-cli.json.

  • Bare springboot-cli run lists every configured script in alphabetical order and starts no child process.
  • springboot-cli run <script> executes exactly the named script.
  • An unknown script fails and lists the available names.
  • With no configured scripts, bare run prints an empty-state message and exits successfully. An explicit name fails.

Scripts are shell command strings. They execute from the project root with the project-root .env values and with the project root prepended to PATH. Arguments after the script name, including values after --, are ignored. The CLI exits with the script's exit code; a non-zero exit is reported as an error naming the script and command.

With --json, listing returns result.scripts as { name, command } entries in alphabetical order. Explicit execution returns result.script, result.command, and result.exitCode on success; failures use the standard error envelope with the script's exit code.

create writes scripts.start = "mvnw spring-boot:run" and scripts.test = "mvnw test". Use springboot-cli run start and springboot-cli run test to execute them. There is no dedicated test command and no implicit start execution.

scripts runs arbitrary shell commands with your user permissions. Only execute scripts from projects you trust; bare run is safe for inspection. See Run scripts.

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.

Validate an entity schema ​

bash
springboot-cli schema validate

Reads the schema configured by project.schemaFile (default schema.json) and reports blocking schema or relationship errors separately from warnings. Warnings include duplicate database table/column mappings and entity files that schema apply would overwrite. Validation does not write project files and exits unsuccessfully when blocking errors are found. schema apply runs the same preflight before generating files.

Apply an entity schema ​

bash
springboot-cli schema apply [--force]

Runs the shared schema preflight, then 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.

Open the project in an editor ​

bash
springboot-cli open [path] [--editor <command>]

Opens the project root, or the given file or directory, in an editor. Paths are resolved relative to the current directory. The editor is selected in this order:

  1. --editor <command>
  2. editor in springboot-cli.json
  3. $VISUAL
  4. $EDITOR
  5. VS Code (code) or IntelliJ IDEA (idea) on PATH

The editor command may include arguments and quoted paths. If no editor is found, the command fails with configuration guidance. With --json, the result contains editor, editorSource (flag, config, visual, editor, or auto), and path.

Open the Spring Boot documentation ​

bash
springboot-cli doc

Opens the Spring Boot documentation for project.springBootVersion in the default browser. Spring Boot 3.3 and newer use the major.minor reference URL (https://docs.spring.io/spring-boot/<major>.<minor>/reference/index.html); older versions use the exact-version URL (https://docs.spring.io/spring-boot/docs/<version>/reference/html/). The browser is $BROWSER when set, otherwise the platform's default opener (xdg-open with gio/sensible-browser fallbacks on Linux, open on macOS, or cmd /c start on Windows). With --json, the result contains version and url.

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
--jsonEmit a structured JSON envelope (ok, command, result, warnings, error) to standard output.
--quietSuppress non-essential output (info, success, warn, verbose, and spinners), keeping only errors.
--verboseEnable verbose diagnostic output.
-h, --helpShow help for the CLI or a command.
-v, --versionShow the installed springboot-cli version.

Colors and interactive spinners are automatically disabled in CI (CI=true), when stdout is not a TTY, or when NO_COLOR is set to a non-empty value (colors disabled).

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