Rewrite command framework