Add rebuild command and fix related fields config generation