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, 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 causes an adverse-selection problem. To solve it, the monopolist and (possibly) the planner curtail flexibility in the device for a more inconsistent person at both ends of the efficient choice range, and may have to add unused options to, or even distort, the device for a less inconsistent person. This theory has normative and positive implications for private and public provision of commitment devices.