@@ -143,6 +143,49 @@ const GIT_QUICK_CMDS: { label: string; title: string; command: string }[] = [
143143 { label : "branch" , title : "git branch (list branches)" , command : "git branch\n" } ,
144144] ;
145145
146+ // Slash commands grouped by CLI
147+ interface SlashCmdGroup {
148+ cli : string ;
149+ cmds : { label : string ; title : string ; command : string } [ ] ;
150+ }
151+
152+ const SLASH_CMD_GROUPS : SlashCmdGroup [ ] = [
153+ {
154+ cli : "claude" ,
155+ cmds : [
156+ { label : "/clear" , title : "Clear conversation context" , command : "/clear\n" } ,
157+ { label : "/compact" , title : "Compact conversation to save context" , command : "/compact\n" } ,
158+ { label : "/cost" , title : "Show token usage and cost" , command : "/cost\n" } ,
159+ { label : "/help" , title : "Show available commands" , command : "/help\n" } ,
160+ { label : "/model" , title : "Show or switch model" , command : "/model\n" } ,
161+ { label : "/exit" , title : "Exit Claude Code" , command : "/exit\n" } ,
162+ { label : "/config" , title : "Open config" , command : "/config\n" } ,
163+ { label : "/memory" , title : "Edit CLAUDE.md memory" , command : "/memory\n" } ,
164+ { label : "/review" , title : "Review a PR" , command : "/review\n" } ,
165+ { label : "/vim" , title : "Toggle vim mode" , command : "/vim\n" } ,
166+ ] ,
167+ } ,
168+ {
169+ cli : "codex" ,
170+ cmds : [
171+ { label : "/help" , title : "Show available commands" , command : "/help\n" } ,
172+ { label : "/model" , title : "Show or switch model" , command : "/model\n" } ,
173+ { label : "/exit" , title : "Exit Codex" , command : "/exit\n" } ,
174+ { label : "/clear" , title : "Clear conversation" , command : "/clear\n" } ,
175+ { label : "/approval" , title : "Change approval mode" , command : "/approval\n" } ,
176+ ] ,
177+ } ,
178+ {
179+ cli : "opencode" ,
180+ cmds : [
181+ { label : "/help" , title : "Show available commands" , command : "/help\n" } ,
182+ { label : "/exit" , title : "Exit OpenCode" , command : "/exit\n" } ,
183+ { label : "/clear" , title : "Clear conversation" , command : "/clear\n" } ,
184+ { label : "/compact" , title : "Compact context" , command : "/compact\n" } ,
185+ ] ,
186+ } ,
187+ ] ;
188+
146189const CODE_LAUNCH_CMDS : CodeLaunchCmd [ ] = [
147190 // Claude Code
148191 { cli : "claude" , label : "claude" , title : "Claude Code — interactive mode" , command : "claude\n" } ,
@@ -762,7 +805,7 @@ export default function InputBox() {
762805
763806 { /* Code tab: coding CLI launchers + common keys */ }
764807 { activeGroup === CODE_TAB && (
765- < div className = "border-b border-gray-700/50 bg-[#12122a] px-2 py-1.5" >
808+ < div className = "border-b border-gray-700/50 bg-[#12122a] px-2 py-1.5 max-h-64 overflow-y-auto " >
766809 { /* Coding CLI key combos */ }
767810 < div className = "flex flex-wrap gap-1 mb-1.5" >
768811 < span className = "text-[10px] text-gray-600 w-full" > cli keys</ span >
@@ -772,6 +815,25 @@ export default function InputBox() {
772815 </ button >
773816 ) ) }
774817 </ div >
818+ { /* Slash commands grouped by CLI */ }
819+ { SLASH_CMD_GROUPS . map ( ( group ) => (
820+ < div key = { group . cli } className = "border-t border-gray-700/50 pt-1.5 mb-1.5" >
821+ < span className = "text-[10px] text-gray-600" > { group . cli } /commands</ span >
822+ < div className = "flex flex-wrap gap-1 mt-0.5" >
823+ { group . cmds . map ( ( cmd ) => (
824+ < button
825+ key = { `${ group . cli } -${ cmd . label } ` }
826+ onClick = { ( ) => { if ( activeSessionId ) sendInput ( activeSessionId , cmd . command ) ; } }
827+ disabled = { ! activeSessionId }
828+ title = { cmd . title }
829+ className = "px-2 py-0.5 text-[11px] bg-[#1a1a2e] text-cyan-400 hover:text-cyan-200 hover:bg-[#2a2a4a] disabled:text-gray-600 rounded border border-cyan-800/60 whitespace-nowrap transition-colors select-none"
830+ >
831+ { cmd . label }
832+ </ button >
833+ ) ) }
834+ </ div >
835+ </ div >
836+ ) ) }
775837 { /* CLI launch shortcuts */ }
776838 < div className = "border-t border-gray-700/50 pt-1.5" >
777839 < span className = "text-[10px] text-gray-600" > launch</ span >
0 commit comments