Alternatively (The One-Line “Optimize” Command)
If you want to do it all in a single fast sweep, gltf-transform has a built-in macro command that combines most of these steps automatically: [1]
bash
for f in *_compressed.glb; do
gltf-transform optimize "$f" "${f%_compressed.glb}_min.glb" --texture-compress webp
done