Buy gnocchi that is ready to be cooked in hot water, or make gnocchi on your own. Start with cooking gnocchi and putting them on the side.
For the sauce: cut onions and shallots into small cubes. Heat oil on the pan and once it's hot, throw onions and shallots on the pan. Caramelize the onions until they are juicy and brown. Then take them out of the hot pan. This makes the base for the chili sauce.
Put butter on the pan with chopped garlic and chopped chili peppers. Fry on the low heat for 2 minutes.
Now add salt and black pepper. Fry for 1 minute. Then pour the whipping cream into the pan and stir well. Let the whipping cream cook with chili and garlic for 2 minutes.
Add parmesan cheese and stir again. Let the cheese melt and once it's melted - add gnocchi.