In a large nonstick frying pan, heat the oil over medium-low heat. Add the onion, and cook 2-3 minutes, until soft and translucent. Stir in the garlic, cumin, chili powder and green chile peppers, and cook for 2 minutes.
If the rice is cold, break it up with your hands as you add it to the pot. Stir well to combine the rice and onion mixture; cook, stirring, for 2-3 minutes until the rice is warmed through. Add in the sofrito and black beans, and stir gently, until the sofrito is incorporated and the beans evenly distributed throughout the rice.
Season with the salt and pepper. Taste, and add more if needed. Serve warm, or cool completely and refrigerate. You can make this up to 2 days in advance; add a few drops of water and reheat in the microwave.