custom-cli-alerts v3.0.3
Custom CLI Alerts āØ
š¤ Why Custom CLI Alerts?
Customization of any kind is great, but customizing CLI UI is just amazing! I wanted to have something I could use in my project that is easy, has minimal dependencies and can be personalised with colors and emojis:
- šØ Beautiful Output: Enhances user experience with visually appealing alerts using Catppuccin's color palette
- āļø Customizable: Change symbols, colors, and styles per alert or globally
- ⨠Modern UI: Powered by Clack for spinners and animations
- š”ļø Type-Safe: Built with TypeScript for reliable development
- š Cross-Platform: Works seamlessly on Windows, MacOS, and Linux
- š Zero Configuration: Works out of the box with sensible defaults
Perfect for CLI tools, dev utilities, and any Node.js application needing that extra touch of polish. š
š Visual Examples
Default Alerts
// Success
alert({ type: "success", message: "Task completed!" });
// Info with description
alert({
type: "info",
message: "New version available",
description: "UPDATE",
});
// Warning with spinner
alert({
type: "warning",
message: "Processing...",
description: "LOADING",
});
// Error
alert({
type: "error",
message: "Operation failed",
});
Custom Styled Alerts
// Custom symbols
configure({
symbols: {
success: "š",
info: "š”",
warning: "ā”",
error: "š„",
},
});
// Custom colors
alert({
type: "info",
message: "Custom style",
style: {
symbol: "ā",
color: chalk.hex("#FF69B4"),
},
});
⨠Features
šØ Custom colors and symbols š Powered by Clack for beautiful UI ā” Spinners and animations šÆ TypeScript support š§ Cross-platform (Windows, MacOS, Linux)
š Installation
# with Node
npm install stylish-cli-alerts
# run without Node
npx stylish-cli-alerts
š® Usage
typescriptCopyimport alert, { configure } from 'stylish-cli-alerts';
// Basic usage
alert({ type: "success", message: "Task completed!" });
// Custom styling
configure({
symbols: {
success: 'š',
info: 'š”'
}
});
// Per-alert styling
alert({
type: "info",
message: "Custom style",
style: {
symbol: 'ā',
color: chalk.hex('#FF69B4')
}
});
š ļø Tech Stack
šØ Color Palette
Styled with Catppuccin's beautiful palette:
- Success:
#179299
(Teal) - Error:
#e64553
(Red) - Info:
#7287fd
(Blue) - Warning:
#df8e1d
(Yellow)
Special thanks to the Catppuccin team for their wonderful color scheme.
š¤ Contributing
Fork the Project Create Feature Branch (git checkout -b feature/amazing) Commit Changes (git commit -m 'Add feature') Push Branch (git push origin feature/amazing) Open Pull Request
š Acknowledgments
Special thanks to:
- natemoo-re for Clack's beautiful prompts
- chalk team for terminal styling
- Ahmad Awais for inspiration from better-cli-alerts
- Catppuccin for their beautiful color palette
- All contributors and the open source community
š License MIT License - see LICENSE file