dockutil

Manage macOS dock items from the command line

brewmacoslinux
Try with needOr install directly
Source

About

Tool for managing dock items

Commands

dockutil

Examples

Add an application to the dock$ dockutil --add /Applications/Safari.app
Remove an item from the dock by label$ dockutil --remove 'Finder'
List all current dock items$ dockutil --list