This paper develops a theory of optimal provision of commitment devices to people who value both commitment and flexibility, and whose preferences differ in the degree of time inconsistency. If time inconsistency is observable, then both a planner and a monopolist provide devices that help each person commit to the efficient level of flexibility. But the combination of unobservable time inconsistency and preference for flexibility creates an adverse-selection problem. To solve it, the monopolist and (possibly) the planner inefficiently curtail flexibility in the device for a more inconsistent person, and may have to add unused options to, or even distort, the device for a less inconsistent person. Flexibility is curtailed in a particular way that is evocative of existing commitment devices. This theory has normative as well as positive implications for private and public provision of these devices.