-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
What would you like to be added?
I propose enhancing the /chat
command in two key ways: by introducing an export
sub-command for sharing and archiving, and by adding a critical safety feature to the existing delete
sub-command.
1. New Sub-command: /chat export <tag> --format <markdown|json>
- Description: This sub-command would export the full history of a saved chat checkpoint to a file. It should support at least two formats via a
--format
flag:markdown
: To create a human-readable log, ideal for documentation, tutorials, or sharing summaries.json
: To create a structured data file containing an array of conversation turns (e.g.,[{ "role": "user", "content": "..." }, { "role": "model", "content": "..." }]
). This is useful for programmatic analysis, archiving, or integration with other tools.
- Usage Examples:
> /chat export my-debug-session --format markdown > debug_log.md
> /chat export my-debug-session --format json > session_data.json
2. Improvement: Add Confirmation to /chat delete <tag>
- Description: The
/chat delete
command currently executes immediately, which can lead to the accidental deletion of valuable conversation history. This enhancement would add an interactive confirmation prompt before the checkpoint is permanently removed. - Proposed Implementation:
- Option A (Basic): A standard command-line prompt.
Are you sure you want to permanently delete the chat checkpoint "my-checkpoint"? [y/N]
- Option B (Recommended for UI Consistency): For a better user experience that aligns with existing patterns, we could use the same modal confirmation dialog that is used for shell command execution. This would provide a clearer and more robust confirmation step.
- Dialog Title:
Confirm Deletion
- Dialog Text:
Are you sure you want to permanently delete the chat checkpoint "my-checkpoint"? This action cannot be undone.
- Buttons:
Yes, delete
No (esc)
- Dialog Title:
- Option A (Basic): A standard command-line prompt.
Why is this needed?
The /chat
command is excellent for saving and resuming sessions, but it can be improved in terms of safety and interoperability.
-
Increased Safety (
/chat delete
confirmation): While the existingdelete
command is useful for housekeeping, its immediate execution poses a risk. A simple typo could lead to the irreversible loss of an important session. A confirmation step is a standard safety measure for destructive operations and would significantly improve user trust and prevent data loss. -
Enhanced Collaboration and Documentation (
/chat export
): Gemini CLI sessions often contain valuable information. The ability to export these sessions makes this knowledge portable for sharing with teammates, archiving in project documentation, or building a team knowledge base.
Additional context
The primary motivation for this proposal is to increase user safety and trust in the tool.
- Safety First: The confirmation for
/chat delete
adds a necessary layer of safety, aligning it with best practices for command-line tools that perform destructive actions. - UI Consistency: By implementing the confirmation using the existing modal dialog pattern (as suggested in Option B), we not only enhance safety but also create a more intuitive and predictable user experience across the entire CLI.
- Completing the Feature: Complementing this safety enhancement, the
export
functionality provides a way to back up or share sessions, moving the/chat
command towards a more mature and complete session management suite.