Preheat oven to 350°F (175°C) and grease a baking dish.
Cook grits according to package instructions. Stir in butter, milk, and shredded cheese until smooth and creamy.
In a skillet, sauté onion and garlic in oil or butter until soft. Add shrimp and Cajun seasoning; cook until shrimp is just pink.
Combine grits with shrimp mixture and stir in beaten eggs. Mix well and season with salt and pepper.
Pour into prepared baking dish. Sprinkle with extra cheese if desired.
Bake for 30–35 minutes, until set and golden on top. Let cool 10 minutes before serving. Garnish with green onions.