You can allow an application to access data if you change settings in
Security & Privacy →
Full Disk Access.
Is there command to accomplish the same in terminal?
No, this must be performed by the user through the System Preferences page. Any method to do this via the command line would likely be considered a bug and should be reported.