JUsernameGenerator is a flexible, object-oriented username generation library and CLI tool for Java.
It provides a modular architecture for generating usernames programmatically or via command-line, designed for extensibility and clean code.
- Object-oriented design with modular generator components
- Extensible architecture with custom component support
- Pattern-based username generation (e.g.,
{prefix:usr}_{word}_{num:3}) - Builder API for programmatic composition
- Command-line interface (CLI)
- Future support for graphical user interface (GUI)
com.t0xk.jusernamegenerator
├── api/ # Public builders and factories
├── config/ # Configuration and defaults
├── core/ # Core generation logic
│ ├── generator/
│ │ ├── component/ # Interfaces and base contracts
│ │ └── component/implementations/ # Concrete component implementations
│ └── parser/ # Syntax parsing logic
├── exception/ # Custom exceptions
├── ui/ # User interfaces (CLI, GUI)
│ ├── cli/
│ └── gui/
└── Main.java # Entry point
- Java 17+
- Maven 3.8+ or IntelliJ IDEA with Maven support
git clone https://github.com/t0xk/jusernamegenerator.git
cd jusernamegeneratormvn clean packageThis produces an executable JAR file at:
target/JUsernameGenerator-1.0.0.jar
java -jar target/JUsernameGenerator-1.0.0.jar --pattern "{prefix:dev}_{word}_{num:3}" --count 10Example output:
dev_silentwave_937
dev_bravefox_128
dev_cleverhawk_502
Common CLI arguments:
| Argument | Description | Example |
|---|---|---|
--pattern |
Defines the username pattern | {prefix:usr}_{word}_{num:3} |
--seed |
Sets a random seed for reproducible output | --seed 42 |
--count |
Defines how many usernames should be generated | --count 10 |
import com.t0xk.jusernamegenerator.api.builder.UsernameBuilder;
import com.t0xk.jusernamegenerator.config.GeneratorConfig;
public class Example {
public static void main(String[] args) {
GeneratorConfig config = new GeneratorConfig.Builder().build();
String username = new UsernameBuilder(config)
.prefix("usr")
.literal("_")
.word(5)
.literal("_")
.number(3)
.build();
System.out.println(username); // usr_alpha_372
}
}To be determined