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
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.
| Option | Description | Default |
|---|---|---|
-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, --force | Delete 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
springboot-cli run [script]Reads the scripts object from springboot-cli.json.
- Bare
springboot-cli runlists 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
runprints 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
springboot-cli add <component> [options]Supported components are controller, service, repository, entity, dto, config, listener, and exception.
| Option | Description |
|---|---|
-n, --name <name> | Logical component name. If omitted, the CLI prompts for one. |
-f, --force | Overwrite 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
springboot-cli scaffold <resource> [options]Generates an entity, DTO, repository, service, and controller for the resource.
| Option | Description |
|---|---|
-n, --name <name> | Use this logical name instead of <resource>. |
-f, --force | Overwrite generated files that already exist. |
Validate an entity schema
springboot-cli schema validateReads 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
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
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
springboot-cli deps list
springboot-cli deps upgradelist 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
springboot-cli env syncCompares 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
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:
--editor <command>editorinspringboot-cli.json$VISUAL$EDITOR- VS Code (
code) or IntelliJ IDEA (idea) onPATH
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
springboot-cli docOpens 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.
Print shell completions
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
| Option | Description |
|---|---|
--json | Emit a structured JSON envelope (ok, command, result, warnings, error) to standard output. |
--quiet | Suppress non-essential output (info, success, warn, verbose, and spinners), keeping only errors. |
--verbose | Enable verbose diagnostic output. |
-h, --help | Show help for the CLI or a command. |
-v, --version | Show 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.