File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 11import open from 'open'
22
33import { handleAdsEnable , handleAdsDisable } from './ads'
4+ import { useThemeStore } from '../hooks/use-theme'
45import { handleHelpCommand } from './help'
56import { handleImageCommand } from './image'
67import { handleInitializationFlowLocally } from './init'
@@ -513,6 +514,20 @@ export const COMMAND_REGISTRY: CommandDefinition[] = [
513514 return { openReviewScreen : true }
514515 } ,
515516 } ) ,
517+ defineCommand ( {
518+ name : 'theme:toggle' ,
519+ handler : ( params ) => {
520+ const { theme, setThemeName } = useThemeStore . getState ( )
521+ const newTheme = theme . name === 'dark' ? 'light' : 'dark'
522+ setThemeName ( newTheme )
523+ params . setMessages ( ( prev ) => [
524+ ...prev ,
525+ getUserMessage ( params . inputValue . trim ( ) ) ,
526+ getSystemMessage ( `Switched to ${ newTheme } theme.` ) ,
527+ ] )
528+ clearInput ( params )
529+ } ,
530+ } ) ,
516531]
517532
518533export function findCommand ( cmd : string ) : CommandDefinition | undefined {
Original file line number Diff line number Diff line change @@ -137,6 +137,11 @@ export const SLASH_COMMANDS: SlashCommand[] = [
137137 label : 'publish' ,
138138 description : 'Publish agents to the agent store' ,
139139 } ,
140+ {
141+ id : 'theme:toggle' ,
142+ label : 'theme:toggle' ,
143+ description : 'Toggle between light and dark mode' ,
144+ } ,
140145 {
141146 id : 'logout' ,
142147 label : 'logout' ,
You can’t perform that action at this time.
0 commit comments