CLI: Add sync push/pull commands#2878
Open
bcotrim wants to merge 29 commits intoadd_cli_sync_and_import_operationsfrom
Open
CLI: Add sync push/pull commands#2878bcotrim wants to merge 29 commits intoadd_cli_sync_and_import_operationsfrom
bcotrim wants to merge 29 commits intoadd_cli_sync_and_import_operationsfrom
Conversation
- Move process.emit restore into finally block in push command - Emit SYNC_EVENTS.FAILED in catch blocks for both pull and push - Extract poll constants and parseSyncOptions to shared locations
Collaborator
📊 Performance Test ResultsComparing 63f96ff vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
bcotrim
commented
Mar 27, 2026
apps/cli/commands/sync/pull.ts
Outdated
| 'Comma-separated sync options: all, sqls, uploads, plugins, themes, contents' | ||
| ), | ||
| } ) | ||
| .option( 'site', { |
Contributor
Author
There was a problem hiding this comment.
Call it remote-site or something similar, to make the intention clear.
Let's remove the "skips..." part from the description
…gs, double-cancel, reorder validation, remove re-exports
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
How AI was used in this PR
TBD
Proposed Changes
tools/common/types/sync.ts, shared between CLI and desktop — removes ~120 lines of duplicated schemas fromwpcom-sites.tsandsync-operations-slice.tsSYNC_EVENTSenum and schemas intools/common/lib/cli-events.tsfor CLI→Studio sync awareness (STARTED, PROGRESS, COMPLETED, FAILED)_eventscommand →cli-events-subscriber→ renderer IPCapps/cli/lib/sync-api.tswith all wpcom sync API functions:fetchSyncableSites,initiateBackup,pollBackupStatus,tusUpload,initiateImport,pollImportStatus,downloadBackupapps/cli/lib/sync-site-picker.ts— interactive site picker using@inquirer/promptswith sync support filtering (disabled items for unsupported sites)studio sync pullcommand (STU-1356): auth → fetch sites → interactive picker → initiate backup → poll status → download. Local import is stubbed as TODO pending the import/export modulestudio sync pushcommand (STU-1355): auth → fetch sites → interactive picker → throws with "not yet implemented" since local export requires the export/import modulesynccommand group in CLI entry point withpullandpushsubcommandsTesting Instructions
npm run cli:buildnode apps/cli/dist/cli/main.js sync --help— should showpullandpushsubcommandsnode apps/cli/dist/cli/main.js sync pull --path <site-folder>— should prompt for auth if not logged in, then fetch sites and show interactive pickernode apps/cli/dist/cli/main.js sync push --path <site-folder>— should show picker then report "not yet implemented"npm run typecheckpasses (pre-existing errors inipc-handlers.tsare unrelated)Pre-merge Checklist