main zmx / examples / README.md
Eric Bower  ·  2026-10-20

zmx package examples #

Usage examples for the zmx Zig package (the programmatic interface in src/lib.zig).

Building #

zig build examples

Installs the example binaries to zig-out/bin/.

Examples #

Using the package from another project #

// build.zig.zon
.dependencies = .{
    .zmx = .{
        .url = "git+https://github.com/you/zmx#<commit>",
        .hash = "...",
    },
},
// build.zig
const zmx = b.dependency("zmx", .{ .target = target, .optimize = optimize });
exe_mod.addImport("zmx", zmx.module("zmx"));
// your source
const zmx = @import("zmx");
const exit_code = try zmx.run(gpa, io, "my-session", &.{"echo", "hi"}, .{});

Notes: