Your company here — click to reach over 10,000 unique daily visitors

dub-describe - Man Page

Prints a JSON description of the project and its dependencies


dub describe [<package>[@<version-spec>]] Options...


Prints a JSON build description for the root package an all of their dependencies in a format similar to a JSON package description file. This is useful mostly for IDEs.

All usual options that are also used for build/run/generate apply.

When --data=VALUE is supplied, specific build settings for a project will be printed instead (by default, formatted for the current compiler).

The --data=VALUE option can be specified multiple times to retrieve several pieces of information at once. A comma-separated list is also acceptable (ex: --data=dflags,libs). The data will be output in the same order requested on the command line.

The accepted values for --data=VALUE are:

main-source-file, dflags, lflags, libs, linker-files, source-files, versions, debug-versions, import-paths, string-import-paths, import-files, options

The following are also accepted by --data if --data-list is used:

target-type, target-path, target-name, working-directory, copy-files, string-import-files, pre-generate-commands, post-generate-commands, pre-build-commands, post-build-commands, pre-run-commands, post-run-commands, requirements


-b,  --build=VALUE

Specifies the type of build to perform. Note that setting the DFLAGS environment variable will override the build type with custom flags. Possible names:
 debug, plain, release, release-debug, release-nobounds, unittest, profile, profile-gc, docs, ddox, cov, cov-ctfe, unittest-cov, unittest-cov-ctfe, syntax and custom types

-c,  --config=VALUE

Builds the specified configuration. Configurations can be defined in dub.json


Uses the specified configuration for a certain dependency. Can be specified multiple times. Format: --override-config=<dependency>/<config>


Specifies the compiler binary to use (can be a path). Arbitrary pre- and suffixes to the identifiers below are recognized (e.g. ldc2 or dmd-2.063) and matched to the proper compiler type:
 dmd, gdc, ldc, gdmd, ldmd

-a,  --arch=VALUE

Force a different architecture (e.g. x86 or x86_64)

-d,  --debug=VALUE

Define the specified `debug` version identifier when building - can be used multiple times


Define the specified `version` identifier when building - can be used multiple times. Use sparingly, with great power comes great responsibility! For commonly used or combined versions and versions that dependees should be able to use, create configurations in your package.


Do not resolve missing dependencies before building


Specifies the way the compiler and linker are invoked. Valid values:
 separate (default), allAtOnce, singleFile


Treats the package name as a filename. The file must contain a package recipe comment.


Deprecated option that does nothing.


[Experimental] Filter version identifiers and debug version identifiers to improve build cache efficiency.


Shortcut for --data=import-paths --data-list


Shortcut for --data=string-import-paths --data-list


Just list the values of a particular build setting, either for this package alone or recursively including all dependencies. Accepts a comma-separated list. See above for more details and accepted possibilities for VALUE.


Output --data information in list format (line-by-line), instead of formatting for a compiler command line.


Output --data information using null-delimiters, rather than spaces or newlines. Result is usable with, ex., xargs -0.

Common Options

See dub(1)

Exit Status


DUB succeeded


usage errors, unknown command line flags


package not found, package failed to load, miscellaneous error


dub.sdl, dub.json


Copyright (c) 1999-2024 by The D Language Foundation

Online Documentation


See Also

dub(1), dub-generate(1)

Referenced By

dub(1), dub-generate(1).

2024-01-24 The D Language Foundation