magic: expand API and extend argument parser to support it