I have something similar to this for the Bob version of federation, you can query a url with a filter and it returns either the list of titles or the full tiddlers like Jeremy said. My version of the code is here
Looking at it now there are many ways that it should be improved, but the idea works and it has been useful for me so far.
Making it a normal command for node shouldn't be too difficult. Almost all of the code for those routes is there for the way Bob handles multiple wikis and authentication, so it would be much simpler as a command.
I am not sure what the utility of having this as a command would be, I assume some sort of bash scripting?