CLIKit is a lightweight and versatile library for creating feature-rich command-line interface (CLI) applications in c++. Whether you're building a simple script or a complex tool, CLIKit offers a suite of utilities for text formatting, interactive effects, and user input handling, making CLI development seamless and enjoyable.
- 🎨 Colorized Output: Make your CLI more vibrant with customizable colored messages.
- 🖋️ Input Handling: Supports standard input, masked input (e.g., for passwords), and key-specific input detection.
- ✨ Interactive Effects: Includes dynamic typewriter effects, word-by-word animations, and spinners.
- 📊 Progress Bars: Generate sleek, customizable progress bars for real-time feedback.
- 🖥️ Terminal Utilities: Easily set terminal titles, retrieve terminal dimensions, and more.
- 🛠️ ...and Much More: Packed with tools to simplify and enhance your CLI applications.
Getting started with CLIKit is easy. Follow these steps:
-
Clone the repository:
git clone https://github.com/Plinkon/CLIKit.git
-
Include the header file: Add
CLIKit.h(inside "src/") to your project directory. -
Compile your program: Use any modern C++ compiler
g++ -std=c++17 your_program_name.cpp -o your_program_name
Here’s a simple example showcasing how to create a progress bar with CLIKit:
#include "CLIKit.h"
int main() {
for (int i = 0; i <= 100; ++i) {
std::cout << "\r" << CLIKit::ProgressBar( // create a progress bar
i, 100, 50, "Progress:", "Done", "=", "-",
Color::GREEN, Color::GRAY,
Color::WHITE, Color::LIGHT_GREEN,
Color::WHITE, Color::LIGHT_BLUE,
true, true, true
) << std::flush;
sleep(100); // sleep for 100 milliseconds, built-in function
}
std::cout << std::endl;
return 0;
}💡 Tip: You can also refer to the PrintDemo() function in CLIKit.h to see how all the functions are used.
Dive into the full documentation to explore all available features, utilities, and examples.
CLIKit welcomes contributions from the community! Here’s how you can help:
- Report Bugs: Found an issue? Open an issue.
- Propose Features: Share your ideas for new features.
- Submit Code: Fork the repository, make your changes, and submit a pull request.
-
Fork the repository.
-
Create a new branch for your feature/bug fix:
git checkout -b feature-or-bugfix-name
-
Commit your changes and push to your fork:
git push origin feature-or-bugfix-name
-
Open a pull request with a clear description of your changes.
CLIKit is licensed under the MIT License. See the LICENSE file for details.
If you find CLIKit helpful, consider giving it a ⭐ on GitHub to show your support. Thank you for helping CLIKit grow!
Feel free to share the amazing projects you’ve built with CLIKit! We’d love to showcase your work in the Showcase.
SetConsoleTitle()is known to crash console in some situations when calling. Reason unknown