1.4.1 ⢠Published 2 months ago
@sp-packages/lando-pull v1.4.1
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
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.