I always found that Zig init is a bit annoying, it is either too big, or too has nothing if you use -m flag. For me it is nice to have basic build and then main with hello world, but you can’t keep adding flags for each setup, so I think it would be nice if Zig added some “zig init -c” (–custom) flag where, you would be able to set an environment variable or smth, to point to a folder where you have your perfect init, and it would just copy that. Maybe replace the name the name with the name of the current folder and that’s it.

I guess you could create a tool for that or just use cp, but having build in way would be nice.

There are similar tools, check out this topic: Liza: Zig codebase initializer

I think zig init is made mostly for newcomers to the language, so they have an easy starting point for playing with Zig as a language. If you are already at the level that you are considering making your own template I would recommend doing just that.

I have multiple “init” templates for multiple languages, all I do is clone my template repository and then switch the remote to the new repository.

My recommendation for making your own template is because any template won’t be perfect for every use case and for every person, making your own means you can make it perfect for yourself

Aleod July 30, 2026, 11:41am 4

I agree i have a nice little bash function hat looks like this for cloning them :

function ginit {
    git clone "git@github:aleod/tempalte-$1.git"
    git remote rm origin
}

and i call it like this:

ginit zig
# or with some deps for graphical apps for example
ginit zig-graphics

glfmn July 30, 2026, 12:15pm 5

Would that mean all of your repositories share the same root/initial commit as the template?