Add reference command

Adds a command to add a reference.

@antgonza this helps to solve the issue in #732