The item ID for Dinosaur Egg in Stardew Valley is:
The above cheat code applies to all platforms including PC/Mac (Steam), XBOX One, PS4 and the Nintendo Switch.
Spawning items in Stardew Valley is not done via commands, but rather through a cheat in which you must set your character's name, or the name of an animal, to the item code of the item you wish to spawn surrounded by [ and ].
To spawn this item using an animal's name, visit Marnie's Ranch, speak to Marnie and purchase an animal (we recommend a chicken as it is cheapest). Name the animal  and press OK. You will then receive the dinosaur egg item.
You can only set your character's name once, at the start of the game (when you create your world), for this reason we recommend you use the animal name method. If you do wish to use this method, first set your character's name to  when creating your save. Whenever you speak to a villager that says your name in dialogue (for example Gus at the Stardrop Saloon) you will be given the dinosaur egg item.
If you need more help with spawning dinosaur egg, we have a detailed guide on our blog - click here to visit that page.
The dinosaur egg can be used to hatch, unsurprisingly, a dinosaur. To do this, you must place this dinosaur egg in any incubator and wait 12 days for it to hatch. The newly hatched dinosaur will create a dinosaur egg every 7 days. You can obtain dinosaur eggs in Artifact Spots in The Mountains and find them within treasure chests.
A giant dino egg... The entire shell is still intact!