ImageMagick/GraphicsMagick cannot decode and demosaic raw files. Technically if you compiled IM with dcraw/ufraw support you could, but then you’re still just using dcraw and having IM call it.
The bigger question is why are you doing this in the first place? Knowing how to demosaic raw files using dcraw for the sake of knowing is fine, but if you want to get actual photos, why do this? Rather use RawTherapee (it can be used from command-line) to take advantage of its higher quality raw handling than dcraw’s.