diff --git a/.github/workflows/dev-release-slim.yml b/.github/workflows/dev-release-slim.yml index a5fcf43f7..7d581e9fd 100644 --- a/.github/workflows/dev-release-slim.yml +++ b/.github/workflows/dev-release-slim.yml @@ -47,7 +47,7 @@ jobs: - name: Package into node binary uses: lando/pkg-action@v4 with: - entrypoint: bin/lando.js + entrypoint: bin/lando arch: ${{ matrix.arch }} node-version: ${{ matrix.node-version }} os: ${{ matrix.os }} diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml index 8af5fa022..695958f30 100644 --- a/.github/workflows/dev-release.yml +++ b/.github/workflows/dev-release.yml @@ -51,7 +51,7 @@ jobs: - name: Package into node binary uses: lando/pkg-action@v4 with: - entrypoint: bin/lando.js + entrypoint: bin/lando arch: ${{ matrix.arch }} node-version: ${{ matrix.node-version }} os: ${{ matrix.os }} diff --git a/.github/workflows/pr-release-tests-slim.yml b/.github/workflows/pr-release-tests-slim.yml index 306d9d2ec..b895e4403 100644 --- a/.github/workflows/pr-release-tests-slim.yml +++ b/.github/workflows/pr-release-tests-slim.yml @@ -45,7 +45,7 @@ jobs: uses: lando/pkg-action@v4 id: pkg-action with: - entrypoint: bin/lando.js + entrypoint: bin/lando arch: ${{ matrix.arch }} node-version: ${{ matrix.node-version }} os: ${{ matrix.os }} diff --git a/.github/workflows/pr-release-tests.yml b/.github/workflows/pr-release-tests.yml index d3862ad1f..e5bcf42c9 100644 --- a/.github/workflows/pr-release-tests.yml +++ b/.github/workflows/pr-release-tests.yml @@ -47,7 +47,7 @@ jobs: uses: lando/pkg-action@v4 id: pkg-action with: - entrypoint: bin/lando.js + entrypoint: bin/lando arch: ${{ matrix.arch }} node-version: ${{ matrix.node-version }} os: ${{ matrix.os }} diff --git a/.github/workflows/release-slim.yml b/.github/workflows/release-slim.yml index 888f4d6da..7219e36ba 100644 --- a/.github/workflows/release-slim.yml +++ b/.github/workflows/release-slim.yml @@ -45,7 +45,7 @@ jobs: - name: Package into node binary uses: lando/pkg-action@v4 with: - entrypoint: bin/lando.js + entrypoint: bin/lando arch: ${{ matrix.arch }} node-version: ${{ matrix.node-version }} os: ${{ matrix.os }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c41bc0471..d7cbf6160 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,7 +49,7 @@ jobs: - name: Package into node binary uses: lando/pkg-action@v4 with: - entrypoint: bin/lando.js + entrypoint: bin/lando arch: ${{ matrix.arch }} node-version: ${{ matrix.node-version }} os: ${{ matrix.os }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 32250f218..6bb5033d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## v3.21.0-beta.5 - [February 27, 2024](https://github.com/lando/cli/releases/tag/v3.21.0-beta.5) + +### CLI + +* Improved `lando setup` message +* Improved CLI metadata to help resolve [#109](https://github.com/lando/core/issues/109) and [#122](https://github.com/lando/core/issues/122) +* Renamed `bin` entrypoint to `/bin/lando` from `/bin/lando.js` + +### Core + +* Updated `@lando/core` to [`v3.21.0-beta.5`](https://github.com/lando/core/releases/tag/v3.21.0-beta.5) + ## v3.21.0-beta.2 - [February 20, 2024](https://github.com/lando/cli/releases/tag/v3.21.0-beta.2) * Updated `@lando/core` to [`v3.21.0-beta.2`](https://github.com/lando/core/releases/tag/v3.21.0-beta.2) diff --git a/bin/lando.js b/bin/lando similarity index 98% rename from bin/lando.js rename to bin/lando index 192390482..17c584803 100755 --- a/bin/lando.js +++ b/bin/lando @@ -116,7 +116,7 @@ if (runtime === 4) { debug('handing off to %o with caching %o at %o and debug %o', '@lando/cli@4', cache ? 'enabled' : 'disabled', cacheDir, debug.enabled); // get the cli - const Cli = require('./../lib/cli-next'); + const Cli = require('../lib/cli-next'); // override some default static props Cli.debug = debug.extend('cli'); Cli.id = config.product; @@ -153,8 +153,8 @@ if (runtime === 4) { if (appConfig.appCore && fs.existsSync(path.join(appConfig.appCore, 'index.js'))) COREBASE = appConfig.appCore; // Summon the implementation of @lando/cli@3 that works with @lando/core@3 - const Cli = require('./../lib/cli'); - const cli = new Cli(ENVPREFIX, LOGLEVELCONSOLE, USERCONFROOT, COREBASE); + const Cli = require('../lib/cli'); + const cli = new Cli(ENVPREFIX, LOGLEVELCONSOLE, USERCONFROOT, COREBASE, debug); const bsLevel = (_.has(appConfig, 'recipe')) ? 'APP' : 'TASKS'; const getTasks = require(`${COREBASE}/utils/get-tasks`); debug('starting lando with %o runtime using cli %o', `v${runtime}`, {ENVPREFIX, LOGLEVELCONSOLE, USERCONFROOT, COREBASE}); diff --git a/docs/.vitepress/config.mjs b/docs/.vitepress/config.mjs index fe96103f4..bfc313124 100644 --- a/docs/.vitepress/config.mjs +++ b/docs/.vitepress/config.mjs @@ -31,28 +31,39 @@ function sidebar() { collapsed: false, items: [ {text: 'Overview', link: '/'}, - {text: 'Default Commands', link: '/defaults'}, - {text: 'Tooling', link: '/tooling'}, ], }, { text: 'Commands', + collapsed: false, + items: [ + {text: 'lando config', link: '/config'}, + {text: 'lando destroy', link: '/destroy'}, + {text: 'lando init', link: '/init'}, + {text: 'lando info', link: '/info'}, + {text: 'lando list', link: '/list'}, + {text: 'lando logs', link: '/logs'}, + {text: 'lando poweroff', link: '/poweroff'}, + {text: 'lando rebuild', link: '/rebuild'}, + {text: 'lando restart', link: '/restart'}, + {text: 'lando share', link: '/share'}, + {text: 'lando ssh', link: '/ssh'}, + {text: 'lando start', link: '/start'}, + {text: 'lando stop', link: '/stop'}, + {text: 'lando update', link: '/update'}, + {text: 'lando version', link: '/version'}, + ], + }, + { + text: 'Mgmt Commands', collapsed: true, items: [ - {text: 'Lando Config', link: '/config'}, - {text: 'Lando Destroy', link: '/destroy'}, - {text: 'Lando Init', link: '/init'}, - {text: 'Lando Info', link: '/info'}, - {text: 'Lando List', link: '/list'}, - {text: 'Lando Logs', link: '/logs'}, - {text: 'Lando Poweroff', link: '/poweroff'}, - {text: 'Lando Rebuild', link: '/rebuild'}, - {text: 'Lando Restart', link: '/restart'}, - {text: 'Lando Share', link: '/share'}, - {text: 'Lando SSH', link: '/ssh'}, - {text: 'Lando Start', link: '/start'}, - {text: 'Lando Stop', link: '/stop'}, - {text: 'Lando Version', link: '/version'}, + {text: 'lando plugin-add', link: '/plugin-add'}, + {text: 'lando plugin-login', link: '/plugin-login'}, + {text: 'lando plugin-logout', link: '/plugin-logout'}, + {text: 'lando plugin-remove', link: '/plugin-remove'}, + {text: 'lando setup', link: '/setup'}, + {text: 'lando shellenv', link: '/shellenv'}, ], }, { @@ -72,6 +83,7 @@ function sidebar() { {text: 'Contact Us', link: '/support'}, ], }, + {text: 'Guides', link: '/guides'}, {text: 'Examples', link: 'https://github.com/lando/cli/tree/main/examples'}, ]; }; diff --git a/docs/config.md b/docs/config.md index 63ec07d13..3416b04a8 100644 --- a/docs/config.md +++ b/docs/config.md @@ -3,7 +3,7 @@ title: lando config description: lando config displays the lando configuration. --- -# config +# lando config Displays the lando configuration. @@ -11,7 +11,7 @@ You can also use `--field` to only display a single config value. *Almost all* o ## Usage -```bash +```sh # Show me a config worthy of lando lando config @@ -24,9 +24,12 @@ lando config --format json ## Options -```bash ---format Output in given format: json ---help Shows lando or delegated command help if applicable ---verbose, -v Runs with extra verbosity ---path, -p Only return the value at the given path +```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] +--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] ``` diff --git a/docs/defaults.md b/docs/defaults.md deleted file mode 100644 index 09d944308..000000000 --- a/docs/defaults.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: Default Lando Commands -description: Lando is a CLI driven tool by default, here are all the out of the box commands it runs. ---- - -# Default Commands - -The *usual suspects* are available and you can read more about each of them in detail below. - -```bash -Usage: lando [args] [options] - -Commands: - lando config Displays the lando configuration - lando destroy Destroys your app - lando info Prints info about your app - lando init Initializes code for use with lando - lando list Lists all running lando apps and containers - lando logs Displays logs for your app - lando poweroff Spins down all lando related containers - lando rebuild Rebuilds your app from scratch, preserving data - lando restart Restarts your app - lando share Shares your local site publicly - lando ssh Drops into a shell on a service, runs commands - lando start Starts your app - lando stop Stops your app - lando version Displays the lando version - -Options: - --channel Sets the update channel - --clear Clears the lando tasks cache - --experimental Activates experimental features - --help Shows lando or delegated command help if applicable - --verbose, -v Runs with extra verbosity - -Examples: - lando start Run lando start - lando rebuild --help Get help about using the lando rebuild command - lando destroy -y -vvv Run lando destroy non-interactively and with maximum verbosity - lando --clear Clear the lando tasks cache - -You need at least one command before moving on -``` - -Read more about - -* [lando config](config.md) -* [lando destroy](destroy.md) -* [lando init](init.md) -* [lando info](info.md) -* [lando list](list.md) -* [lando logs](logs.md) -* [lando poweroff](poweroff.md) -* [lando rebuild](rebuild.md) -* [lando restart](restart.md) -* [lando share](share.md) -* [lando ssh](ssh.md) -* [lando start](start.md) -* [lando stop](stop.md) -* [lando version](version.md) diff --git a/docs/destroy.md b/docs/destroy.md index 6c35537d7..a104644e0 100644 --- a/docs/destroy.md +++ b/docs/destroy.md @@ -3,7 +3,7 @@ title: lando destroy description: lando destroy completely destroys your application eg all data will be lost after running this command. --- -# destroy +# lando destroy Destroys your app. @@ -15,7 +15,7 @@ This command should not be confused with uninstalling Lando. It **will only** de ## Usage -```bash +```sh # Interactive destruction lando destroy @@ -31,8 +31,11 @@ lando destroy --help ## Options -```bash ---help Shows lando or delegated command help if applicable ---verbose, -v Runs with extra verbosity ---yes, -y Auto answer yes to prompts +```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] +--yes, -y Auto answer yes to prompts [boolean] [default: false] ``` diff --git a/docs/development.md b/docs/development.md index c11650c99..feef63349 100644 --- a/docs/development.md +++ b/docs/development.md @@ -27,7 +27,7 @@ Any change you make to the `cli` project cloned (and correctly symlinked) to ope If you want to help with contributing documentation here are some useful commands once you've cloned and installed the project. -```bash +```sh # launch local docs site npm run docs:dev @@ -48,7 +48,7 @@ It's best to familiarize yourself with how Lando [does testing](https://docs.lan Generally, unit testable code should be placed in `utils` and then the associated test in `tests` in the form `FILE-BEING-TESTED.spec.js`. Here is an example: -```bash +```sh ./ |-- utils |-- stuff.js @@ -58,7 +58,7 @@ Generally, unit testable code should be placed in `utils` and then the associate And then you can run the tests with the below. -```bash +```sh # Run unit tests npm run test:unit ``` @@ -93,7 +93,7 @@ If you check out the various READMEs in our [examples](https://github.com/lando/ Before running all or some of the tests you will need to generate them. -```bash +```sh # Run ALL the tests, this will likely take a long time npm run test:leia @@ -129,7 +129,7 @@ To deploy and publish a new version of the package to the `npm` registry you nee Also note that if you create a "pre-release" it will tag the `npm` package with `edge` instead of the default `latest` tag. Also note that while you can toggle the pre-release checkbox after the initial release creation this will not trigger a new release and/or promote the release from `edge` to `latest`. If you want to deploy to `latest` then create a new release without pre-released checked. -```bash +```sh # Will pull the most recent GitHub release npm install @lando/cli # Will pull the most recent GitHub pre-release diff --git a/docs/guides.md b/docs/guides.md new file mode 100644 index 000000000..d9e58bcc1 --- /dev/null +++ b/docs/guides.md @@ -0,0 +1,25 @@ +--- +description: Home helpful generic tutorial and guide content for Lando CLI +layout: page +title: Guides +sidebar: false +--- + + + + + + + + + + diff --git a/docs/guides/adding-lando-2-path.md b/docs/guides/adding-lando-2-path.md new file mode 100644 index 000000000..ac02a7ba0 --- /dev/null +++ b/docs/guides/adding-lando-2-path.md @@ -0,0 +1,88 @@ +--- +title: Adding Lando to PATH +description: Learn how to add Lando to PATH in the event that hasn't been automatically done for you. +guide: true + +authors: + - name: Team Lando + pic: https://gravatar.com/avatar/c335f31e62b453f747f39a84240b3bbd + link: https://twitter.com/devwithlando +updated: + timestamp: 1709049201359 + +mailchimp: + # action is required + action: https://dev.us12.list-manage.com/subscribe/post?u=59874b4d6910fa65e724a4648&id=613837077f + # everything else is optional + title: Want similar content? + byline: Signup and we will send you a weekly blog digest of similar content to keep you satiated. + button: Sign me up! +--- + +# Adding Lando to PATH + +Lando _should_ be added to your `PATH` environment variable when you install or update it. When an executable is in `PATH` you can invoke it by name instead of by its path as in this example: + +```sh +# lando is in PATH +lando start + +# lando is not in PATH +/my/weird/place/for/stuff/lando start +``` + +However, there are some situations where Lando may not be automatically added to `PATH`. For those situations you can use [`lando shellenv`](../shellenv.md) and do the below: + +## Checking if Lando is in `PATH` + +The most straightforward way to check is to simply run `lando` from a terminal and see if it returns the `lando` command list. + +You can also do things like: + +::: code-group +```sh [sh] +which lando +``` + +```bat [cmd.exe] +where lando +``` + +```powershell [powershell] +Get-Command lando +``` +::: + +If any of them fail or return nothing then congrats :tada: because `lando` is not in your `PATH`! :( + +## Adding Lando to `PATH` + +To add `lando` to `PATH` you first need to figure out the absolute path to the Lando binary. For the purposes of this we will assume the user has directly downloaded the Lando CLI to a special directory they created called `/all/my/bin`. + +Here are a few ways you can use `lando shellenv` to add `lando` to `PATH`. Note that because `lando` is not in `PATH` you must invoke it using its absolute path. + +```sh +# print the shellenv i need so i can copy/paste it to the relevant rc file +/all/my/bin/lando shellenv + +# have lando attempt to add the shellenv to a shell rc file it thinks make sense +/all/my/bin/lando shellenv --add + +# have lando add the shellenv to a file you want +/all/my/bin/lando shellenv --add ~/.specialrc + +# directly append the output of shellenv to a file +/all/my/bin/lando shellenv >> ~/.anotherrc +``` + +Note that after any of the above commands you must either directly `source` the shell rc file that was edited or open a new terminal for the changes to apply. An example for most `macOS` users would be something like + +```sh +source ~/.zshrc +``` + +You can then verify all is good with: + +```sh +lando shellenv --check +``` diff --git a/docs/index.md b/docs/index.md index 37ec4baeb..09e6cbbf3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,13 +5,135 @@ description: An overview of what the Lando CLI is. # CLI -While Lando is actually a library that can be implemented various ways it ships with a command line interface by default. The command line interface is dynamic which means if it detects a `Landofile` it will augment your list of available commands with any relevant `tooling` that has been set up by that `Landofile`. +The Lando CLI is comprised of three distinct kinds of commands: -**If you do not run most of these commands in a directory that contains a Landofile you will likely not get the expected result.** +1. **Lando Commands** are commands that are available in all contexts and do things like start or stop an app, show the config or print log info. +2. **Tooling Commands** are recipe or user-provided commands that live in individual Landofiles, are only accessible on a per-app basis and can differ from app to app. +3. **Management Commands** are _hidden_ commands that are usually used by non-humans like [@lando/setup-lando](https://github.com/lando/setup-lando). They are mostly backports of [`hyperdrive`](https://github.com/lando/hyperdrive) for Lando 3. + +## Lando Commands + +```sh +Usage: lando [args] [options] + +Commands: + lando config Displays the lando configuration + lando destroy Destroys your app + lando info Prints info about your app + lando init Initializes code for use with lando + lando list Lists all running lando apps and containers + lando logs Displays logs for your app + lando poweroff Spins down all lando related containers + lando rebuild Rebuilds your app from scratch, preserving data + lando restart Restarts your app + lando share Shares your local site publicly + lando ssh Drops into a shell on a service, runs commands + lando start Starts your app + lando stop Stops your app + lando update Updates lando + lando version Displays the lando version + +Options: + --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] + +Examples: + lando start Run lando start + lando rebuild --help Get help about using the lando rebuild command + lando destroy -y --debug Run lando destroy non-interactively and with maximum verbosity + lando --clear Clear the lando tasks cache + +You need at least one command before moving on +``` + +## Tooling Commands + + +Each Landofile may implement _additional_ [tooling commands](https://docs.lando.dev/core/v3/tooling.html) that are only available for that application. These commands are usually wrappers for development tools like `lando composer` or `lando artisan` or `lando npm`. + +Run `lando` inside of an app to see if it offers any app specific tooling options. Here is an example of what the default `lamp` recipe will give you. Note the additional app-specific commands like `lando composer` and `lando db-import`. + +```sh +Usage: lando [args] [options] + +Commands: + lando composer Runs composer commands + lando config Displays the lando configuration + lando db-export [file] Exports database from a service into a file + lando db-import Imports a dump file into database service + lando destroy Destroys your app + lando info Prints info about your app + lando init Initializes code for use with lando + lando list Lists all running lando apps and containers + lando logs Displays logs for your app + lando mysql Drops into a MySQL shell on a database service + lando php Runs php commands + lando poweroff Spins down all lando related containers + lando rebuild Rebuilds your app from scratch, preserving data + lando restart Restarts your app + lando share Shares your local site publicly + lando ssh Drops into a shell on a service, runs commands + lando start Starts your app + lando stop Stops your app + lando update Updates lando + lando version Displays the lando version + +Options: + --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] + +Examples: + lando start Run lando start + lando rebuild --help Get help about using the lando rebuild command + lando destroy -y --debug Run lando destroy non-interactively and with maximum verbosity + lando --clear Clear the lando tasks cache + +You need at least one command before moving on +``` + +Tooling is pretty powerful so make sure you check out the [docs](https://docs.lando.dev/core/v3/tooling.html) for it! + +## Management Commands + +Management commands are _hidden_ commands that you can use to help manage Lando plugins, dependencies and your Lando setup generally. Hidden means that they will not be listed when you run `lando` but they are still there and usable. For example if you are running Lando 3.21.0+ you can do this: + +```sh +lando setup --help +``` + +If they were not hidden this is what they would look like: + +```sh +Usage: lando [args] [options] + +Commands: + lando plugin-add Adds or updates a specific Lando plugin + lando plugin-login Logs into a Lando plugin registry + lando plugin-logout Logs out of a Lando plugin registry + lando plugin-remove Removes a Lando plugin + lando setup Gets your system ready to run Lando + lando shellenv Prints needed shell profile lines +``` + + +As mentioned above these are backports of [`hyperdrive`](https://github.com/lando/hyperdrive) for Lando 3. + +Generally you should not need them, see them or know anything about them unless Lando has specifically asked you to run them or you are doing things that are considered _advanced usage_ for Lando 3 like installing a third-party or non-core plugin. + +You can read more about them in the "Mgmt Commands" section in the sidebar to the left. + +## Known Limitations + +### Using a real, non-emulated TTY -::: warning Windows users must use a real, non-emulated, TTY This is an upstream "restriction" imposed on us by NodeJS and python. We recommend using the shell shipped with [Git for Windows](https://gitforwindows.org/) but only the `cmd.exe` variant NOT the one powered by `minTTY`. That said your safest bet is to use `cmd.exe` or `PowerShell`. Other shells may work but have not been tested. If your shell does not work you will likely see an error message like `the input device is not a TTY.` See [https://github.com/nodejs/node/issues/3006](https://github.com/nodejs/node/issues/3006) -::: + diff --git a/docs/info.md b/docs/info.md index 87d70f175..4abe53c8c 100644 --- a/docs/info.md +++ b/docs/info.md @@ -3,7 +3,7 @@ title: lando info description: lando info prints useful information about your app like service connection information and urls. --- -# info +# lando info Prints info about your app. @@ -16,7 +16,7 @@ Using this command you can see useful information such as: ## Usage -```bash +```sh # Get app info lando info @@ -29,11 +29,15 @@ lando info --deep --format json ## Options -```bash ---deep, -d Get ALL the info ---format Output in given format: json ---help Shows lando or delegated command help if applicable ---service, -s Get info for only the specified services ---verbose, -v Runs with extra verbosity ---path, -p Only return the value at the given path +```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] +--deep, -d Get ALL the info [boolean] [default: false] +--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] +--service, -s Get info for only the specified services [array] ``` diff --git a/docs/init.md b/docs/init.md index 39c38c76b..935772dee 100644 --- a/docs/init.md +++ b/docs/init.md @@ -3,7 +3,7 @@ title: lando init description: lando init is a powerful command that initializes a codebase for usage with a Lando recipe, it can pull code from Pantheon, GitHub and other remote sources. --- -# init +# lando init Initializes code for use with lando @@ -17,7 +17,7 @@ If your code already has a Landofile then this command will likely produce undes ## Usage -```bash +```sh # Interactively instantiate your code for use with lando lando init @@ -65,7 +65,7 @@ lando init \ 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`. -```bash +```sh lando init --source cwd ``` @@ -73,7 +73,7 @@ lando init --source cwd 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. -```bash +```sh # Let Lando walk you through it lando init --source remote @@ -86,7 +86,7 @@ lando init --source remote --remote-url https://www.drupal.org/download-latest/t Note that you can also pass in options to alter the behavior of the clone or archive extraction -```bash +```sh # 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 \ @@ -110,7 +110,7 @@ That said, `--recipe=pantheon` does not imply `--source=pantheon` which means yo Note that Lando will automatically create and post a SSH key to Pantheon for you if you use this init source. -```bash +```sh # Let Lando walk you through it lando init --source pantheon @@ -132,7 +132,7 @@ In order to pull down code from GitHub you will need to make sure you have creat Note that Lando will automatically create and post a SSH key to GitHub for you if you use this init source. -```bash +```sh # Let Lando walk you through it lando init --source github @@ -155,7 +155,7 @@ lando init \ Run `lando init --help` to get a complete list of options defaults, choices, recipes, sources etc. -```bash +```sh --full Dump a lower level lando file --github-auth A GitHub personal access token --github-repo GitHub git url diff --git a/docs/list.md b/docs/list.md index f3a1286cf..e32a35c4c 100644 --- a/docs/list.md +++ b/docs/list.md @@ -3,7 +3,7 @@ title: lando list description: lando list lists all running lando apps and containers and is filterable. --- -# list +# lando list Lists all running lando apps and containers. @@ -11,7 +11,7 @@ Optionally you can include show not running services with `--all` or filter by ` ## Usage -```bash +```sh # Get all running lando services lando list @@ -33,12 +33,15 @@ lando list --path "my-app.[0].service" ## Options -```bash ---all, -a Show all containers, even those not running ---app Show containers for only a particular app ---filter, -f Filter by "key=value" ---format Output in given format: json ---help Shows lando or delegated command help if applicable ---verbose, -v Runs with extra verbosity ---path, -p Only return the value at the given path +```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] ``` diff --git a/docs/logs.md b/docs/logs.md index 1a331131b..e44ceb1a2 100644 --- a/docs/logs.md +++ b/docs/logs.md @@ -3,7 +3,7 @@ title: lando logs description: lando logs is a light wrapper around docker logs and shows container logs written to stdout or stderr. --- -# logs +# lando logs Displays logs for your app @@ -17,7 +17,7 @@ application logs. ## Usage -```bash +```sh # Get the logs=z lando logs @@ -32,10 +32,13 @@ lando logs -s cache -s database Run `lando logs --help` to get a complete list of options defaults, choices, etc. -```bash ---follow, -f Follow the logs ---help Shows lando or delegated command help if applicable ---services, -s Show logs for the specified services only ---timestamps, -t Show log timestamps ---verbose, -v Runs with extra verbosity +```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] ``` diff --git a/docs/plugin-add.md b/docs/plugin-add.md index 7da870d9b..5053bda21 100644 --- a/docs/plugin-add.md +++ b/docs/plugin-add.md @@ -3,23 +3,28 @@ title: lando plugin-add description: lando plugin-add installs the plugin(s) indicated in the primary argument. --- -# plugin-add +# lando plugin-add Installs plugins. -This will install the plugin(s) indicated in the primary argument and add them to Lando's plugin registry. Plugins will be installed in your `.lando/plugins` directory and updated when `lando update` is executed. +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 -```bash +```sh lando plugin-add [plugins...] ``` ## Options -```bash - --channel Sets the update channel [array] [choices: "edge", "none", "stable"] - --help Shows lando or delegated command help if applicable [boolean] - --auth, -a Use global or scoped auth [array] [default: []] - --registry, -r, -s, --scope Use global or scoped registry [array] [default: []] +```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: []] ``` diff --git a/docs/plugin-login.md b/docs/plugin-login.md new file mode 100644 index 000000000..78514807e --- /dev/null +++ b/docs/plugin-login.md @@ -0,0 +1,35 @@ +--- +title: lando plugin-login +description: lando plugin-login logs you into a valid lando plugin registry +--- + +# lando plugin-login + +Logs into a Lando plugin registry. + +This will authorize your Lando installation against a Lando plugin registry. A "Lando Plugin Registry" is any `npm` compatible regsitry eg: + +* `https://registry.npmjs.org` +* `https://npm.pkg.github.com` + +If no registry is specified then `https://registry.npmjs.org` is used. + +## Usage + +```sh +lando plugin-login +``` + +## 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] +--password, -p The registry password [string] +--registry, -r Use registry [string] [default: "https://registry.npmjs.org"] +--scope, -s Use scopes [array] +--username, -u The registry username [string] +``` diff --git a/docs/plugin-logout.md b/docs/plugin-logout.md new file mode 100644 index 000000000..2167c7a3c --- /dev/null +++ b/docs/plugin-logout.md @@ -0,0 +1,24 @@ +--- +title: lando plugin-logout +description: lando plugin-logout Logs you out of all active sessions established by lando plugin-login +--- + +# lando plugin-logout + +Logs you out of _all_ active sessions established by `lando plugin-login` + +## Usage + +```sh +lando plugin-logout +``` + +## 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] +``` diff --git a/docs/plugin-remove.md b/docs/plugin-remove.md index 5f038795a..ca23bdb7d 100644 --- a/docs/plugin-remove.md +++ b/docs/plugin-remove.md @@ -3,21 +3,24 @@ title: lando plugin-remove description: lando plugin-remove removes the plugin(s) indicated in the primary argument. --- -# plugin-remove +# lando plugin-remove -Removes plugins.. +Removes plugins. -This will remove the plugin(s) indicated in the primary argument from Lando's plugin registry and from your `.lando/plugins` directory. +This will remove the plugin(s) passed in as arguments from Lando. ## Usage -```bash +```sh lando plugin-remove [plugins...] ``` ## Options -```bash - --channel Sets the update channel [array] [choices: "edge", "none", "stable"] - --help Shows lando or delegated command help if applicable [boolean] +```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] ``` diff --git a/docs/poweroff.md b/docs/poweroff.md index be916988b..a4e1d1bb3 100644 --- a/docs/poweroff.md +++ b/docs/poweroff.md @@ -3,7 +3,7 @@ title: lando poweroff description: No! Shut them all down! lando poweroff will stop ALL lando related apps and containers. --- -# poweroff +# lando poweroff Spins down all lando related containers @@ -11,13 +11,16 @@ This is useful if you want to deactivate all the containers needed to run Lando. ## Usage -```bash +```sh lando poweroff ``` ## Options -```bash ---help Shows lando or delegated command help if applicable ---verbose, -v Runs with extra verbosity +```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] ``` diff --git a/docs/rebuild.md b/docs/rebuild.md index c32163672..50998397f 100644 --- a/docs/rebuild.md +++ b/docs/rebuild.md @@ -3,7 +3,7 @@ title: lando rebuild description: lando rebuild rebuilds your app from scratch, preserving data and re-running any configured build steps as though you were starting your app for the first time. --- -# rebuild +# lando rebuild Rebuilds your app from scratch, preserving data. @@ -15,7 +15,7 @@ As of Lando 3.0.0-rc.1 you must explicitly invoke `lando rebuild` for changes in ## Usage -```bash +```sh # Rebuild an app lando rebuild @@ -30,9 +30,12 @@ lando rebuild -s cache -s appserver Run `lando rebuild --help` to get a complete list of options defaults, choices, etc. -```bash ---help Shows lando or delegated command help if applicable ---services, -s Rebuild only the specified services ---verbose, -v Runs with extra verbosity ---yes, -y Auto answer yes to prompts +```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] +--service, -s Rebuild only the specified services [array] +--yes, -y Auto answer yes to prompts [boolean] [default: false] ``` diff --git a/docs/restart.md b/docs/restart.md index e453abe3c..ab1a0310d 100644 --- a/docs/restart.md +++ b/docs/restart.md @@ -3,7 +3,7 @@ title: lando restart description: lando restart stops your lando app and then starts it again, preserving container state. --- -# restart +# lando restart Restarts your app. @@ -15,13 +15,16 @@ As of version `3.0.0-rc1` Lando will no longer run **ANY** build steps on a `lan ## Usage -```bash +```sh lando restart ``` ## Options -```bash ---help Shows lando or delegated command help if applicable ---verbose, -v Runs with extra verbosity +```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] ``` diff --git a/docs/setup.md b/docs/setup.md index eacda9668..e7f4aeb40 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -1,23 +1,35 @@ --- title: lando setup -description: lando setup installs the constituent components of Lando. +description: lando setup installs the constituent components of Lando. --- -# setup +# lando setup -setups Lando. +Installs and configures needed system dependencies and plugins so you can use `lando` such as: + +* **Build Engine** - Docker Desktop on Windows and macOS, Docker Engine on Linux +* **Orchestrator** - Docker Compose v2 +* **Common Plugins** - Basically all the plugins that used to be part of Lando Core before v3.21.0 -This will setup all the constituent components of Lando, including `@lando/core`, `@lando/cli`, and all of the default Lando plugins (currently all plugins in the[`@lando` org](https://github.com/lando)). ## Usage -```bash +```sh lando setup ``` ## Options -```bash - --help Shows lando or delegated command help if applicable [boolean] - --yes, -y Runs non-interactively with all accepted default answers [boolean] [default: false] +```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] +--build-engine The version of the build engine (docker-desktop) to install [string] [default: "4.27.2"] +--build-engine-accept-license Accepts the Docker Desktop license during install instead of later [boolean] [default: false] +--orchestrator The version of the orchestrator (docker-compose) to install [string] [default: "2.24.5"] +--plugin Additional plugin(s) to install [array] [default: []] +--skip-common-plugins Disables the installation of common Lando plugins [boolean] [default: false] +--yes, -y Runs non-interactively with all accepted default answers [boolean] [default: false] ``` diff --git a/docs/share.md b/docs/share.md index eb1347404..876adcfda 100644 --- a/docs/share.md +++ b/docs/share.md @@ -3,7 +3,7 @@ title: lando share description: lando share exposes your local site to the world with a publicly accessible URL. --- -# share +# lando share ::: danger OFFLINE! This command is no longer functional as of version 3.0.0-rrc.3 @@ -23,13 +23,13 @@ Try running `lando info` from inside your app. Any service with a `http://localh ## Usage -```bash +```sh lando share -u http://localhost:32785 ``` ## Options -```bash +```sh --help Shows lando or delegated command help if applicable --url, -u Url to share. Needs to be in the form http://localhost:port --verbose, -v Runs with extra verbosity diff --git a/docs/shellenv.md b/docs/shellenv.md new file mode 100644 index 000000000..cc8745231 --- /dev/null +++ b/docs/shellenv.md @@ -0,0 +1,26 @@ +--- +title: lando shellenv +description: lando shellenv prints information you can use to add lando PATH info to a shell rcfile. +--- + +# lando shellenv + +Prints information you can add to a shell rcfile like `~/.zshrc`. + +## Usage + +```sh +lando shellenv +``` + +## 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] +--add, -a Add to shell profile if blank lando will attempt discovery [string] +--check, -c Check to see if lando is in PATH [boolean] +``` diff --git a/docs/ssh.md b/docs/ssh.md index c731956d6..d2944a8db 100644 --- a/docs/ssh.md +++ b/docs/ssh.md @@ -3,7 +3,7 @@ title: lando ssh description: lando ssh docker execs into a Lando service, dropping you into a shell by default or running specific commands as a given user. --- -# ssh +# lando ssh Drops into a shell on a service, runs commands @@ -17,7 +17,7 @@ Try running `lando info` from inside your app to get a list of services you can ## Usage -```bash +```sh # Drops into a bash shell on the appserver, falls back to sh if bash is unavailable lando ssh @@ -35,10 +35,12 @@ lando ssh --service appserver --user root --command "apt-get update && apt insta Run `lando ssh --help` to get a complete list of options defaults, choices, etc. -```bash +```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] --command, -c Run a command in the service ---help Shows lando or delegated command help if applicable ---service, -s SSH into this service ---user, -u Run as a specific user ---verbose, -v Runs with extra verbosity +--service, -s SSH into this service [default: "appserver"] ``` diff --git a/docs/start.md b/docs/start.md index 951ea0481..2aa0bdf9f 100644 --- a/docs/start.md +++ b/docs/start.md @@ -3,7 +3,7 @@ title: lando start description: lando start boots up the containers needed to serve, run and develop your application. --- -# start +# lando start Starts an app. @@ -15,13 +15,16 @@ If you start an app with a new service or container it will need to pull that co ## Usage -```bash +```sh lando start ``` ## Options -```bash ---help Shows lando or delegated command help if applicable ---verbose, -v Runs with extra verbosity +```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] ``` diff --git a/docs/stop.md b/docs/stop.md index 95e4501d8..8f1fe9004 100644 --- a/docs/stop.md +++ b/docs/stop.md @@ -3,7 +3,7 @@ title: lando stop description: lando stop spins down the containers needed to serve, run and develop your application. --- -# stop +# lando stop Stops an app. @@ -11,13 +11,16 @@ This will spin down all containers and services associated with this app. ## Usage -```bash +```sh lando stop ``` ## Options -```bash ---help Shows lando or delegated command help if applicable ---verbose, -v Runs with extra verbosity +```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] ``` diff --git a/docs/tooling.md b/docs/tooling.md deleted file mode 100644 index b4e4259cb..000000000 --- a/docs/tooling.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: Tooling -description: Lando plugins can add additional CLI commands, called "tooling commands" or "tooling." ---- - -# Tooling From Plugins - -Each Landofile may implement _additional_ [tooling commands](https://docs.lando.dev/core/v3/tooling.html) that are only available for that application. These commands are usually wrappers for development tools like `lando composer` or `lando artisan` or `lando npm`. - -Run `lando` inside of an app to see if it offers any app specific tooling options. Here is an example of what the default `lamp` recipe will give you. Note the additional app-specific commands like `lando composer` and `lando db-import`. - -```bash -Usage: lando [args] [options] - -Commands: - lando composer Runs composer commands - lando config Displays the lando configuration - lando db-export [file] Exports database from a service into a file - lando db-import Imports a dump file into database service - lando destroy Destroys your app - lando info Prints info about your app - lando init Initializes code for use with lando - lando list Lists all running lando apps and containers - lando logs Displays logs for your app - lando mysql Drops into a MySQL shell on a database service - lando php Runs php commands - lando poweroff Spins down all lando related containers - lando rebuild Rebuilds your app from scratch, preserving data - lando restart Restarts your app - lando share Shares your local site publicly - lando ssh Drops into a shell on a service, runs commands - lando start Starts your app - lando stop Stops your app - lando version Displays the lando version - -Options: - --channel Sets the update channel - --clear Clears the lando tasks cache - --experimental Activates experimental features - --help Shows lando or delegated command help if applicable - --verbose, -v Runs with extra verbosity - -Examples: - lando start Run lando start - lando rebuild --help Get help about using the lando rebuild command - lando destroy -y -vvv Run lando destroy non-interactively and with maximum verbosity - lando --clear Clear the lando tasks cache - -You need at least one command before moving on -``` diff --git a/docs/update.md b/docs/update.md index bcd5d8ddb..56c9735cf 100644 --- a/docs/update.md +++ b/docs/update.md @@ -3,7 +3,7 @@ title: lando update description: lando update updates all of Lando's components, including installed plugins. --- -# update +# lando update Updates Lando. @@ -11,13 +11,17 @@ This will update all the constituent components of Lando, including `@lando/core ## Usage -```bash +```sh lando update ``` ## Options -```bash - --help Shows lando or delegated command help if applicable [boolean] - --yes, -y Runs non-interactively with all accepted default answers [boolean] [default: false] +```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] +--yes, -y Runs non-interactively with all accepted default answers [boolean] [default: false] ``` diff --git a/docs/version.md b/docs/version.md index c1f60a068..6a873c6a2 100644 --- a/docs/version.md +++ b/docs/version.md @@ -3,22 +3,25 @@ title: lando version description: If you can't guess what this command does you might want to consider a different career ;) --- -# version +# lando version Displays the version of Lando and optionally its component plugins. ## Usage -```bash +```sh lando version ``` ## Options -```bash ---help Shows lando or delegated command help if applicable ---verbose, -v Runs with extra verbosity ---all, -a Show all version information ---component, -c Show version info for specific component ---full, -f Show full version string +```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 version information [boolean] +--component, -c Show version info for specific component [string] [default: "@lando/core"] +--full, -f Show full version string [boolean] ``` diff --git a/lib/art.js b/lib/art.js index d2a864d0f..d5f027a27 100644 --- a/lib/art.js +++ b/lib/art.js @@ -300,48 +300,43 @@ exports.newContent = (type = 'guide') => [ '', ].join(os.EOL); -exports.setupHeader = (bengine = process.platform === 'linux' ? 'Engine' : 'Desktop') => [ - '', - chalk.magenta(niceFont('Lando Setup!', 'Small Slant')), - '', - `${chalk.bold('lando setup')} is a convenience command to help you satisify the dependencies needed`, - 'to run Lando. Typically it includes the installation and setup of some combination of the below', - 'However, if you already have the needed dependencies it will happily do nothing and exit.', - '', - chalk.cyan(` ${figures.squareSmallFilled} Common Lando Plugins`), - chalk.cyan(` ${figures.squareSmallFilled} Docker ${bengine}`), - chalk.cyan(` ${figures.squareSmallFilled} Docker Compose`), - '', - 'It will attempt to install plugins first and then it will run any needed setup tasks. For more information on', - `customizing setup please run ${chalk.bold('lando setup --help')}`, - '', -].join(os.EOL); +exports.setupHeader = (bengine = process.platform === 'linux' ? 'Engine' : 'Desktop') => ` +${chalk.magenta(niceFont('Lando Setup!', 'Small Slant'))} + +${chalk.bold('lando setup')} is a hidden convenience command to help you satisify the +dependencies needed to run Lando. Typically it includes the installation and +setup of some combination of the below: + +${chalk.cyan(`${figures.squareSmallFilled} Common Lando Plugins`)} +${chalk.cyan(`${figures.squareSmallFilled} Docker ${bengine}`)} +${chalk.cyan(`${figures.squareSmallFilled} Docker Compose`)} + +However, if you already have the needed dependencies it will happily do nothing +and exit. It will attempt to install plugins first and then it will run any +needed setup tasks. + +For more information on customizing setup please run ${chalk.bold('lando setup --help')} +or visit ${chalk.magenta('https://docs.lando.dev/cli/setup.html')} +`; /* * Helper to show NO DOCKER error message */ -exports.noDockerDep = (dep = 'Docker Desktop') => [ - '', - chalk.red(niceFont('Uh oh!', 'ANSI Shadow')), - '', - `Lando could not detect an installation of ${dep.toUpperCase()} which is a required dependency!`, - 'This most often happens if you have installed Lando manually or from source and have not RTFM.', - '', - `You should run ${chalk.bold('lando setup')} which will attempt to install the things Lando needs to work`, - 'correctly.', - '', - 'When you have completed the above, try running Lando again. If you still have issues', - 'we recommend you install Lando using the convenience script as this will install', - 'and setup the needed dependencies for you.', - chalk.green('https://github.com/lando/lando/releases'), - '', - 'If you are still having issues after that we recommend you post an issue on Github', - 'or ping us in the Slack channel', - '', - chalk.magenta(` ${figures.squareSmallFilled} Slack - https://launchpass.com/devwithlando`), - chalk.magenta(` ${figures.squareSmallFilled} GitHub - https://github.com/lando/lando/issues/new/choose`), - '', -].join(os.EOL); +exports.noDockerDep = (dep = 'Docker Desktop') => ` +${chalk.yellow(niceFont('U Need Setup!', 'Small Slant'))} + +Lando has detected that it does not have all the dependencies it needs to run. +But ${chalk.bold('FEAR NOT')} because we have a special hidden convenience command called ${chalk.bold('lando setup')} +which will do the heavy lifting and set you right. + +Run ${chalk.bold('lando setup')} and when it completes try running Lando again. + +If you get an error or have any issues we recommend you post an issue on +GitHub or ping us in our Slack channel! + +${chalk.magenta(`${figures.squareSmallFilled} Slack - https://launchpass.com/devwithlando`)} +${chalk.magenta(`${figures.squareSmallFilled} GitHub - https://github.com/lando/lando/issues/new/choose`)} +`; /* * Helper to show status of secret toggle diff --git a/lib/cli-next.js b/lib/cli-next.js index 3f821b60f..17741b373 100644 --- a/lib/cli-next.js +++ b/lib/cli-next.js @@ -361,7 +361,7 @@ module.exports = class Cli { const minstrapper = {config, product}; // Concat OCLIF hooks from config if applicable, transform to absolute paths - // @NOTE: we do this here instead of passing in during instantiation in bin/lando.js because Config.load is async + // @NOTE: we do this here instead of passing in during instantiation in bin/lando because Config.load is async // and we want to use that so we can accomodate any "oclif" plugins that add hooks' const ohooks = oclif.getPluginsList() .map(plugin => require('@lando/core-next/utils/normalize-manifest-paths')({hooks: plugin.hooks}, plugin.root)) diff --git a/lib/cli.js b/lib/cli.js index c65981e21..cbb47b47e 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -56,11 +56,14 @@ module.exports = class Cli { prefix = 'LANDO', logLevel = 'warn', userConfRoot = path.join(os.homedir(), '.lando'), - coreBase = '@lando/core') { + coreBase = '@lando/core', + debug = require('@lando/core-next/debug')('@lando/cli'), + ) { this.prefix = prefix; this.logLevel = logLevel; this.userConfRoot = userConfRoot; this.coreBase = coreBase; + this.debug = debug; this.chalk = require('chalk'); } @@ -145,17 +148,21 @@ module.exports = class Cli { // when packaged this resolves symlinks and gives you the actual absolute path of the binary // when run from source it gives you the path to js entrypoint - const entrypoint = packaged ? process.execPath : _.get(process, 'mainModule.filename', process.argv[1]); - // this should be the symlink resolved dir where the "entrypoint" is installed - const installPath = path.dirname(entrypoint); + const entrypoint = packaged ? path.resolve(process.argv0) ?? get(process, 'env._') : process.argv[1] ?? get(process, 'env._'); + const file = packaged ? process.execPath : _.get(process, 'mainModule.filename', process.argv[1]); + + // this is just the default place to install the lando binaries + // @NOTE: in lando 4 we need some kind of "system wide/root" location for this eg /usr/local/bin? + const installPath = path.join(this.userConfRoot, 'bin'); // if the cli is running from source (eg a git repo) or not const source = fs.existsSync(path.join(srcRoot, '.git', 'HEAD')); const commit = source ? require('../utils/get-commit-hash')(srcRoot, {short: true}) : false; const coreBase = this.coreBase === '@lando/core'; + const slim = !fs.existsSync(path.resolve(__dirname, '..', 'FATCORE')); // put it all together - const cli = {commit, coreBase, dev, entrypoint, installPath, packaged, plugin: srcRoot, source}; + const cli = {commit, coreBase, dev, entrypoint, file, installPath, packaged, plugin: srcRoot, slim, source}; const config = { alliance: fs.existsSync(path.join(this.userConfRoot, 'secret-toggle')), @@ -167,7 +174,7 @@ module.exports = class Cli { disablePlugins: ['lando-core', '@lando/core-next'], experimental: false, envPrefix: this.prefix, - fatcore: fs.existsSync(path.resolve(__dirname, '..', 'FATCORE')), + fatcore: !slim, isInteractive: require('is-interactive')(), landoFile: '.lando.yml', landoFileConfig: appConfig, diff --git a/package-lock.json b/package-lock.json index 70e86456d..0269325e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "GPL-3.0", "dependencies": { "@lando/argv": "^1.1.0", - "@lando/core": "^3.21.0-beta.4", + "@lando/core": "^3.21.0-beta.5", "@lando/core-next": "npm:@lando/core@^4.0.0-unstable.5", "@oclif/core": "^3.5.0", "@oclif/parser": "^3.8.17", @@ -32,7 +32,7 @@ "yargs": "^12.0.5" }, "bin": { - "lando": "bin/lando.js" + "lando": "bin/lando" }, "devDependencies": { "@babel/core": "^7.20.5", @@ -1352,9 +1352,9 @@ } }, "node_modules/@lando/core": { - "version": "3.21.0-beta.4", - "resolved": "https://registry.npmjs.org/@lando/core/-/core-3.21.0-beta.4.tgz", - "integrity": "sha512-4bJW3H9EGSw1CKlQVAPRtzo56HKw4BbbjKIjJvWO4Iqnzj7wC/NZqzw/DBSkA5NLjDGSqYAWqDcVJM1rlVy8FQ==", + "version": "3.21.0-beta.5", + "resolved": "https://registry.npmjs.org/@lando/core/-/core-3.21.0-beta.5.tgz", + "integrity": "sha512-+lelE6GKNOdrgDjwId3NM2vyMVsZAuSPcvQ0wfU9Qw2uqERob0ARTbnVrLw5PSwW0nzWxpwyxFMLJGnEWK3n1A==", "bundleDependencies": [ "@npmcli/arborist", "@octokit/rest", @@ -19939,9 +19939,9 @@ "integrity": "sha512-b3d4zF1QBrFgUCFxEb48b0hse98wRhfnnydFsKXTcQc4aogfCBZc9wbgktLrs6TUtLKvU57YtlfNU4ack1ll7w==" }, "@lando/core": { - "version": "3.21.0-beta.4", - "resolved": "https://registry.npmjs.org/@lando/core/-/core-3.21.0-beta.4.tgz", - "integrity": "sha512-4bJW3H9EGSw1CKlQVAPRtzo56HKw4BbbjKIjJvWO4Iqnzj7wC/NZqzw/DBSkA5NLjDGSqYAWqDcVJM1rlVy8FQ==", + "version": "3.21.0-beta.5", + "resolved": "https://registry.npmjs.org/@lando/core/-/core-3.21.0-beta.5.tgz", + "integrity": "sha512-+lelE6GKNOdrgDjwId3NM2vyMVsZAuSPcvQ0wfU9Qw2uqERob0ARTbnVrLw5PSwW0nzWxpwyxFMLJGnEWK3n1A==", "requires": { "@npmcli/arborist": "^6.2.9", "@octokit/rest": "^19", diff --git a/package.json b/package.json index 66bbc8130..d219389ad 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "main": "lib/cli.js", "babel": {}, "bin": { - "lando": "./bin/lando.js" + "lando": "./bin/lando" }, "directories": { "bin": "./bin", @@ -44,7 +44,7 @@ "all": true }, "scripts": { - "pkg": "pkg -c package.json -t node18 bin/lando.js", + "pkg": "pkg -c package.json -t node18 bin/lando", "docs:dev": "vitepress dev docs", "docs:build": "vitepress build docs", "docs:preview": "vitepress preview docs", @@ -105,7 +105,7 @@ }, "dependencies": { "@lando/argv": "^1.1.0", - "@lando/core": "^3.21.0-beta.4", + "@lando/core": "^3.21.0-beta.5", "@lando/core-next": "npm:@lando/core@^4.0.0-unstable.5", "@oclif/core": "^3.5.0", "@oclif/parser": "^3.8.17",