@sp-packages/lando-pull
v1.4.3
Published
A CLI tool for syncing remote databases and files to your local Lando environment.
Maintainers
Readme
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-pullThis allows you to use lando-pull globally in your terminal.
Local Installation
npm install lando-pull --save-devThen, 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 commandExamples:
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": "[email protected]"
}
]
}
}Configurable Options
| Key | Description |
| ------------------- | --------------------------------------------------- |
| remote.host | Remote server hostname |
| remote.user | SSH username |
| remote.port | SSH port (default: 22) |
| remote.path | Remote folder to sync (e.g., /wp-content/uploads) |
| remote.dbName | Remote database name |
| remote.dbUser | Remote database username |
| remote.dbPassword | Remote database password |
| remote.dbHost | Remote database host (e.g., 127.0.0.1) |
| remote.authMethod | Authentication method (password or key) |
| remote.keyPath | SSH key file path (if using key authentication) |
| local.dbName | Local database name |
| local.filesPath | Local 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.
