Change Canvas size programatically

I need to add some padding to an image programmatically, and thought about using the app.command.CanvasSize command to that end, but didn’t find any docs about its parameters.

I’m trying to call the method in a similar fashion to how SpriteResize works, with the ui parameter set to false, but it’s always showing the gui anyway.

As a workaround, I’m using SpriteResize to resize the entire thing (canvas plus the actual sprite), and then override de sprite with a copy of the original one, positioned at the center.

What would be the correct way of using app.command.CanvasSize?