Cut the tofu and onion into bite-sized pieces.
Beat the eggs and set aside.
Add olive oil to a pan and sauté the onions.
Add the tofu and lightly stir-fry.
Pour in the beaten eggs, spreading them evenly.
Transfer everything to a gratin dish.
Top with cheese and bake in the oven.