It turns out that what I was looking for is reduced row-echelon form over Z, which is already implemented in AbstractAlgebra, Nemo and Hecke packages (this discussion helped me find it: Rank is wrong for Rational matrices - #19 by chakravala).
I ended up using AbstractAlgebra, since it’s pure Julia and the most convenient to use.