Camera Auotomatic zoom to fit object in the borders

Greetings Blenderers!
Is there a way for a camera to auto zoom in and out to have an object inside all the time,to fit it inside the camera frame. Like this cuboid, while the camera view is locked, all the corners to fit inside the camera, while rotating the world thus the cuboid, and the camera to zoom in and out so that the corners don’t get out of the camera view?

Like this, while im rotating the cube arount the camera to zoom in and out as needed to fit the object always inside the camera view.

I found a command that does that but only once, “Camera fit frame to selected” , but it needs to do that all the time while I move around the object.

Maybe this thing can be helpful to you