How to AutoRotate in LineageOS With ADB?
Android 4.2

Auto rotate on:

adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:1

Auto rotate off:

adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0

Landscape:

adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1

Portrait:

adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0

Android 8

Auto rotate on:

adb shell settings put secure show_rotation_suggestions 1

Auto rotate off: 

adb shell settings put secure show_rotation_suggestions 0

introduction mode can be reset by altering the associated Settings.Secure value. This accomplished easiest by running the following command from a privileged adb instance:

adb shell settings put secure num_rotation_suggestions_accepted 0