How can I list displays and their available resolutions from the command line?

Use get requests to discover the display identifiers and available modes before writing a command that changes them. With the BetterDisplay CLI set up, start with:

betterdisplaycli get -identifiers
betterdisplaycli get -identifier=name

The first request returns identification details. The second returns display names. To list modes for a specific connected display:

betterdisplaycli get -name="Desk Display" -displayModeList

Replace Desk Display with the display’s actual name. Mode rows include a mode number, desktop dimensions, HiDPI status, refresh rate, bit depth and relevant flags such as Current or Default. You can list modes only while the display is connected. You can still query the identity of a remembered display while it is disconnected.

For the rendering background, see how macOS scaling, HiDPI and LoDPI work.

Use an unambiguous name or an appropriate identifier when several displays are present. A command without a display selector can apply to several displays. The returned mode numbers and identifiers describe your current setup. They may differ on another Mac or change after reconnection. See device selection and mode examples and the CLI reference.