Coffee grounds are good, but I always add something else. After boiling eggs, get the shells off and crumble them up and put them on top of the bed. They love it...
Earthworms feed on decomposing organic matter and will eat pretty much anything and everything except for meat and dairy products (they do make earthworm food)... But if your plans are to use them as food for fish or herps, a well balanced diet is of the utmost importance. The most convenient food for this purpose is chicken mash, either chick starter or laying mash, generally, the laying mash has a higher protein content. You can purchase it in small quantities at most feed stores and some of the larger pet shops... Don't go for the cheap stuff.. They need is the finest ground mash available.
Lightly sprinkle the mash on the top of the bedding (never mix food into the bedding),,, after feeding, lightly spray the food, to make it easier for your earthworms to consume it... Don't add additional food until what is there is completely gone... Over feeding them will kill them... Have fun!
Don't use coffee grounds they contain trace amounts of lead it will accumulate in the worms and then build up in whatever animal that they're fed too. Fruits and chicken feed are a good way to go