xspring: The Interactive Spring Boot Project Generator
xspring is a powerful, modern command-line interface (CLI) for creating and configuring Spring Boot applications. Built for ease of use and developer productivity while levaraging the speed of Rust, xspring provides an interactive, guided experience that streamlines project setup, from simple web applications to complex microservices. It combines the flexibility of the official Spring Initializr with the convenience of a fast, local, and feature-rich tool.
Whether you're a seasoned Spring developer who values automation or a newcomer learning the ecosystem, xspring is designed to get you from idea to public static void main in seconds.
Core Features
- Interactive by Default: Run
xspringwith no arguments to enter a step-by-step guided mode. It prompts you for everything needed to create a project, including:- Project metadata (Group ID, Artifact ID, Name, Description)
- Build tool (Maven or Gradle)
- Language (Java, Kotlin, or Groovy)
- Spring Boot version
- Packaging (Jar or War)
- Java version
- Dependencies
- Intelligent Fuzzy-Finding: Forget memorizing exact option names. Simply start typing to filter through choices for dependencies, Spring Boot versions, languages, and more.
- Example: Typing
secmight suggestSpring Security. - Navigate suggestions with arrow keys and select your desired thing.
- Example: Typing
- Accelerated Setup With Quick Interactivity: Use the
quicksubcommand for a faster, streamlined project setup with sensible defaults.- use
-eor--extendedflag to scaffold a project more quickly - use
-mor--mavenif you prefer to change the default project type - use
-dor--depsto add dependencies to your project interactively
- use
- Discoverability and Exploration: xspring helps you explore the Spring ecosystem without leaving your terminal.
xspring list --depsor-d: Browse all available dependencies by category.xspring list --bootor-b: See a list of supported Spring Boot versions (stable, milestone, and snapshot).xspring list --javaor-j: Check the available Java runtimes.xspring list --typeor-t: Check the available project types.xspring list --languageor-l: Check the available languages.
Why Use xspring?
- Speed: Written in Rust, xspring is incredibly fast and responsive.
- User-Friendly: Its interactive nature makes it accessible to developers of all skill levels.
- Reduces Errors: By guiding the user, it helps prevent typos and misconfigurations.
- Boosts Productivity: Automates the repetitive boilerplate of starting a new project, letting you focus on writing code.
- Modern Tooling: Brings a CLI experience on par with tools from other ecosystems like
create-react-apporcargo.
Installation
You can install xspring from Crates.io:
Usage
Interactive Mode
Run xspring with no arguments to enter the interactive mode:
Quick-Interactive Mode
For a faster setup, you can use the quick subcommand. This mode uses sensible defaults for most options, only prompting for the essential information.
Default Quick Mode
By default, the quick subcommand will prompt for the Group ID, Artifact ID, Display Name, and Description.
Extended Quick Mode (-e or --extended)
You can further streamline the process with the -e or --extended flag, which uses default values for the Display Name and Description, only prompting for the Group ID and Artifact ID.
Dependencies Flag (-d or --deps)
The -d or --deps flag allows you to select dependencies for your project. This can be combined with other flags.
Maven Flag (-m or --maven)
By default, the quick subcommand uses Gradle as the project type. The -m or --maven flag allows you to override this and set the project type to Maven without prompting. This can be combined with either of the above modes.
Listing Options
- List Dependencies:
xspring list -dorxspring list --deps - List Spring Boot Versions:
xspring list -borxspring list --boot - List Java Versions:
xspring list -jorxspring list --java - List Project Types(Ex. Maven):
xspring list -torxspring list --type - List Languages:
xspring list -lorxspring list --language
# List all available dependencies
# List all supported Java versions
Output Directory
-
-oor--output: Specify a directory to output the generated project to.
Logging
xspring creates daily rotating log files in a logs directory in the directory where it is executed.
You can control the log verbosity with the following flags:
-v, --verbose: Increases the verbosity of the output. Can be used multiple times to increase the level of detail (e.g.,-vfor warnings,-vvfor info,-vvvfor debug,-vvvvfor trace).-q, --quiet: Suppresses all output except for errors.
# Run with verbose output to show debug information
# Run in quiet mode
Building from Source
- Clone the repository:
- Navigate to the project directory:
- Install the project:
- The executable will be in
~/.cargo/bin/xspring.
License
This project is licensed under either of the following, at your option:
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue.