compare-and-set for refs, and a basic cli python client