Finely chop green onion and puree with the eggs in a food processor (do not use a blender!).
In a med. bowl, add flour, 1 tsp salt, and mix then make a well in the center. Add the onion, egg mixture ( from the food processor) and chopped herbs. Using a fork, pull the flour from the sides of the bowl into the liquid until mixed. The dough should not be too runny, but keep in mind that the thicker it gets, the harder it will be to make the spaetzle. Add milk if needed. Let rest for 15 minutes.
Bring plenty of salted water to a boil. Use a ‘Spaetzlehobel’, a food mill, a colander, or your fingertips to let little droplets of dough drop into the water. As soon as they rise, they are done. Layer in a oven proof bowl with the cheese, keep warm in a 280 F oven.
To make the topping, cut the onions in slices then in quarters, quarter and de-seed the pears, do not peel if using fresh. Cut the pears in small cubes. Heat the butter in a skillet, until it foams, add onions and fry slowly to a light brown, 10 minutes or more. Turn them often, they may burn. Add the drained spaetzle. Add almonds and pears, fry for another 4 minutes. Adjust taste. If using canned pears, add last and warm lightly.
Serve immediately with the gruyere cheese. Can be reheated as leftovers.