zli - A Blazing Fast Zig CLI Framework 🚀
Welcome to the
zli repository! This project provides a powerful framework for building command-line tools in Zig. With
zli, you can create ergonomic and high-performance CLI applications with ease.
Table of Contents
- Introduction
- Features
- Installation
- Getting Started
- Usage
- Contributing
- License
- Links
Introduction
zli is designed to simplify the process of building command-line applications. Zig is a low-level programming language that emphasizes performance and safety. By leveraging Zig's strengths,
zli allows developers to focus on functionality without worrying about the underlying complexities.
Features
- Fast Performance: Built on Zig's efficient compilation and execution model.
- Ergonomic Design: Intuitive API that makes it easy to create and manage commands.
- Modular Architecture: Easily extend functionality with custom modules.
- Rich Documentation: Comprehensive guides and examples to help you get started.
- Cross-Platform Support: Works on Windows, macOS, and Linux.
Installation
To get started with
zli, you need to install the framework. Visit the
Releases section to download the latest version. Follow the instructions to install and execute the framework.
Getting Started
After installing
zli, you can create a new CLI application. Here’s how:
- Open your terminal.
- Navigate to the directory where you want to create your project.
- Run the following command to create a new project:
bash
zli create my-cli-app
- Navigate into your new project directory:
bash
cd my-cli-app
- Open the main source file in your favorite text editor.
Usage
Creating commands in
zli is straightforward. Here’s a simple example of how to define a command:
```zig
const std = @import("std");
const zli = @import("zli");
pub fn main() !void {
const app = zli.Application.init("my-cli-app", "1.0.0");
app.command("greet", "Greet the user", greet);
try app.run();
}
fn greet(args: *zli.CommandArgs) !void {
const stdout = std.io.getStdOut().writer();
try stdout.print("Hello, {}!\n", .{args.get("name")});
}
```
Running Your Application
Once you have defined your commands, you can run your application from the terminal:
bash
./my-cli-app greet --name="World"
This will output:
Hello, World!
Contributing
We welcome contributions to
zli! If you have suggestions, improvements, or bug fixes, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or fix.
- Make your changes and commit them.
- Push your branch to your fork.
- Open a pull request.
Please ensure your code adheres to the project's coding standards and includes tests where applicable.
License
zli is licensed under the MIT License. See the
LICENSE file for more details.
Links
For more information and updates, check the
Releases section. You can find the latest downloads and version updates there.
Feel free to explore the repository, contribute, and enhance your command-line tool development experience with
zli!