Add push/pull and import/export commands to the CLI#3010
Merged
fredrikekelund merged 9 commits intotrunkfrom Apr 9, 2026
Merged
Add push/pull and import/export commands to the CLI#3010fredrikekelund merged 9 commits intotrunkfrom
fredrikekelund merged 9 commits intotrunkfrom
Conversation
* Add sync push/pull CLI commands with shared Zod schemas and event pipeline * Fix CLI build by replacing stream/promises with stream import * Fix lint errors in sync store files * Add progress tracking, --archive flag, and better error handling to sync commands * Add interactive selective sync to CLI push and pull commands * Extract shared sync logic to common and fix selective pull bugs * Fix pre-existing TS error in process.emit override * Fix lint error in process.emit override * Remove unused sync constants re-export * Remove unnecessary comment in sync-operations-slice * Add esc cancel support and unify help tip layout across prompts * Fix return types for sync selector cancel support * Use Zod schema for SyncOption validation instead of manual VALID_OPTIONS * Fix sync event lifecycle bugs and extract shared constants - 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 * Add sync size validation to CLI push and pull commands * Simplify type annotations in sync push and pull commands * Remove unused sync CLI events * Add --site arg, stale-progress polling, and fix push archive flow * Rename --site arg to --remote-site in sync commands * Address PR feedback: move try/catch to handlers, parse options in yargs, double-cancel, reorder validation, remove re-exports * Move logger to module scope in sync pull/push commands * Remove type re-exports, import directly from common * Fix import order in sync test * Remove dead tusUpload and use raw progress for stall detection * Address PR feedback: use normalizeHostname, chalk, camelCase schema, remove type assertion * Address PR feedback: camelCase schemas, static tus import, sort by name, remove re-exports --------- Co-authored-by: Fredrik Rombach Ekelund <fredrik@f26d.dev>
* Add sync push/pull CLI commands with shared Zod schemas and event pipeline * Fix CLI build by replacing stream/promises with stream import * Fix lint errors in sync store files * Add progress tracking, --archive flag, and better error handling to sync commands * Add interactive selective sync to CLI push and pull commands * Extract shared sync logic to common and fix selective pull bugs * Fix pre-existing TS error in process.emit override * Fix lint error in process.emit override * Remove unused sync constants re-export * Remove unnecessary comment in sync-operations-slice * Add esc cancel support and unify help tip layout across prompts * Fix return types for sync selector cancel support * Use Zod schema for SyncOption validation instead of manual VALID_OPTIONS * Fix sync event lifecycle bugs and extract shared constants - 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 * Add sync size validation to CLI push and pull commands * Simplify type annotations in sync push and pull commands * Remove unused sync CLI events * Add --site arg, stale-progress polling, and fix push archive flow * Rename --site arg to --remote-site in sync commands * Address PR feedback: move try/catch to handlers, parse options in yargs, double-cancel, reorder validation, remove re-exports * Move logger to module scope in sync pull/push commands * Remove type re-exports, import directly from common * Fix import order in sync test * First iteration of the `import` CLI command * Initial version of export command * Polishing * Fix and refine * Import command: restart site on error, too * Allow .sql exports without `--only` flag * Improved error handling * More error handling * Move files * Wire up import/export logic to sync commands * Install missing dependency * Cleanup and test fixes * Windows-friendly paths in test * Fix issues identified in review * Address review comments * Stray console.log * Revert Playground downgrades and implement WP-CLI fix * Disallow database-only exports for .zip and .tar.gz files * Numerous changes - Default values for export files. - Replace `--only` with `--mode` for export command. Users can choose between "full" and "db". The `--mode` option is required and defaults to `full`. * Address review comments --------- Co-authored-by: bcotrim <bernardo.cotrim@a8c.com> Co-authored-by: Bernardo Cotrim <bmmcotrim@gmail.com>
Collaborator
📊 Performance Test ResultsComparing f3180ad 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) |
Also, sort all CLI commands alphabetically
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
N/A
How AI was used in this PR
N/A
Proposed Changes
This branch contains the changes from #2963 and #2878. This PR is simply meant for landing the branch to trunk.
TO-DO:
studio pullinstead ofstudio sync pull, etc)Testing Instructions
CI should pass.
Pre-merge Checklist