@@ -360,6 +360,26 @@ function describeInstall(install: Install): string {
360360 return `Kubernetes (context ${ install . context } ${ scope } )`
361361}
362362
363+ /**
364+ * What to say when no install was found. "Run npx sim-setup" reads as "install
365+ * again", which is wrong in the two common cases: Docker is down (a Compose
366+ * stack is invisible, not missing), or the stack was taken `down` and the
367+ * command runs outside its directory, where only `--dir` can find it.
368+ */
369+ export function noInstallHint ( options : { dockerReachable : boolean ; cwd : string } ) : string [ ] {
370+ if ( ! options . dockerReachable ) {
371+ return [
372+ 'Docker is not reachable, so a Compose install cannot be detected.' ,
373+ 'Start Docker Desktop (or OrbStack), then re-run this command.' ,
374+ ]
375+ }
376+ return [
377+ `No Sim install found from ${ options . cwd } .` ,
378+ `Already set up? Run this from the folder that contains your sim/ directory, or pass ${ theme . command ( '--dir <path-to-sim>' ) } .` ,
379+ `New here? Run ${ theme . command ( 'npx sim-setup' ) } .` ,
380+ ]
381+ }
382+
363383/** One install → use it; several → let the user pick; none → null. */
364384async function resolveInstall ( installs : Install [ ] ) : Promise < Install | null > {
365385 if ( installs . length <= 1 ) return installs [ 0 ] ?? null
@@ -656,11 +676,13 @@ async function status(): Promise<void> {
656676 console . log ( ` ${ theme . muted ( 'start Docker Desktop (or OrbStack), then re-run this.' ) } \n` )
657677 }
658678 if ( installs . length === 0 ) {
659- console . log (
660- docker
661- ? ` ${ glyph . warn } No Sim install detected — run ${ theme . command ( 'npx sim-setup' ) } .`
662- : ` ${ glyph . warn } No install detected, but that may just be Docker being down.`
663- )
679+ if ( ! docker ) {
680+ console . log ( ` ${ glyph . warn } No install detected, but that may just be Docker being down.` )
681+ return
682+ }
683+ const [ first , ...rest ] = noInstallHint ( { dockerReachable : true , cwd : process . cwd ( ) } )
684+ console . log ( ` ${ glyph . warn } ${ first } ` )
685+ for ( const line of rest ) console . log ( ` ${ theme . muted ( line ) } ` )
664686 return
665687 }
666688 for ( const install of installs ) console . log ( ` ${ glyph . pass } ${ describeInstall ( install ) } ` )
@@ -696,7 +718,7 @@ export async function runLifecycle(command: LifecycleCommand): Promise<void> {
696718
697719 const install = await resolveInstall ( installs )
698720 if ( ! install ) {
699- p . log . warn ( `No Sim install detected. Run ${ theme . command ( 'npx sim-setup' ) } first.` )
721+ p . log . warn ( noInstallHint ( { dockerReachable : dockerReachable ( ) , cwd : process . cwd ( ) } ) . join ( '\n' ) )
700722 return
701723 }
702724 switch ( command ) {
0 commit comments