A modern, extensible Java CLI showcasing algorithms, utilities, and a rich terminal printing toolkit (colors, progress bars, tables, spinners). Built with Java 21 and Gradle. Perfect for demos, interviews, and as a base for premium CLI tooling.
- Features
- Quick Start
- Run It
- Usage
- Command Reference
- PrintHelpers (UI/UX Toolkit)
- Configuration
- Architecture
- Extending with New Commands
- Packaging & Distribution
- Tech Stack
- Why It Stands Out
- Screenshots
- Releases
- Roadmap
- Pro / Premium Edition
- Contributing
- License
- Changelog
- Fast, friendly CLI with discoverable
helptopics - Math utilities: sum, average, min, max
- Array utilities: sort, reverse, unique
- Generators: random arrays, maps, matrices
- Rich terminal printing helpers:
- Colors, titles, sections, separators
- Multi-line boxes, spinners, progress bars, ASCII tables
- Fluent logging builder with levels (INFO, WARN, SUCCESS, ERROR, DEBUG, TRACE)
- Configurable colors and timestamp format
- Clean, testable command registry pattern (easy to add new commands)
Requirements:
- Java 21+
- Git
Clone and build (Windows cmd):
git clone https://github.com/senanqulamov/JavaDays.git
cd JavaDays
.\gradlew.bat buildRun from Gradle (Windows cmd):
.\gradlew.bat runRun the packaged JAR:
java -jar build\libs\JavaDays-1.0.0.jarNote: ANSI colors are supported on most modern terminals. On older Windows shells, enable "Virtual Terminal Processing" or use Windows Terminal/PowerShell.
When you start the app you’ll see a short progress bar, a title, and a welcome box. At the prompt, type commands and press Enter.
Example session:
jvd> help
jvd> generate array 5
jvd> sum 1 2 3 4 5
jvd> array sort 5 2 8 1 9
jvd> generate matrix 3 4
jvd> exit
Core global commands:
helporh— Show help and topicsversionorv— Show application versionexitorquit— Quit the CLI
Help topics:
help sumhelp generatehelp arrayhelp map
Generators:
generate sum [count]— Generate random array and print sumgenerate array [count]— Generate a random arraygenerate map [size]— Generate random key/value pairsgenerate matrix [rows] [cols]— Generate a 2D matrix
Math:
sum <numbers...>avg <numbers...>max <numbers...>min <numbers...>
Array ops:
array sort <numbers...>array reverse <numbers...>array unique <numbers...>
Defaults and limits:
- Default generated size: 10
- Max array/map size: 100,000
- Random values range: 0–99
Quick reference for all built-ins (abbreviations included):
| Command | Description |
|---|---|
help, h |
Show general help |
help sum |
Help for sum operations |
help generate |
Help for generate commands |
help array |
Help for array operations |
help map |
Help for map generation |
version, v |
Show version |
exit, quit |
Exit application |
generate sum [count] |
Generate array and print sum |
generate array [count] |
Generate and display array |
generate map [size] |
Generate random map |
generate matrix [rows] [cols] |
Generate a 2D matrix |
sum <n...> |
Sum numbers |
avg <n...> |
Average of numbers |
max <n...> |
Maximum value |
min <n...> |
Minimum value |
array sort <n...> |
Sort ascending |
array reverse <n...> |
Reverse input |
array unique <n...> |
Unique elements |
The jvd.Helpers.PrintHelpers module powers formatted output. Highlights:
-
Fluent logging API:
import static jvd.Helpers.PrintHelpers.*; log().level(LogLevel.WARNING).message("Low disk space").print(); log().level(LogLevel.INFO).format("User %s logged in", username).print(); log().level(LogLevel.SUCCESS).message("Done").sameLine().print();
-
Colors, titles, sections, separators:
printTitle("JVD CLI"); printSection("Math utilities"); printSeparator();
-
Boxes, progress, spinners, tables:
printBox( "Welcome to the optimized PrintHelpers!", "", "Key improvements:", "• Fluent Builder API", "• Progress bars and tables", "• Better performance with StringBuilder", "• Configurable colors and timestamps" ); for (int i = 0; i <= 100; i++) { printProgressBar(i, 100); Thread.sleep(15); } printSpinner("Executing", 1000); String[] headers = {"Name", "Age", "Role"}; String[][] rows = {{"John","28","Dev"},{"Sarah","32","Manager"}}; printTable(headers, rows);
-
Debug and formatting helpers:
printDebug(() -> expensiveDebugMessage()); printFormattedInfo("Items: %d", items.size());
You can tweak behavior at runtime:
// Toggle debug logs
setDebugMode(true); // or disableDebug(); enableDebug();
// Customize timestamp format
setTimestampFormat(java.time.format.DateTimeFormatter.ofPattern("HH:mm:ss"));
// Customize log level colors
setLevelColor(LogLevel.WARNING, jvd.Helpers.Colors.AnsiColor.CYAN);jvd.Main— entry point. Initializes UI, starts REPL loop.Functions.Commands— command registry and handlers. DeclarativeregisterCommandmapping to handler methods; robust arg parsing helpers.jvd.Helpers.PrintHelpers— rich terminal output utilities (colors, boxes, progress, tables, spinner, builder-style logging).jvd.Helpers.Colors— ANSI color definitions.
Why this approach:
- Simple to extend: add a handler and one registration line.
- Testable: pure handlers operating on a context with parsed args.
- UX-first: consistent, colorful output aids demos and interviews.
Add a command in Functions/Commands.java:
// 1) Register it (in the static initializer)
registerCommand("greet", Commands::handleGreet, "Say hello");
// 2) Implement the handler
private static void handleGreet(CommandContext ctx) {
printSuccess("Hello from JVD!");
}The context helpers make parsing easy:
int count = ctx.getIntArg(0, 10); // first arg or default
int[] numbers = ctx.getIntArrayArgs(); // parse all as intsStandard Gradle build creates:
- Executable JAR:
build/libs/JavaDays-1.0.0.jar - Distributions (zip/tar) with launch scripts:
build/distributions/JavaDays-1.0.0.zip- Windows launcher inside the unzipped folder:
bin/JavaDays.bat
- Windows launcher inside the unzipped folder:
Build:
.\gradlew.bat clean buildRun distribution (after unzip the archive into a folder):
.\bin\JavaDays.bat- Language: Java 21
- Build: Gradle (Application plugin)
- Runtime: Console/Terminal (ANSI colors)
- Dependencies: Standard JDK (no external runtime deps)
- Clear architecture: separation of concerns between UI helpers and command logic
- Extensibility: new commands added with one registration and one handler
- Developer experience: rich formatted output for readable demos
- Performance-minded: StringBuilder usage, lazy debug evaluation, minimal allocations
- Production-ready patterns: configuration knobs, color theming, consistent logging format
Cutting a release publishes build artifacts (JAR + zipped distributions) automatically via GitHub Actions.
Steps:
- Update version in
build.gradleif needed - Commit your changes
- Tag with a semantic version and push the tag:
git tag v1.0.0
git push origin v1.0.0The workflow .github/workflows/release.yml will build and attach:
build/libs/*.jarbuild/distributions/*.zipand.tar
Find releases here: https://github.com/senanqulamov/JavaDays/releases
- Command history and better input editing
- Config file (YAML/JSON) for defaults and theming
- File/JSON logging modes and log rotation
- Unit tests for command handlers and helpers
- More algorithms (searching, sorting variants, stats)
- Plugin system for user-defined commands
A premium version will include:
- Extended logging (file, JSON, structured events)
- Rich themes, light/dark palettes, and branding
- Scripting mode and batch command files
- Performance metrics, benchmarks, and profiling helpers
- Auto-complete, suggestions, and fuzzy matching
- Signed installers and enterprise packaging
Interested in a commercial license or custom features? Reach out to me to discuss a Pro build tailored to your needs.
Issues and PRs are welcome. If you’d like ideas, check the Roadmap. Keep code clean, cohesive and documented. Small, focused PRs are preferred.
See the full guide: CONTRIBUTING.md
MIT © 2025 Senan Qulamov — See LICENSE for details.
Track notable changes in CHANGELOG.md. The release workflow is tag-driven (see Releases).