SBX is a developer productivity CLI designed to simplify and standardize Spring Boot development workflows.
It provides a unified command interface for project creation, dependency management, runtime operations, scaffolding, configuration, diagnostics, and build tool conversion.
Spring Boot development often involves repetitive tasks:
- project setup and initialization
- dependency management
- running and monitoring services
- generating boilerplate code
- environment configuration
SBX provides a consistent CLI experience while staying compatible with Maven/Gradle and enterprise workflows.
- Project bootstrap and initialization
- Dependency management and synchronization
- Build and runtime workflow automation
- Code scaffolding generators
- Configuration helpers
- Diagnostics and environment validation
- Runtime logs and process management
- Build tool conversion (Maven <-> Gradle)
- Java 21+
- Maven 3.8+
mvn clean packagejava -jar target/sbx-0.1.0-SNAPSHOT.jarJar output:
target/sbx-0.1.0-SNAPSHOT.jar
Create a new Spring Boot app:
sbx app new demo-api
cd demo-apiAdd dependency, build, and run:
sbx dependency add spring-boot-starter-data-jpa
sbx build
sbx start --daemon
sbx status --healthInitialize SBX in an existing Spring Boot project:
cd your-existing-project
sbx app init
sbx doctor
- CLI banner
sbx doctoroutputsbx makecommand examples- dependency add/remove flow
SBX is composed of modular components:
- CLI command parser
- Project metadata engine
- Dependency synchronization engine
- Template scaffolding system
- Runtime process manager
- Configuration manager
- Diagnostics engine
Planned improvements:
- multi-module project support
- monolith and microservice workflows
- observability integrations
- advanced configuration automation
- AI-assisted scaffolding from natural language prompts
- plugin ecosystem support
Feedback, testing, and bug reports are welcome.
If you find an issue:
- Open a GitHub issue
- Add clear reproduction steps
- Attach relevant logs/output
Contributions and feature suggestions are appreciated.
sbx [OPTIONS] [COMMAND]Global options:
-h,--help: show command help.-V,--version: show SBX version.
Top-level commands:
appbuildcleanstartstopstatuslogrestartdoctordependencymakeconfigconvert
Purpose: Create a new project or initialize SBX in an existing project.
Purpose: Generate a new Spring Boot project and create sbx.json.
Syntax:
sbx app new <name> [flags]Argument:
<name>: folder/project name to create.
Flags:
--group-id: Java group ID (example:com.example).--artifact-id: artifact/build name.--package-name: base package for generated Java classes.--description: project description.--java: Java version for project runtime metadata.--boot: Spring Boot version.--build: build system option selected from Initializr metadata.--packaging: output packaging (usuallyjarorwar).--language: project language option from Initializr.--config: app config format. Accepted:propertiesoryaml.--allow-legacy: allow creating project with legacy Spring Boot versions.
Behavior notes:
- Missing values are asked interactively.
- Newer supported versions are fetched from Spring Initializr.
- Legacy versions can be generated via SBX templates.
Examples:
sbx app new my-app --group-id com.example --artifact-id my-app --package-name com.example.myapp
sbx app new my-app --boot 4.0.3 --java 21 --config yamlPurpose: Create sbx.json inside an existing Spring Boot project.
Syntax:
sbx app init [--boot-version <version>]Flags:
--boot-version: override detected Spring Boot version in generatedsbx.json.
Behavior notes:
- Detects build tool, Java, config format, and dependencies.
- Prompts for confirmation before writing
sbx.json.
Purpose: Build the application using the build tool from sbx.json.
Syntax:
sbx build [flags]Flags:
--skip-tests: skip tests during build.--profile <name>: pass profile/build variant (-P...for Maven or profile property for Gradle).--sync: apply dependencies fromsbx.jsonbefore building.
Examples:
sbx build
sbx build --skip-tests --profile prod
sbx build --syncPurpose: Clean build artifacts.
Syntax:
sbx cleanPurpose: Start the Spring Boot app through Maven/Gradle.
Syntax:
sbx start [flags]Flags:
--profile <name>: active Spring profile.--host <address>: bind host/address (server.address).--port <number>: server port (server.port).--debug: enable Spring Boot debug mode.--daemon: run in background and save runtime state forstatus/stop.
Examples:
sbx start
sbx start --profile dev --port 9090
sbx start --daemon --host 0.0.0.0Purpose: Stop the running app using stored process ID.
Syntax:
sbx stopPurpose: Show whether app is running and where.
Syntax:
sbx status [--health]Flags:
--health: also call actuator health endpoint and print UP/DOWN style status.
Purpose: Read app log file.
Syntax:
sbx log [flags]Flags:
-f,--follow: stream log updates continuously.--tail <n>: print lastnlines only.--since <duration>: only show logs when file was modified within duration.- supported suffixes:
s,m,h - examples:
30s,5m,1h
- supported suffixes:
Examples:
sbx log --tail 100
sbx log --since 10m
sbx log -fPurpose: Restart app (stop then start).
Syntax:
sbx restart [--graceful]Flags:
--graceful: attempts graceful shutdown before force kill fallback.
Purpose: Validate SBX setup and project health.
Syntax:
sbx doctorChecks include:
sbx.jsonpresence and schema validity- build tool detection
- Java compatibility (system vs project)
- Spring Boot compatibility checks
- dependency conflict checks (for example MVC + WebFlux)
Purpose: Add, remove, or sync dependencies between sbx.json and build files.
Syntax:
sbx dependency add <keyword|groupId:artifactId[:version]> [flags]Argument:
<input>:- keyword search term, or
- exact Maven coordinates (
groupId:artifactId[:version]).
Flags:
--no-apply: updatesbx.jsononly, do not edit build file.--confirm: skip confirmation prompts.--format: format build file after applying dependency.
Syntax:
sbx dependency remove <groupId:artifactId|searchTerm> [flags]Argument:
<input>: exact coords or text to find matching dependency.
Flags:
--no-apply: remove fromsbx.jsononly.--confirm: skip confirmation prompt.
Syntax:
sbx dependency sync [flags]Flags:
--format: run formatter after sync.--dry-run: preview what would be applied.
Purpose: Generate source files quickly.
Purpose: Generate MVC/REST/CRUD/GraphQL controller.
Flags:
--rest: generate REST controller style.--crud: generate CRUD endpoints and supporting layer.--graphql: generate GraphQL-style controller.--service: generate service and inject it.--model <name>: model name to bind in generated code.--path <path>: custom request mapping path.--versioned: prefix endpoint path with/api/v1behavior.--package <relativePackage>: custom package under base package.--test: also generate test class.--dry-run: print output without writing files.--force: overwrite existing files.
Purpose: Generate CRUD stack (entity + DTO + mapper + controller, optional GraphQL).
Flags:
--graphql: also generate GraphQL files.--lombok: Lombok support where templates allow it.--record: generate DTOs as records.--dry-run: preview only.--force: overwrite existing files.
Purpose: Generate DTO classes.
Flags:
--request: generate request DTO (<Name>RequestDto).--response: generate response DTO (<Name>ResponseDto).--record: generate Java record.--validation: include validation annotations.--from-entity: shape DTO based on entity model.--lombok: use Lombok annotations.--dry-run: preview only.--force: overwrite existing file.
Purpose: Generate JPA entity.
Flags:
--table <tableName>: custom DB table name.--lombok: include Lombok annotations.--uuid: use UUID primary key.--auditable: add created/updated fields.--soft-delete: add soft-delete field.--dry-run: preview only.--force: overwrite existing file.
Purpose: Generate repository interface.
Flags:
--custom: generate non-JPA repository style.--query <methodName>: include query method stub.--dry-run: preview only.--force: overwrite existing file.
Purpose: Generate service interface and/or implementation.
Flags:
--interface: generate only interface.--impl: generate only implementation.--dry-run: preview only.--force: overwrite existing files.
Purpose: Generate mapper class/interface.
Flags:
--dry-run: preview only.--force: overwrite existing file.
Purpose: Generate GraphQL resolver/schema.
Flags:
--query: include query operations.--mutation: include mutation operations.--schema: generate schema only.--dry-run: preview only.--force: overwrite existing files.
Purpose: Generate Flyway migration SQL file.
Flags:
--sql: generate empty SQL migration.--dry-run: preview only.--force: overwrite existing file.
Purpose: Generate domain event class and optional Spring event listener.
Flags:
--payload: add a genericpayloadfield to event class.--listener: also generate a listener class with@EventListener.--dry-run: preview only.--force: overwrite existing files.
Purpose: Generate mail service class and optional HTML template.
Flags:
--template: also generate HTML template undersrc/main/resources/templates/mail/.--async: mark generated send method with@Async.--dry-run: preview only.--force: overwrite existing files.
Purpose: Generate scheduled job scaffold.
Flags:
--cron <expr>: cron schedule (default).--fixed-rate <ms>: fixed-rate scheduler.--fixed-delay <ms>: fixed-delay scheduler.--async: add@Asyncto job method.--dry-run,--force.
Purpose: Generate custom exception and optional global handler.
Flags:
--status <code>: HTTP status used in generated handler.--code <ERR_CODE>: exception code constant.--handler: generateGlobalExceptionHandler.--dry-run,--force.
Purpose: Generate custom Bean Validation annotation and validator.
Flags:
--field-type <type>: value type for validator.--message <text>: default validation message.--groups: include groups guidance comment.--dry-run,--force.
Purpose: Generate JPA Specification helper class.
Flags:
--entity <Entity>: target entity class.--paging: add paging helper.--sorting: add sorting helper.--dry-run,--force.
Purpose: Generate Spring Security config starter.
Flags:
--jwt: include JWT integration TODO section.--roles: include role matcher examples.--method-security: enable method security annotation.--dry-run,--force.
Purpose: Generate cache service scaffold.
Flags:
--provider <caffeine|redis>--ttl <duration>--key-prefix <cacheName>--dry-run,--force.
Purpose: Generate producer/consumer scaffolding (topic/queue style).
Flags:
--topic <name>--group <name>--payload: also generate payload class.--dry-run,--force.
Purpose: Generate MapStruct mapper scaffold.
Flags:
--dto <DtoClass>--component-model <spring|default|...>--update-method: generate update method with@MappingTarget.--dry-run,--force.
Purpose: Generate test class scaffold.
Flags:
--type <unit|integration|webmvc|datajpa>--mockito: include Mockito static import.--dry-run,--force.
Purpose: Generate module package structure and module README.
Flags:
--with-crud: add domain/api/service package markers.--with-event: add event package marker.--with-mail: add mail package marker.--dry-run,--force.
Purpose: Manage configuration modules.
Current module:
db
Purpose: Show DB connections and active default.
Flags:
--profile <profile>: use profile-specific config source.
Purpose: Add/update DB connection.
Flags:
--profile <profile>: profile context.--engine <engineKey>: engine (example: postgres, mysql, h2, sqlite).--host <host>: server host.--port <port>: server port.--database <name>: database/schema name.--username <user>: DB username.--password <password>: DB password.--file <path>: DB file path for file-based engines.--h2-mode <file|mem>: H2 storage mode.--default: make this connection default.
Purpose: Set connection as default.
Flags:
--profile <profile>
Purpose: Remove named connection.
Flags:
--profile <profile>
Purpose: Rename connection key.
Flags:
--profile <profile>
Purpose: Test JDBC connection (named or default).
Flags:
--profile <profile>
Purpose: Validate DB config consistency (default exists, etc.).
Flags:
--profile <profile>
Purpose: Convert project build tool (Maven <-> Gradle).
Syntax:
sbx convert --to <maven|gradle> [flags]Flags:
--to <maven|gradle>: required target build tool.--kotlin: when converting to Gradle, use Kotlin DSL.--no-sync: skip dependency sync after conversion.
Behavior note:
- command asks for confirmation token:
convert-to-<target>.
Create project:
sbx app new demo-api --group-id com.demo --package-name com.demo.apiInitialize existing project:
sbx app init
sbx doctorDependency workflow:
sbx dependency add spring-boot-starter-data-jpa
sbx dependency sync --formatRuntime workflow:
sbx start --daemon --profile dev
sbx status --health
sbx log --tail 100
sbx stopsbx.json not found: runsbx app new <name>orsbx app init.- build tool errors: verify Maven/Gradle is installed and discoverable.
- runtime/log issues: start app with
sbx startfirst.
MIT
Md Asif Mustafa