You can just setup a global keyboard shortcut for it in System Preferences -> Keyboard -> Shortcuts -> Mission Control

Or if you definitely want it from the command line, an applescript to do this (assuming you setup the keyboard shortcut to use <kbd>cmd</kbd><kbd>shift</kbd><kbd>opt</kbd><kbd>ctrl</kbd><kbd>D</kbd>.

Note that you still MUST setup a keyboard command in System Preferences for this to work.

Put the below script into a file, say, ~/dnd.applescript

    ignoring application responses
    	tell application "System Events" to keystroke "D" using {command down, shift down, option down, control down}
    end ignoring

Now you can run `osascript ~/dnd.applescript` from the command line to toggle your DND setting.

Screencap: 
![Keyboard shortcut modification in System Preferences][1]


  [1]: https://i.sstatic.net/jhOkn.png