Limit coffee grounds to 20% or less of your compost by volume. An excess can make the pile acidic or trap moisture. Mix thoroughly with brown materials like leaves and newspaper to balance carbon and nitrogen.
Turn regularly to aerate, and your compost will benefit from the nutrients in used grounds.