mantik.cli.initΒΆ

FunctionsΒΆ

initialize_tracking(β†’Β None)

Initialize the authentication to mantik and

Module ContentsΒΆ

mantik.cli.init.initialize_tracking(no_export: bool) β†’ None[source]ΒΆ

Initialize the authentication to mantik and print the required environment variables.

It is not possible to set environment variables in a parent process (or shell) from a subprocess (e.g. Python). Thus, the init command prints the bash export statement with the required environment variable for authentication to mantik. As a consequence, the output can be directly used to set the environment variable in the parent process by using the eval bash command:

 `shell eval $(mantik init) `

If you do not want to set the environment variable in the parent process but only want to pass it to the command context, use the env bash command combined with the –no-export flag:

 `shell env $(mantik init --no-export) <command> `