I've been reading about using the
fdsetup command to manage FileVault2 from the command line. But I can't find it in Mojave (or High Sierra for that matter).
Is there a command line interface to FileVault2?
The command you want is:
From its manual page:
fdesetup(8) BSD System Manager's Manual
fdesetup -- FileVault configuration tool
fdesetup verb [options]
fdesetup is used to enable or disable FileVault, to list, add, or remove enabled FileVault users, and to obtain status about the current state of FileVault. Most commands require root access and need to be authenticated with either a FileVault password, a personal recovery key (if enabled), and in some cases the private key from the installed institutional recov- ery key. Some status related commands can be run from a non-root session.