@@ -37,6 +37,7 @@ type ParsedArgs = {
3737 initialPrompt : string | null
3838 agent ?: string
3939 clearLogs : boolean
40+ toggleState : 'open' | 'closed' | null
4041}
4142
4243function parseArgs ( ) : ParsedArgs {
@@ -51,6 +52,10 @@ function parseArgs(): ParsedArgs {
5152 'Specify which agent to use (e.g., "base", "ask", "file-picker")' ,
5253 )
5354 . option ( '--clear-logs' , 'Remove any existing CLI log files before starting' )
55+ . option (
56+ '--toggle <state>' ,
57+ 'Force initial toggle state (open | closed)' ,
58+ )
5459 . helpOption ( '-h, --help' , 'Show this help message' )
5560 . argument ( '[prompt...]' , 'Initial prompt to send to the agent' )
5661 . allowExcessArguments ( true )
@@ -63,10 +68,18 @@ function parseArgs(): ParsedArgs {
6368 initialPrompt : args . length > 0 ? args . join ( ' ' ) : null ,
6469 agent : options . agent ,
6570 clearLogs : options . clearLogs || false ,
71+ toggleState :
72+ typeof options . toggle === 'string'
73+ ? options . toggle . trim ( ) . toLowerCase ( ) === 'open'
74+ ? 'open'
75+ : options . toggle . trim ( ) . toLowerCase ( ) === 'closed'
76+ ? 'closed'
77+ : null
78+ : null ,
6679 }
6780}
6881
69- const { initialPrompt, agent, clearLogs } = parseArgs ( )
82+ const { initialPrompt, agent, clearLogs, toggleState } = parseArgs ( )
7083
7184if ( clearLogs ) {
7285 clearLogFile ( )
@@ -122,6 +135,7 @@ const AppWithAsyncAuth = () => {
122135 requireAuth = { requireAuth }
123136 hasInvalidCredentials = { hasInvalidCredentials }
124137 loadedAgentsData = { loadedAgentsData }
138+ initialToggleState = { toggleState }
125139 />
126140 )
127141}
0 commit comments