Cook pasta according to package directions. Drain and set aside.
In a large skillet, melt butter over medium heat. Add sliced onions and cook, stirring occasionally, until softened and caramelized, about 15-20 minutes.
Add minced garlic to the skillet and cook for 1 minute more until fragrant.
Pour in beef broth and bring to a simmer, scraping up any browned bits from the bottom of the skillet.
Stir in heavy cream, Gruyere cheese, and Parmesan cheese. Cook until the cheese is melted and the sauce is thickened.
Season with salt and black pepper to taste.
Add the cooked pasta to the skillet with the sauce and toss to combine. Serve immediately.
Notes
Garnish with extra cheese and fresh parsley if desired.