After soaking the salt cod overnight, drain and rinse it to remove excess salt. Place the cod in a saucepan, cover with fresh water, and bring to a gentle boil. Simmer for about 5 minutes until the fish is cooked through.

Drain, let it cool slightly, then remove any skin and bones. Shred the cod into bite-sized pieces.

If using fresh potatoes, peel and cut them into thin matchsticks. Rinse the potato matchsticks in cold water to remove excess starch, then pat them dry with a clean towel.

In a skillet, heat olive oil over medium-high heat. Fry the potato matchsticks in batches until golden and crispy. Remove and drain on paper towels. Alternatively, if using store-bought straw potatoes, measure out the appropriate amount and set aside.

In a large skillet, heat 2 tablespoons of olive oil over medium heat. Add the sliced onion and sauté until translucent and soft, about 5 minutes. Add the minced garlic and cook for an additional 1-2 minutes until fragrant.

Add the shredded cod to the skillet with the onions and garlic. Sauté for about 3-4 minutes, allowing the flavors to meld. Gently fold in the crispy potato matchsticks, reserving a small handful for garnish if desired.

Reduce the heat to low. Pour the beaten eggs over the cod and potato mixture. Stir gently and continuously to scramble the eggs softly, ensuring they remain creamy and do not overcook.

Season with freshly ground black pepper to taste. Taste before adding any additional salt, as the cod may provide sufficient seasoning.

Once the eggs are just set and still creamy, remove the skillet from heat. Transfer the Bacalhau à Brás to a serving plate. Garnish with black olives, a sprinkle of chopped fresh parsley, and the reserved crispy potatoes if desired. Serve immediately while hot.
