Make Spätzle. Preheat oven to 325° F.
Heat butter (or oil) in skillet and sauté onions until tender and lightly browned, about 5 - 10 minutes.
Butter casserole dish. Begin by layering with ½ of the Spätzle, season with salt and pepper, sprinkle with ½ of the cheese. Repeat, ending with the cheese.
Top with the sautéed onions.
Bake, uncovered, about 20 - 30 minutes, or until bubbly and slightly browned on top.