If you compile your project with the -deps flag, the compiler will output import dependencies. With -deps=filename, the output will go into filename. >From there, you'll have to parse and create the graph, though. Maybe have a look into rdmd source, to see how the dependency extraction is done there?