summaryrefslogtreecommitdiff
path: root/packages/cli
diff options
context:
space:
mode:
Diffstat (limited to 'packages/cli')
-rw-r--r--packages/cli/src/ui/hooks/slashCommandProcessor.ts23
1 files changed, 15 insertions, 8 deletions
diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
index c468a444..4d677f1e 100644
--- a/packages/cli/src/ui/hooks/slashCommandProcessor.ts
+++ b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
@@ -490,35 +490,42 @@ Add any other context about the problem here.
},
{
name: 'save',
- description: 'save conversation checkpoint',
- action: async (_mainCommand, _subCommand, _args) => {
+ description: 'save conversation checkpoint. Usage: /save [tag]',
+ action: async (_mainCommand, subCommand, _args) => {
+ const tag = (subCommand || '').trim();
const logger = new Logger();
await logger.initialize();
const chat = await config?.getGeminiClient()?.getChat();
const history = chat?.getHistory() || [];
if (history.length > 0) {
- logger.saveCheckpoint(chat?.getHistory() || []);
+ await logger.saveCheckpoint(chat?.getHistory() || [], tag);
+ addMessage({
+ type: MessageType.INFO,
+ content: `Conversation checkpoint saved${tag ? ' with tag: ' + tag : ''}.`,
+ timestamp: new Date(),
+ });
} else {
addMessage({
type: MessageType.INFO,
content: 'No conversation found to save.',
timestamp: new Date(),
});
- return;
}
},
},
{
name: 'resume',
- description: 'resume from last conversation checkpoint',
- action: async (_mainCommand, _subCommand, _args) => {
+ description:
+ 'resume from conversation checkpoint. Usage: /resume [tag]',
+ action: async (_mainCommand, subCommand, _args) => {
+ const tag = (subCommand || '').trim();
const logger = new Logger();
await logger.initialize();
- const conversation = await logger.loadCheckpoint();
+ const conversation = await logger.loadCheckpoint(tag);
if (conversation.length === 0) {
addMessage({
type: MessageType.INFO,
- content: 'No saved conversation found.',
+ content: `No saved checkpoint found${tag ? ' with tag: ' + tag : ''}.`,
timestamp: new Date(),
});
return;