I am not sure, however I just had a look at the output of zig fetch --help:
Usage: zig fetch [options] <url>
Usage: zig fetch [options] <path>
Copy a package into the global cache and print its hash.
-h, --help Print this help and exit
--global-cache-dir [path] Override path to global Zig cache directory
--debug-hash Print verbose hash information to stdout
--save Add the fetched package to build.zig.zon
--save=[name] Add the fetched package to build.zig.zon as name
So here is my totally untested crazy idea, try if you can combine --global-cache-dir path-to-my-vendor with --save. I haven’t really used fetch directly but my guess is you would have to build the list of external dependencies (deps of deps) and then invoke fetch for each one. Probably there is some easy way to get all the dependencies, but I haven’t looked into it more deeply yet. I don’t know whether the result will work for vendoring, but it may be worth a try until there is a dedicated command.
I haven’t found an explicit vendoring issue, but these 2 mention vendoring: