@@ -18,9 +18,11 @@ import { App } from './app.js';
1818import { runPreflightChecks , formatPreflightResults } from './lib/preflight.js' ;
1919import { logger , setDebugEnabled } from './lib/logger.js' ;
2020import { setNotificationsEnabled , setSoundEnabled } from './lib/notifications.js' ;
21+ import { runDockerPreflightChecks } from './lib/docker.js' ;
22+ import { promptSandboxFallback } from './lib/prompt.js' ;
2123
2224// Package version (will be replaced by build)
23- const VERSION = '1.0.3 ' ;
25+ const VERSION = '1.0.4 ' ;
2426
2527// CLI program
2628const program = new Command ( ) ;
@@ -40,6 +42,8 @@ program
4042 . option ( '--no-sound' , 'Disable sound alerts' )
4143 . option ( '--debug' , 'Enable debug logging' )
4244 . option ( '--preflight-only' , 'Only run pre-flight checks' )
45+ . option ( '--sandbox' , 'Run Claude in Docker sandbox for isolation' )
46+ . option ( '--no-sandbox' , 'Disable Docker sandbox (default)' )
4347 . action ( async ( promptArg : string | undefined , options ) => {
4448 // Enable debug if requested
4549 if ( options . debug ) {
@@ -85,8 +89,25 @@ program
8589 prompt,
8690 isFile,
8791 projectRoot : process . cwd ( ) ,
92+ sandbox : options . sandbox || false ,
8893 } ;
8994
95+ // Run Docker sandbox preflight checks if sandbox mode is enabled
96+ if ( config . sandbox ) {
97+ const dockerResult = await runDockerPreflightChecks ( ) ;
98+ if ( ! dockerResult . passed ) {
99+ const choice = await promptSandboxFallback ( dockerResult ) ;
100+ if ( choice === 'exit' ) {
101+ process . exit ( 1 ) ;
102+ }
103+ // Continue without sandbox
104+ config . sandbox = false ;
105+ logger . info ( 'Continuing without Docker sandbox' ) ;
106+ } else {
107+ logger . info ( 'Docker sandbox mode enabled' ) ;
108+ }
109+ }
110+
90111 // Run pre-flight checks
91112 const preflightResult = await runPreflightChecks ( config ) ;
92113
0 commit comments