1.4.1 • Published 2 months ago

@sp-packages/lando-pull v1.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Lando Pull

✨ Features

  • šŸ”„ Sync remote databases to your local Lando environment.
  • šŸ“‚ Sync remote files with rsync.
  • šŸ”‘ Supports password & SSH key authentication.
  • āš™ Customizable configuration via landorc.json.
  • šŸš€ Fast execution with minimal setup.
  • šŸ— Ideal for development workflows with WordPress & Lando.

šŸ“¦ Installation

Global Installation

npm install -g lando-pull

This allows you to use lando-pull globally in your terminal.

Local Installation

npm install lando-pull --save-dev

Then, run it via:

npx lando-pull

šŸš€ CLI Usage

Basic Usage

lando-pull [options]

Options:

Usage: Lando Pull [options]

A CLI tool for syncing remote databases and files to your local Lando environment.

Options:
  -V, --version           output the version number
  -c, --config <config>   Path to the configuration file (default: landorc.json)
  -d, --debug             Debug mode
  -q, --quiet             Disable output
  -v, --verbose           Enable verbose logging
  --skip-db               Skip database
  --skip-files            Skip files
  --auth-method <method>  Authentication method: 'password' or 'key'
  --key-path <keyPath>    Path to SSH private key (for key-based auth)
  --password [password]   Remote server password (for password auth, recommended via ENV)
  -h, --help              display help for command

Examples:

lando-pull --auth-method key --key-path ~/.ssh/id_rsa
lando-pull --config custom-landorc.json --verbose
lando-pull --skip-files
lando-pull --auth-method password --password my_secure_password

āš™ļø Configuration (landorc.json)

Lando Pull uses a configuration file (landorc.json) to define remote connection details. By default, Lando Pull will look for a landorc.json or .landorc.json file in your project's root directory. You can also pass the custom path using --config parameter.

Example Configuration:

{
  "remote": {
    "host": "example.com",
    "user": "ssh_user",
    "port": 22,
    "authMethod": "key",
    "keyPath": "/path/to/private/key",
    "dbName": "database_name",
    "dbUser": "database_user",
    "dbPassword": "database_password",
    "tempFolder": "/tmp",
    "remoteFiles": "website/root/path/uploads"
  },
  "local": {
    "dbHost": "127.0.0.1",
    "dbName": "wordpress",
    "dbUser": "wordpress",
    "dbPassword": "wordpress",
    "dbPort": 3306,
    "tempFolder": "/tmp",
    "localFiles": "website/root/path/uploads",
    "databaseUpdates": [
      {
        "table": "wp_users",
        "column": "user_email",
        "conditions": [
          {
            "column": "user_login",
            "operator": "=",
            "value": "admin"
          }
        ],
        "value": "local-admin@example.com"
      }
    ]
  }
}

Configurable Options

KeyDescription
remote.hostRemote server hostname
remote.userSSH username
remote.portSSH port (default: 22)
remote.pathRemote folder to sync (e.g., /wp-content/uploads)
remote.dbNameRemote database name
remote.dbUserRemote database username
remote.dbPasswordRemote database password
remote.dbHostRemote database host (e.g., 127.0.0.1)
remote.authMethodAuthentication method (password or key)
remote.keyPathSSH key file path (if using key authentication)
local.dbNameLocal database name
local.filesPathLocal folder to sync (e.g., /wp-content/uploads)

šŸ“œ Example Outputs

############################################################
 Running Lando Pull
############################################################
**************************************************
 Pulling database
**************************************************
āœ” [SUCCESS] Database imported successfully.
**************************************************
 Syncing files
**************************************************
āœ” [SUCCESS] Files synchronized via rsync.
**************************************************
 Lando Pull Completed
**************************************************
šŸŽ‰ All tasks completed successfully!

šŸ’” Use Cases

  • WordPress Development – Easily pull live database & uploads to your local Lando site.
  • Backup & Restore – Quickly sync remote backups for local testing.
  • CI/CD Integration – Automate database and file sync in deployment workflows.

šŸ¤ Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.


šŸ“œ License

This project is licensed under the MIT License. See the LICENSE file for details.

1.4.1

2 months ago

1.4.0

2 months ago

1.3.0

3 months ago

1.2.2

3 months ago

1.2.1

4 months ago

1.2.0

4 months ago

1.1.0

4 months ago

1.0.0

4 months ago