How many miles on the engine??
Dose the truck lack power??
No the truck does not lack power.
When it starts in the early morning it runs rough and almost dies. Check engine light flashes.
This is a common problem with the older v-8 engines on these trucks. GM has a bulletin for this concern: when cold the engine runs rough, engine light may flash and dtc's p0171, p0174 and p0300 set. This is due to a lean engine concern from a vacuum leak. If the engine smoths out and runs normal when it gets warm, its most likely due to a bad intake gaskets. The gaskets let air in at the lower intake which causes the Mass Air Flow sensor to not see this extra air, the computer does not know how much air is entering the engine so it runs lean. The oxygen sensors sense this extra air and the computer will make up for some of it, but will set the p0171 and p0174 codes.
GM has updated the intake gaskets to pervent this from happening, this is why the new engines do not have this issue. Any GM dealer will have the gaskets they cost around $100. Its a easy repair that any shadetree mech can do in about 2 hours.