The Clique class is the main entry point for the library. All components are created through static factory methods.
Parse markup tags to style text:
Clique.parser().print("[red, bold]Error:[/] Something went wrong");Methods:
parser()- Create parser with default configurationparser(ParserConfiguration)- Create parser with custom configuration
Fluent API for building styled strings:
Clique.styleBuilder()
.append("Success: ", ColorCode.GREEN, StyleCode.BOLD)
.append("Operation completed", ColorCode.WHITE)
.print();Methods:
styleBuilder()- Create a new style builder
Create custom RGB colors for use with the style API:
RGBAnsiCode color = Clique.rgb(255, 128, 0);
RGBAnsiCode bgColor = Clique.rgb(255, 128, 0, true); // background colorMethods:
rgb(int r, int g, int b)- Create an RGB foreground colorrgb(int r, int g, int b, boolean background)- Create an RGB color, optionally as background
Create formatted tables with headers and rows.
Clique.table()
.headers("Name", "Age", "Status")
.row("Alice", "25", "Active")
.render();Methods:
table()- Create table with default type and configurationtable(TableType)- Create table with specific typetable(TableConfiguration)- Create table with custom configurationtable(TableType, TableConfiguration)- Full customizationtable(BorderSpec)- Create table with uniform border stylingtable(TableType, BorderSpec)- Create table with specific type and uniform border styling
Available Types:
DEFAULT, COMPACT, BOX_DRAW, ROUNDED_BOX_DRAW, MARKDOWN
Note:
customizableTable()and its overloads are deprecated as of 3.1. Use thetable()methods above instead. They will be removed in a future release.
Single-cell containers for displaying text with borders.
Clique.box()
.autosize()
.content("Your message here")
.render();Methods:
box()- Create box with default type and configurationbox(BoxType)- Create box with specific typebox(BoxConfiguration)- Create box with custom configurationbox(BoxType, BoxConfiguration)- Full customizationbox(BorderSpec)- Create box with uniform border stylingbox(BoxType, BorderSpec)- Create box with specific type and uniform border styling
Available Types:
DEFAULT, CLASSIC, ROUNDED, DOUBLE_LINE
Note:
customizableBox()and its overloads are deprecated as of 3.1. Use thebox()methods above instead. They will be removed in a future release.
A frame is a box-based container for displaying multi-line or structured content.
Clique.frame()
.nest("Line one")
.nest("Line two")
.render();Methods:
frame()- Create frame with default type and configurationframe(BoxType)- Create frame with specific box typeframe(FrameConfiguration)- Create frame with custom configurationframe(BoxType, FrameConfiguration)- Full customizationframe(BorderSpec)- Create frame with uniform border stylingframe(BoxType, BorderSpec)- Create frame with specific type and uniform border styling
Render hierarchical data as an indented tree structure.
Clique.tree("root")
.add("child one")
.add("child two")
.print();Methods:
tree(String label)- Create a tree with the given root labeltree(String label, TreeConfiguration)- Create a tree with custom configuration
Create hierarchical text structures with nested indentation.
Clique.indenter()
.indent("→")
.add("Root item")
.indent("•")
.add("Nested item")
.unindent()
.add("Back to root")
.print();Methods:
indenter()- Create indenter with default configurationindenter(IndenterConfiguration)- Create with custom configuration
Visual feedback for long-running operations.
ProgressBar bar = Clique.progressBar(100);
while (!bar.isDone()) {
bar.tick();
bar.render();
Thread.sleep(50);
}Methods:
progressBar(int total)- Create with default styleprogressBar(int total, ProgressBarConfiguration)- Custom configurationprogressBar(int total, ProgressBarPreset)- Use predefined presetprogressBar(int total, EasingConfiguration)- Create with easing animation
Predefined Styles:
BLOCKS, LINES, BOLD, CLASSIC, DOTS
Register and use color themes in your application.
// Register a single theme
Clique.registerTheme("catppuccin-mocha");
Clique.parser().print("[ctp_mauve]Styled with Catppuccin![/]");
// Register all available themes
Clique.registerAllThemes();Methods:
registerTheme(String name)- Register a single theme by nameregisterThemes(String... themes)- Register multiple themesregisterThemes(Collection<String>)- Register from collectionregisterAllThemes()- Register all available themesdiscoverThemes()- List all available themesfindTheme(String name)- Find a specific theme
Available Themes:
catppuccin-mocha, catppuccin-latte, dracula, gruvbox-dark, gruvbox-light, nord, tokyo-night
Register custom color codes for use in markup.
// Register single style
Clique.registerStyle("error", new RGBColor(255, 0, 0, false));
Clique.parser().print("[error]Custom error color[/]");
// Register multiple styles
Map<String, AnsiCode> styles = Map.of(
"success", new RGBColor(0, 255, 0, false),
"warning", new RGBColor(255, 255, 0, false)
);
Clique.registerStyles(styles);Methods:
registerStyle(String name, AnsiCode code)- Register single styleregisterStyles(Map<String, AnsiCode>)- Register multiple styles
Enable or disable ANSI color output.
//Force disable colors
Clique.enableCliqueColors(false);
// Re enable colors
Clique.enableCliqueColors(true);
// Enable colors (no-arg shorthand)
Clique.enableCliqueColors();Methods:
enableCliqueColors(boolean enable)- Control ANSI color outputenableCliqueColors()- Enable ANSI color output (shorthand)
- Markup Reference - Available colors and styles
- Themes Guide - Using and creating themes