import { cli , Command , flag , ServiceContainer } from '@deepkit/app' ; @ cli . controller ( 'debug:di' , { } ) export class DebugDIController implements Command { constructor ( protected serviceContainer ) { } async execute ( @ flag . optional scope ? ) { const modules = [ this . serviceContainer . appModule , ... this . serviceContainer . appModule . getImports ( ) ] ; let injectorContext = this . serviceContainer . getInjectorContext ( ) ; if ( scope ) { console . log ( 'For scope' , scope ) ; injectorContext = injectorContext . createChildScope ( scope ) ; } for ( const module of modules ) { console . log ( `Module ${ module . getName ( ) || 'root' } DI retriever:` ) ; console . log ( ( injectorContext . getInjector ( module ) as any ) . resolver . toString ( ) ) ; } } }