Skip to content

dstack init

This command initializes the current directory as a dstack repo.

Git credentials

If the directory is a cloned Git repository, dstack init ensures that dstack can access it. By default, the command uses the user's default Git credentials. These can be overridden with --git-identity (private SSH key) or --token (OAuth token).

$ dstack init --help
Usage: dstack init [-h] [--project PROJECT] [-t OAUTH_TOKEN]
                   [--git-identity SSH_PRIVATE_KEY]
                   [--ssh-identity SSH_PRIVATE_KEY] [--local]

Options:
  -h, --help            Show this help message and exit
  --project PROJECT     The name of the project
  -t, --token OAUTH_TOKEN
                        An authentication token to access a private Git repo
  --git-identity SSH_PRIVATE_KEY
                        The private SSH key path to access a private Git repo
  --ssh-identity SSH_PRIVATE_KEY
                        The private SSH key path for SSH tunneling
  --local               Do not use Git

User SSH key

By default, dstack uses its own SSH key to access instances (~/.dstack/ssh/id_rsa). It is possible to override this key via the --ssh-identity argument.