Export - import iPhone keyboard shortcuts as text file?
From dastrobu: 

There is an unofficial command line tool, which does exactly what you want, its called shortcuts. You can install it via homebrew

brew install rodionovd/taps/shortcuts


You can list your current replacements via

shortcuts read


You can import new ones via:

shortcuts import &lt;input.plist&gt;


There are also these commands:

shortcuts create &lt;shortcut&gt; &lt;new phrase&gt;
shortcuts update &lt;shortcut&gt; &lt;phrase&gt;
shortcuts delete &lt;shortcut&gt;


Source: How to export Text replacements from the Keyboard System Preference from shell?