__init__
¶
- invoke.run(command: str, **kwargs: Any) Result | None ¶
Run
command
in a subprocess and return aResult
object.See
Runner.run
for API details.Note
This function is a convenience wrapper around Invoke’s
Context
andRunner
APIs.Specifically, it creates an anonymous
Context
instance and calls itsrun
method, which in turn defaults to using aLocal
runner subclass for command execution.New in version 1.0.
- invoke.sudo(command: str, **kwargs: Any) Result | None ¶
Run
command
in asudo
subprocess and return aResult
object.See
Context.sudo
for API details, such as thepassword
kwarg.Note
This function is a convenience wrapper around Invoke’s
Context
andRunner
APIs.Specifically, it creates an anonymous
Context
instance and calls itssudo
method, which in turn defaults to using aLocal
runner subclass for command execution (plus sudo-related bits & pieces).New in version 1.4.