Automatic Command Sequence Generation