summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/slashCommandProcessor.ts
diff options
context:
space:
mode:
authorSeth Troisi <[email protected]>2025-06-10 16:58:39 -0700
committerGitHub <[email protected]>2025-06-10 16:58:39 -0700
commit8e0d5076d65b83a519775b42d83034b79b3452ac (patch)
treed27c55ed609d7bccf9bce8c87667cb2fa4bcfeff /packages/cli/src/ui/hooks/slashCommandProcessor.ts
parentd6b6d5976d83154976a02a945f7d9f8fd96d7d2c (diff)
Add [tag] to /save and /resume (#916)
Diffstat (limited to 'packages/cli/src/ui/hooks/slashCommandProcessor.ts')
-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;