# stestr init Command

Initialise a new repository.

class stestr.commands.init.Init(app: _app.App, app_args: Namespace | None, cmd_name: str | None = None)

  Create a new repository.

  take_action(parsed_args)

    Override to do something useful.

    The returned value will be returned by the program.

stestr.commands.init.init(repo_url=None, stdout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)

  Initialize a new repository

  This function will create initialize a new repostiory if one does not exist. If one exists the command will fail.

  Note this function depends on the cwd for the repository if repo_url is not specified it will use the repository located at CWD/.stestr

  Parameters:

    repo_url (str) – The url of the repository to use.

  Return return_code:

    The exit code for the command. 0 for success and > 0 for failures.

  Return type:

    int