kotlinmicronautcli
Micronaut CLI Template
A ready to go Kotlin Micronaut command line application template with the tooling I like already set up: a Gradle version catalogue, Kotlinter and Detekt, Arrow, Strikt, and GitHub Actions and Dependabot for CI. Click "Use this template" on GitHub to start from it.
A Kotlin-based Micronaut CLI application template with enhanced tooling and testing libraries.
Features
This template extends the base Micronaut CLI application with the following enhancements:
Build & Dependency Management
- Gradle Version Catalogue: Centralized dependency management using
libs.versions.toml - Java 25: Modern Java runtime with toolchain support
Code Quality & Linting
- Kotlinter: Kotlin code formatter and linter following ktlint rules
- Detekt: Static code analysis for Kotlin with custom configuration
Libraries
- Arrow Core: Functional programming library for Kotlin, providing functional data types and utilities
- Strikt: Modern assertion library for Kotlin tests with fluent API
- Includes Arrow integration for functional type assertions
CI/CD & Automation
- GitHub Actions: Automated build workflow running on push and PR to main branch
- Dependabot: Daily automated dependency updates for Gradle dependencies
- Dependency Submission: Automated dependency graph generation for security alerts
CLI Framework
- Picocli: Command-line interface framework integrated with Micronaut
- Configured to return proper exit codes for command execution
How to use this template
Click on the “Use this template” button on the GitHub page to create a new project based on this template.
Once you have created your project, you can update the following parts of the project to start developing your application:
- The project name in
settings.gradle.kts - The project name in
application.properties - Rename the package in the
src/mainandsrc/testdirectories - Update to the same package name in
build.gradle.kts(group,mainClass,micronaut/annotations) - Delete or rename the source code as required