Skip to content

Commit

Permalink
docload2
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Jul 25, 2024
1 parent 50de039 commit e5324d4
Show file tree
Hide file tree
Showing 17 changed files with 325 additions and 230 deletions.
1 change: 0 additions & 1 deletion docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ function sidebar() {
{text: 'lando poweroff', link: '/poweroff'},
{text: 'lando rebuild', link: '/rebuild'},
{text: 'lando restart', link: '/restart'},
{text: 'lando share', link: '/share'},
{text: 'lando ssh <span class="VPBadge danger" vertical="middle"><small>DEPRECATED</small></span>', link: '/ssh'},
{text: 'lando start', link: '/start'},
{text: 'lando stop', link: '/stop'},
Expand Down
4 changes: 3 additions & 1 deletion docs/exec.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ description: lando exec runs command(s) on a service

Runs command(s) on a service.

`lando exec` is a **new** command intended to replace `lando ssh`. However, it currently works best on `api: 4` services. If you are experiencing issues on `api: 3` services we recommend you continue using `lando ssh`.
::: tip
`lando exec` is a **new** command intended to replace `lando ssh`. However, it currently works best on `api: 4` services. If you are experiencing issues on `api: 3` services we recommend you continue using [`lando ssh`](./ssh.md).
:::

## Usage

Expand Down
13 changes: 7 additions & 6 deletions docs/info.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ Using this command you can see useful information such as:
* Other depends-on-which-service relevant things

Note that if `info` returns a single result you can forgo `[INDEX].property` usage with `--path` to access a property. See examples below.

## Usage

```sh
lando info \
[--deep] \
[--filter <key=value>] \
[--format <default|json|table>] \
[--path <path>] \
[--service <service>]
lando info
[--deep]
[--filter <key=value>...]
[--format <default|json|table>]
[--path <path>]
[--service <service>...]
```

## Options
Expand Down
110 changes: 57 additions & 53 deletions docs/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,58 @@ description: lando init is a powerful command that initializes a codebase for us

# lando init

Initializes code for use with lando
Fetches code and/or initializes a Landofile for use with lando.

This command will create a `.lando.yml` for a given recipe and with code from a given source. This is a good way to initialize a codebase for usage with Lando.
This is a poorly designed command that does two main things:

Currently you can initialize code from your current working directory, a remote Git repository, a remote archive, [GitHub](https://github.com) and [Pantheon](https://pantheon.io).
* Initializes a `.lando.yml` for a given `recipe`
* Grabs code from various `sources`

::: tip Do not use if you already have a `.lando.yml` in your codebase
If your code already has a Landofile then this command will likely produce undesirable results.
:::
It can also be extended by [plugins](https://docs.lando.dev/plugins) but this page it purely for the core `lando init` which admittedly does not do much. We are aiming to redesign this command in Lando 4 so please bear with us until then.

If you are looking to `lando init` your code for a particular use case eg `drupal` we recommend checking out the plugin docs for that use case instead of these ones. For your convenience here are some common plugins that implement `lando init`:

* [Acquia](https://docs.lando.dev/plugins/acquia/)
* [Backdrop](https://docs.lando.dev/plugins/backdrop/)
* [Drupal](https://docs.lando.dev/plugins/drupal/)
* [Joomla](https://docs.lando.dev/plugins/joomla/)
* [Lagoon](https://docs.lando.dev/plugins/lagoon/)
* [LAMP](https://docs.lando.dev/plugins/lamp/)
* [Laravel](https://docs.lando.dev/plugins/laravel/)
* [LEMP](https://docs.lando.dev/plugins/lemp/)
* [Pantheon](https://docs.lando.dev/plugins/pantheon/)
* [Symfony](https://docs.lando.dev/plugins/symfony/)
* [WordPress](https://docs.lando.dev/plugins/wordpress/)

## Usage

```sh
lando init [--name <name>] [--recipe <recipe>] [--source <source>]
lando init
[--name <name>]
[--recipe <recipe>]
[--source <source>]
[--full]
[--github-auth==<token>]
[--github-repo==<url>]
[--option=<path=value>...]
[--remote-options=<options>]
[--remote-url=<url>]
[--webroot=<path>]
[--yes]
[--other-plugin-provided-options...]
```

## Getting code from various sources
### Sources

### Current Working Directory
#### 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`.

```sh
lando init --source cwd
```

### Remote git repo or archive
#### 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.

Expand Down Expand Up @@ -64,31 +89,7 @@ lando init \
--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](https://docs.pantheon.io/machine-tokens/) 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.

```sh
# Let Lando walk you through it
lando init --source pantheon

# Pull my-site from pantheon and set it up as a pantheon recipe
lando init --source pantheon --pantheon-auth "$MY_MACHINE_TOKEN" --pantheon-site my-site

# Clone my code from a git repo and set it up as a pantheon recipe
lando init \
--source remote \
--recipe pantheon \
--remote-url https://github.com/drupal/drupal.git \
--pantheon-auth "$MY_MACHINE_TOKEN" \
--pantheon-site my-site
```

### GitHub
#### GitHub

In order to pull down code from GitHub you will need to make sure you have created a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) and that it has the `repo`, `admin:public_key` and `user` scopes.

Expand All @@ -104,39 +105,42 @@ lando init \
--github-auth "$MY_GITHUB_TOKEN" \
--github-repo [email protected]:lando/lando.git

# Pull code from github and set it up as a mean recipe
# Pull code from github and set it up with no recipe
lando init \
--source github \
--recipe mean \
--recipe none \
--github-auth "$MY_GITHUB_TOKEN" \
--github-repo [email protected]:lando/lando.git \
--name lando
```

## Options

Run `lando init --help` to get a complete list of options defaults, choices, recipes, sources etc.
Run `lando init --help` to get a complete list of options defaults, choices, recipes, sources etc as these may differ based on plugins you have installed.

```sh
--full Dump a lower level lando file
--github-auth A GitHub personal access token
--github-repo GitHub git url
--help Shows lando or delegated command help if applicable
--name The name of the app
--options, -o Merge additional KEY=VALUE pairs into your recipes config
--pantheon-auth A Pantheon machine token
--pantheon-site A Pantheon site machine name
--recipe, -r The recipe with which to initialize the app
--remote-options Some options to pass into either the git clone or archive extract command
--remote-url The URL of your git repo or archive, only works when you set source to remote
--source, --src The location of your apps code
--verbose, -v Runs with extra verbosity
--webroot Specify the webroot relative to app root
--yes, -y Auto answer yes to prompts
--channel Sets the update channel [array] [choices: "edge", "none", "stable"]
--clear Clears the lando tasks cache [boolean]
--debug Shows debug output [boolean]
--help Shows lando or delegated command help if applicable [boolean]
--verbose, -v Runs with extra verbosity [count]
--full Dump a lower level lando file [boolean] [default: false]
--github-auth Uses a GitHub personal access token [string]
--github-repo Uses the GitHub git url [string]
--name The name of the app [string]
--option, -o Merge additional KEY=VALUE pairs into your recipes config [array]
--recipe, -r The recipe with which to initialize the app [string] [choices: "none"]
--remote-options Passes options into either the git clone or archive extract command [string] [default: ""]
--remote-url Uses the URL of your git repo or archive, only works when you set source to remote [string]
--source, --src The location of your apps code [string] [choices: "cwd", "github", "remote"]
--webroot Specify the webroot relative to app root [string]
--yes, -y Auto answer yes to prompts [boolean] [default: false]
```
## Examples
Note that some of these examples assume the needed plugins have been installed.
```sh
# Interactively instantiate your code for use with lando
lando init
Expand Down
43 changes: 27 additions & 16 deletions docs/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,31 @@ Lists all running lando apps and containers.

Optionally you can include show not running services with `--all` or filter by `--app`.

Note that if `list` returns a single result you can forgo `[INDEX].property` usage with `--path` to access a property. See examples below.

## Usage

```sh
lando list [--all] [--filter <key=value>...] [--format <default|json|table>] [--path <path>]
```

## Options

```sh
--channel Sets the update channel [array] [choices: "edge", "none", "stable"]
--clear Clears the lando tasks cache [boolean]
--debug Shows debug output [boolean]
--help Shows lando or delegated command help if applicable [boolean]
--verbose, -v Runs with extra verbosity [count]
--all, -a Show all containers, even those not running [boolean]
--app Show containers for only a particular app [string]
--filter Filter data by "key=value" [array]
--format Output in given format: default, json, table [string] [choices: "default", "json", "table"]
--path Only return the value at the given path [string] [default: null]
```
## Examples
```sh
# Get all running lando services
lando list
Expand All @@ -27,21 +50,9 @@ lando list --filter "kind=service"
# Get all the data as json
lando list --all --format json

# Get the name for the first service of a given app, note the quote are important
lando list --path "my-app.[0].service"
```
# Get the name for the first service
lando list --path "[0].service"

## Options

```sh
--channel Sets the update channel [array] [choices: "edge", "none", "stable"]
--clear Clears the lando tasks cache [boolean]
--debug Shows debug output [boolean]
--help Shows lando or delegated command help if applicable [boolean]
--verbose, -v Runs with extra verbosity [count]
--all, -a Show all containers, even those not running [boolean]
--app Show containers for only a particular app [string]
--filter Filter data by "key=value" [array]
--format Output in given format: default, json, table [string] [choices: "default", "json", "table"]
--path Only return the value at the given path [string] [default: null]
# Get the name a particularly named service
lando list --filter name=myapp_myservice_1 --path service
```
38 changes: 22 additions & 16 deletions docs/logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: lando logs is a light wrapper around docker logs and shows containe

# lando logs

Displays logs for your app
Displays logs for your app.

You can optionally filter by a particular service, show timestamps or follow the logs a la `tail -f`.

Expand All @@ -17,6 +17,27 @@ application logs.

## Usage

```sh
lando logs [--follow] [--service <service>...] [--timestamps]
```

## Options

Run `lando logs --help` to get a complete list of options defaults, choices, etc.

```sh
--channel Sets the update channel [array] [choices: "edge", "none", "stable"]
--clear Clears the lando tasks cache [boolean]
--debug Shows debug output [boolean]
--help Shows lando or delegated command help if applicable [boolean]
--verbose, -v Runs with extra verbosity [count]
--follow, -f Follows the logs [boolean] [default: false]
--service, -s Shows logs for the specified services only [array]
--timestamps, -t Shows log timestamps [boolean] [default: false]
```
## Examples
```sh
# Get the logs=z
lando logs
Expand All @@ -27,18 +48,3 @@ lando logs -t -f
# Show logs for only the database and cache services
lando logs -s cache -s database
```

## Options

Run `lando logs --help` to get a complete list of options defaults, choices, etc.

```sh
--channel Sets the update channel [array] [choices: "edge", "none", "stable"]
--clear Clears the lando tasks cache [boolean]
--debug Shows debug output [boolean]
--help Shows lando or delegated command help if applicable [boolean]
--verbose, -v Runs with extra verbosity [count]
--follow, -f Follow the logs [boolean] [default: false]
--service, -s Show logs for the specified services only [array]
--timestamps, -t Show log timestamps [boolean] [default: false]
```
46 changes: 36 additions & 10 deletions docs/plugin-add.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,50 @@ description: lando plugin-add installs the plugin(s) indicated in the primary ar

Installs plugins.

This will install the plugin(s) passed in as arguments and make them available for use in Lando.

Plugins will be installed in `~/.lando/plugins` by default unless you've modified your [global config](https://docs.lando.dev/core/v3/index.html) to install them elsewhere.

## Usage

```sh
lando plugin-add <plugin> [plugins...]
lando plugin-add <plugin> [plugin...]
[--auth <auth>...]
[--registry <registry>...]
[--scope <scope>...]
```

## Options

```sh
--channel Sets the update channel [array] [choices: "edge", "none", "stable"]
--clear Clears the lando tasks cache [boolean]
--debug Shows debug output [boolean]
--help Shows lando or delegated command help if applicable [boolean]
--verbose, -v Runs with extra verbosity [count]
--auth, -a Use global or scoped auth [array] [default: []]
--registry, -r, -s, --scope Use global or scoped registry [array] [default: []]
--channel Sets the update channel [array] [choices: "edge", "none", "stable"]
--clear Clears the lando tasks cache [boolean]
--debug Shows debug output [boolean]
--help Shows lando or delegated command help if applicable [boolean]
--verbose, -v Runs with extra verbosity [count]
--auth, -a Sets global or scoped auth [array] [default: []]
--registry, -r, -s, --scope Sets global or scoped registry [array] [default: []]
```
## Examples
```sh
# Install @lando/php
lando plugin-add @lando/[email protected]

# Installs @lando/[email protected] & @lando/node
lando plugin-add @lando/[email protected] @lando/node

# Install @lando/php from a local source
lando plugin-add @lando/php@file:~/my-php-plugin

# Install @lando/node from the main branch of github.com/lando/node
lando plugin-add lando/node#main

# Install a plugin from an external git url reg
lando plugin-add https://github.com/pirog/plugin.git#v1.2.1

# Installs a private plugin from https://npm.pkg.github.com
lando plugin-add @myorg/php --auth "$TOKEN" --registry https://npm.pkg.github.com

# Installs @lando/php & a private plugin from https://npm.pkg.github.com
lando plugin-add @lando/php @myorg/mysql --auth "//npm.pkg.github.com/:_authToken=$TOKEN" --scope myorg:registry=https://npm.pkg.github.com
```
Loading

0 comments on commit e5324d4

Please sign in to comment.