The proceeding before justices of the peace in actions of replevin and detinue shall be by writ as provided in this subchapter.