How sdkman/sdkman-cli works
Project type and purpose
• This is an open-source command-line tool (SDKMAN! CLI) written primarily in Bash with a Gradle-driven Groovy test suite and supporting release scripts.
• Purpose: let users on Unix-based systems install, switch, list, and remove SDK versions (called “candidates”) by invoking simple shell commands. It interacts with the remote SDKMAN! REST API and local file system (caching, configuration, unpacking archives).
File structure
• Top level
• bin/ – release wrapper scripts
• src/main/bash/ – all CLI command implementations as shell scripts
• src/jreleaser/ & build.gradle/gradle/ – Gradle build and release config
• contrib/completion/bash/ – shell completion definitions
• src/test/groovy & src/test/resources/features/ – Cucumber BDD tests + fixtures
• Patterns
• Monolithic CLI: no separate frontend/backend, but a layered shell-function architecture
• Test harness over Groovy + Cucumber driving the bash scripts via a stubbed environment
• Config & deployment
• Gradle wrapper for builds, Dockerfile for containerized testing/release
• .github/workflows for CI/CD (build, test, release pipelines)
README for additional insights
• Confirms CLI-only surface, written in Bash, tested with Cucumber
• Notes the eventual migration of core commands to a Rust implementation; this repo will become a wrapper/launcher