Getting code from various sources

Current Working Directory

By default Lando will use the code from the directory you are currently in. Nothing much special here, just navigate to the directory with your code and invoke lando init.

lando init --source cwd

Remote git repo or archive

You can also tell Lando to either clone code from a remote Git repo or extract code from a remote tar archive. Note that if you clone from a git repo it is up to the user to make sure any relevant ssh keys are set up correctly.

Note that you can also pass in options to alter the behavior of the clone or archive extraction

# Shallow clone and checkout the 7.x branch# NOTE: you currently need to use the = below in `--remote-options` for yargs to parse this correctly
lando init \
--source remote \
--remote-url https://github.com/drupal/drupal.git \
--remote-options="--branch 7.x --depth 1"# Strip the leading component of the tar# NOTE: you currently need to use the = below in `--remote-options` for yargs to parse this correctly
lando init \
--source remote \
--remote-url https://www.drupal.org/download-latest/tar.gz \
--remote-options="--strip-components=1"

Pantheon

In order to pull down code from Pantheon or use the pantheon recipe you will need to make sure you have created a machine token first. Note that choosing --source=pantheon implies --recipe=pantheon eg we do not let you grab code from Pantheon and also select a recipe.

That said, --recipe=pantheon does not imply --source=pantheon which means you can grab code using any of our initialization sources and then choose the pantheon recipe.

Note that Lando will automatically create and post a SSH key to Pantheon for you if you use this init source.