Cook the spaetzle in boiling salted water with the peas for 2-3 minutes. Wash, clean and halve the tomatoes. Drain pasta and peas, let them drain. Peel onions and garlic. Finely dice garlic, halve onions and cut into thin slices.
Heat butter in a pan and sauté onions and garlic. Add tomatoes and fry for 2-3 minutes. Season with salt and pepper. Mix in the pasta mixture. Put half of the pasta mixture into an ovenproof dish.
Sprinkle half of the cheese on top. Spread the remaining pasta and cheese on top. Bake in the preheated oven (electric cooker: 200 °C/ convection oven: 175 °C/ gas: level 3) for 10-20 minutes. Wash the chives, dab dry and cut into rings.
Sprinkle over the spaetzle.