feat: add project export and import CLI commands (#1025)#98
Merged
rquidute merged 3 commits intoJun 22, 2026
Conversation
Add 'project export' and 'project import' subcommands to the CLI,
wiring up the existing backend endpoints:
- GET /api/v1/projects/{id}/export
- POST /api/v1/projects/import
project export:
- Downloads the project config as a JSON file
- Defaults to '<project-name>-project-config.json' if no output file is given
- Accepts --output-file / -o to specify a custom path
project import:
- Accepts --file / -f pointing to a previously exported JSON file
- Sends the file bytes to the backend and prints the new project ID
Also adds full unit test coverage in tests/test_project_commands.py
(TestExportProjectCommand and TestImportProjectCommand).
Closes #1025
…ests - Add missing 'import json' to test_project_commands.py - Update test_run_tests_logger_configuration to include enable_log_streaming=True in the expected configure_logger_for_run call, matching the actual call signature
|
Tick the box to add this pull request to the merge queue (same as
|
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces new CLI commands to export and import project configurations, along with comprehensive unit and CLI tests. The feedback suggests two improvements: first, using Pydantic's native model_dump_json instead of json.dumps(model_dump()) to safely serialize the exported project configuration; second, refining the error handling when reading the import file to avoid wrapping generic OSError exceptions in a FileNotFoundError constructor, which results in confusing error messages.
- Use model_dump_json(indent=2) instead of model_dump() + json.dumps() to correctly serialize Pydantic models with non-standard types - Split OSError handling in _import_project into FileNotFoundError and generic OSError to avoid broken error messages from wrapping OSError in FileNotFoundError
oxesoft
approved these changes
Jun 22, 2026
antonio-amjr
approved these changes
Jun 22, 2026
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.
Add 'project export' and 'project import' subcommands to the CLI, wiring up the existing backend endpoints:
project export:
project import:
Also adds full unit test coverage in tests/test_project_commands.py (TestExportProjectCommand and TestImportProjectCommand).
Testing
Closes #1025