Skip to content

Commit 06f21c5

Browse files
committed
feat(cli): add slash exit command
1 parent 4e28ab0 commit 06f21c5

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

cli/src/chat.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,15 @@ export const App = ({
743743
return
744744
}
745745

746+
if (cmd === 'exit' || cmd === 'quit') {
747+
abortControllerRef.current?.abort()
748+
stopStreaming()
749+
setCanProcessQueue(false)
750+
setInputValue('')
751+
handleCtrlC()
752+
return
753+
}
754+
746755
saveToHistory(trimmed)
747756
setInputValue('')
748757

@@ -771,6 +780,7 @@ export const App = ({
771780
streamMessageIdRef,
772781
isChainInProgressRef,
773782
scrollToLatest,
783+
handleCtrlC,
774784
])
775785

776786
useKeyboardHandlers({

cli/src/data/slash-commands.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ export const SLASH_COMMANDS: SlashCommand[] = [
2323
description: 'Sign out of your session',
2424
aliases: ['signout'],
2525
},
26+
{
27+
id: 'exit',
28+
label: 'exit',
29+
description: 'Quit the CLI',
30+
aliases: ['quit', 'q'],
31+
},
2632
{
2733
id: 'diff',
2834
label: 'diff',

0 commit comments

Comments
 (0)