mahiremirhan/zli
📟 A blazing fast Zig CLI framework. Build ergonomic, high-performance command-line tools with ease.
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.
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.
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.
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:
zli create my-cli-app
Navigate into your new project directory:
cd my-cli-app
Open the main source file in your favorite text editor.
Creating commands in zli is straightforward. Here’s a simple example of how to define a command:
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")});
}
Once you have defined your commands, you can run your application from the terminal:
./my-cli-app greet --name="World"
This will output:
Hello, World!
We welcome contributions to zli! If you have suggestions, improvements, or bug fixes, please follow these steps:
Please ensure your code adheres to the project's coding standards and includes tests where applicable.
zli is licensed under the MIT License. See the LICENSE file for more details.
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!