Starting InDesign UXP Command from Command Line?

Is it possible to start InDesign with a design file and run a UXP command from the OS Command line?

Not directly, as far as I can see.
But you can wrap your UXP code in a vbs or applescript doScript call and use that platfom-specific script from the command line.

No, as far as I know, it is not possible to pass information to run a specific command as a parameter. But there is another way.

If you want to run a script automatically at the start of an InDesign session, you need to place it in a folder called “startup scripts” (it is located in the “Scripts” folder). UXP scripts also work. You can also create “startup scripts” folders in custom script folders, then they will work only for certain users on the computer.

When the startup script starts running, no document will be open yet. In the startup script, you only need to register an “AFTER_OPEN” event handler, and in it you should run the command for the newly opened document.

You can check, say, either the document name (by adding some specific character), or some created label in the document (it can be inserted and removed by a special script) to decide whether to run the command for this document.

Then, to automatically run the command, you can open the file in any way: by double-clicking on the file name, or through the menu.