__init__

invoke.run(command: str, **kwargs: Any) Result | None

Run command in a subprocess and return a Result object.

See Runner.run for API details.

Note

This function is a convenience wrapper around Invoke’s Context and Runner APIs.

Specifically, it creates an anonymous Context instance and calls its run method, which in turn defaults to using a Local runner subclass for command execution.

New in version 1.0.

invoke.sudo(command: str, **kwargs: Any) Result | None

Run command in a sudo subprocess and return a Result object.

See Context.sudo for API details, such as the password kwarg.

Note

This function is a convenience wrapper around Invoke’s Context and Runner APIs.

Specifically, it creates an anonymous Context instance and calls its sudo method, which in turn defaults to using a Local runner subclass for command execution (plus sudo-related bits & pieces).

New in version 1.4.