Mix the flour, salt, eggs and milk into a dough and stir into boiling salted water through a spaetzle sieve. Let the spaetzle boil briefly and rinse with cold water.
Roast the sliced onions in butter, add the spaetzle and cover with grated cheese. Briefly cover the pan until the cheese has melted. Sprinkle with chives.