Prepare green beans by removing the ends and then cut the green beans on the bias in 1/3" slices.
Heat olive oil in 8" over medium heat. Add slice onions and cook for 3 to 4 minutes. Stir in green beans and continue to cook, stirring occasionally, until green beans are tender and blistering, 6 to 8 minutes. Sprinkle in salt and pepper then create a well in the middle.
Crack eggs into the well, cover, turn heat down, and let cook until egg whites are set and egg yolks are set to the desired consistency, anywhere from 8 to 12 minutes.