In a saucepan with salted water, boil the asparagus for about 10 minutes, then drain and cut into small pieces. Sauté the asparagus in a pan with a drizzle of extra virgin olive oil, a clove of garlic and the minced onion.
Cook the pasta according to package instructions. In the meantime, beat the egg yolks in a bowl, add pecorino cheese, salt and black pepper to taste, and mix everything. Add a tablespoon of pasta cooking water to loosen the sauce and keep stirring.
Drain the pasta and add it into the pan with the asparagus, then add it to the bowl with the egg sauce, mix and divide into plates. Sprinkle with pecorino and black pepper and serve.