Connect and Sync from Kinsta
Kinsta has no vendor CLI. wdg my-site sync kinsta uses the Kinsta API to resolve SSH connection details for a site environment, then runs wp db export over SSH with your own SSH key and imports the dump locally. It can also rsync the uploads directory.
Prerequisites
ssh,rsync,curl, andjqon your PATH (on macOS install missing tools withbrew install; on Debian/Ubuntu use your package manager).- A Kinsta API key and your company/workspace ID configured once with
wdg kinsta auth. - Your SSH public key registered with each environment you sync.
One-time setup
Run the authentication command once. It stores the API key and company ID in ~/.wdg/kinsta.env with 0600 permissions (the same ~/.wdg secret pattern used for Figma OAuth and MCP proxy tokens):
wdg kinsta authTo generate the inputs:
- Generate an API key in MyKinsta under Company settings -> API Keys.
- Find your company ID in MyKinsta under Company settings -> Billing details.
wdg kinsta auth writes KINSTA_API_KEY and KINSTA_COMPANY_ID to the key file and validates the key against the company when both are present.
Register your SSH public key
The sync authenticates over SSH with your own key, so register your SSH public key with each environment you intend to sync. In MyKinsta, open the site, choose the environment, and add your key under SFTP/SSH credentials (Add SSH key).
Company/workspace ID requirement
The Kinsta API requires a company/workspace ID on every call and cannot list companies, so the ID must always be resolvable. The sync resolves it in this order:
- The
--company=IDflag. - The project manifest field
hosting.company(inproject.yml). - The global
KINSTA_COMPANY_IDstored bywdg kinsta auth.
If you work across multiple Kinsta companies, set each project's company in its manifest or pass --company on the sync.
Helper commands
wdg kinsta status # validate the stored key and show the configured company
wdg kinsta sites # list sites and environments the key can accesswdg kinsta sites prints each site with its environments, which is the quickest way to confirm the exact site name to pass to the sync.
Sync command
wdg my-site sync kinsta --site=NAME --env=ENV [--media] [--company=ID]Flags:
--site=NAME: the Kinsta site name or display name. If omitted (and not in the manifest), the sync presents an interactive site picker.--env=ENV: the environment name. Defaults tolive.--media: also rsync the uploads directory over SSH.--company=ID: the Kinsta company/workspace ID. Overrides the manifest and the global default.--prod-url=DOMAIN: an additional production domain to search-replace to the local URL.
Example
wdg my-site sync kinsta --site=mysite --env=live --mediaThis resolves SSH details for the live environment, exports the database over SSH, imports it, replaces the Kinsta URL with your local URL, then rsyncs uploads.
Missing company ID
The most common failure is an unresolved company/workspace ID. The API rejects every call without one, and it cannot be discovered automatically. If the sync reports the company ID is not configured, set it one of three ways: pass --company=ID, set hosting.company in the project manifest, or re-run wdg kinsta auth to store a global KINSTA_COMPANY_ID.
💡 TIP
If the database export fails over SSH, confirm your SSH public key is registered with that exact environment in MyKinsta (site -> Environment -> SFTP/SSH credentials -> Add SSH key).