The --command
argument wants you to specify a single string that contains the command name followed by the arguments (if any are needed), all in one string. A gotcha here is that you may need to do some quoting of things to make the string valid.
Depending on where your commands are coming from, you may need to resort to quoting the quote characters so that they slowly get “quoted away” as they pass through the various layers until they eventually get to the command interpreter.
For example, directly from the shell, the following two commands will both toggle the state of the console in the active window.
subl --command 'show_panel {"panel": "console", "toggle": true}'
subl --command "show_panel {\"panel\": \"console\", \"toggle\": true}"
On the other hand, I have Sublimerge 3 set up to be a merge tool and a diff tool for command line git, where the ultimate configuration has to look something like this:
[difftool "sublimerge"]
cmd = subl -n --wait \"$REMOTE\" \"$LOCAL\" --command \"sublimerge_diff_views {\\\"left_read_only\\\": false, \\\"right_read_only\\\": true}\"