Skip to content

feat(cli): export and import sessions#11075

Merged
RomneyDa merged 3 commits intocontinuedev:mainfrom
uinstinct:cli-import-export
Mar 24, 2026
Merged

feat(cli): export and import sessions#11075
RomneyDa merged 3 commits intocontinuedev:mainfrom
uinstinct:cli-import-export

Conversation

@uinstinct
Copy link
Contributor

@uinstinct uinstinct commented Mar 5, 2026

Description

Add the ability to export a selected session and import it by path of the file.

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screen recording or screenshot

[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]

Tests

[ What tests were added or updated to ensure the changes work as expected? ]


Continue Tasks: 🔄 7 running — View all


Summary by cubic

Add CLI support to export a session to JSON and import a session from a file. Adds new slash commands and a TUI export selector to make moving sessions easy.

  • New Features

    • Added /export to open an Export selector in the TUI; saves continue-session-<id>.json in the current directory with version: 1 and exportedAt.
    • Added /import <file-path> with clear errors for missing path, missing file, invalid JSON, or unsupported export (expects version: 1).
    • On import, if the sessionId exists, a new UUID is generated and the session is saved without overwriting; output shows original and new IDs.
    • Registered export and import in system slash commands; wired TUI navigation and system messages for success/failure.
  • Bug Fixes

    • Stabilized slashCommands tests by mocking path.isAbsolute, path.resolve, and core/util/history.js to avoid filesystem calls.

Written for commit ab8760e. Summary will update on new commits.

@uinstinct uinstinct requested a review from a team as a code owner March 5, 2026 13:38
@uinstinct uinstinct requested review from Patrick-Erichsen and removed request for a team March 5, 2026 13:38
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 5, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 8 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="extensions/cli/src/slashCommands.ts">

<violation number="1" location="extensions/cli/src/slashCommands.ts:199">
P2: `/import` only uses `args[0]`, so file paths containing spaces are truncated and reported as missing.</violation>

<violation number="2" location="extensions/cli/src/slashCommands.ts:218">
P2: Import command lacks runtime validation of exported session format/version before persistence, allowing incompatible or malformed session data to be saved.</violation>

<violation number="3" location="extensions/cli/src/slashCommands.ts:222">
P1: Import collision detection only checks 1000 sessions, so duplicate IDs outside that window can be missed and existing sessions overwritten.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@RomneyDa RomneyDa force-pushed the cli-import-export branch from 026a449 to 50817d0 Compare March 24, 2026 20:11
@RomneyDa RomneyDa force-pushed the cli-import-export branch from 50817d0 to 0d9b6d8 Compare March 24, 2026 20:48
RomneyDa
RomneyDa previously approved these changes Mar 24, 2026
Copy link
Collaborator

@RomneyDa RomneyDa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@uinstinct nice addition!

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Mar 24, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 24, 2026
The import of historyManager in slashCommands.ts triggers
core/util/paths.ts which calls path.isAbsolute — not provided by
the existing path mock. Add the missing path exports and mock
core/util/history.js to avoid filesystem operations in tests.
Copy link
Collaborator

@RomneyDa RomneyDa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@uinstinct nice addition!

@RomneyDa RomneyDa merged commit b155702 into continuedev:main Mar 24, 2026
53 of 60 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Mar 24, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Mar 24, 2026
@uinstinct uinstinct deleted the cli-import-export branch March 25, 2026 03:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants