blueutil (available via HomeBrew) is the answer. I just used it following the guidelines in this blog post.
In my case, I had an iMac with macOS Catalina that had no trackpad paired. I was stuck at the "Send Apple Crash Analytics?" screen with no keyboard controls. Using SSH, I connected to the machine and used the following commands to pair and then connect the trackpad without access to the GUI. (First, I had to turn the trackpad into Discoverable mode. The default PIN for Apple pointer devices is 0000.)
% blueutil --inquiry
address: d0-a6-xx-xx-xx-xx, not connected, not favourite, not paired, name: "-", recent access date: -
% blueutil --pair d0-a6-xx-xx-xx-xx
Type pin code (up to 16 characters) for "Cheshire, Josh’s Trackpad" (d0-a6-xx-xx-xx-xx) and press Enter: 0000
% blueutil --connect d0-a6-xx-xx-xx-xx
At that point, the trackpad worked.
blueutil --recenti run this option have a list butblueutil --inquiryas no new devices are avaiable. – xiaojueguan Apr 10 '21 at 01:56