DUB-INIT(1)
π
DUB-INIT(1) β okay so this is the dub init era π
Hey bestie, welcome to the DUB-INIT(1) page β Manual section 1, brought to you by The D Language Foundation. It's literally the page about spawning a brand-new empty package skeleton, and it's giving "first day of school but make it compiler-adjacent" β¨
πΈ NAME πΈ
dub-init β initializes an empty package skeleton. That's it, that's the vibe. π«Ά
β SYNOPSIS β
dub init [<directory> [<dependency>...]] OPTIONS... [-- <application arguments...>]
Like, you give it a directory (or don't, she's flexible), you can throw some dependencies at her, you got your OPTIONS..., and then β plot twist β after the -- you can pass <application arguments...>. Iykyk. π
π DESCRIPTION π
She initializes an empty package of the specified type in the given directory. Fresh start, blank slate, main character energy. π
By default, the current working directory is used. So if you just type it with no directory, congrats, you're doing it right here.
Custom templates can be defined by packages by providing a sub-package called init-exec. Lowkey iconic. And heads up: no default source files are added in this case. None. Zero. Zip. You're on your own for that part, bestie π
The init-exec sub-package is compiled and executed inside the destination folder after the base project directory has been created. So yes, it actually runs in the folder, after the folder exists. Order matters, periodt.
And here's the cute part β free arguments like this:
dub init -t custom -- free args
are passed into the init-exec sub-package as app arguments. Free args go straight through. Obsessed. π¦
β¨ OPTIONS β¨
-t,--type=VALUEβ sets the type of project to generate. Available types:minimalβ simple"hello world"project, and yes it's the default πvibe.dβ minimal HTTP server based onvibe.ddeimosβ skeleton for C header bindingscustomβ custom project provided by dub package
-f,--format=VALUEβ sets the format to use for the package description file. Possible values:json(default),sdl. Pick your fighter π-n,--non-interactiveβ don't enter interactive mode. No questions, no small talk, just vibes. π
π§ COMMON OPTIONS π§
See dub(1) for the shared stuff β she didn't want to repeat herself. π
π₯ EXIT STATUS π₯
0β DUB succeeded. Slay! π1β usage errors, unknown command line flags. Not the moment, bestie π2β package not found, package failed to load, miscellaneous error. The generic "something went sideways" bucket. π
π FILES π
dub.sdl, dub.json β the package description file, in whichever format you picked up in --format. Iconic duo. π
π¦ AUTHOR π¦
Copyright (c) 1999-2026 by The D Language Foundation. Respect the elders, they've been at this since the 1900s. π
π ONLINE DOCUMENTATION π
http://code.dlang.org/docs/commandline β¨β©
Go read it, she's got lore. β¨
π SEE ALSO π
dub(1), dub-add(1), dub-convert(1) β the rest of the friend group. π«Ά
Fr fr, don't forget: if your package ships aninit-execsub-package, she runs it in your destination folder after creating the base project directory, and your free args after--get handed to it as app arguments. That's the whole trick, no cap. π
Mwah, that's the page! Signing off on behalf of The D Language Foundation, dated 2026-08-16 β the DUB-INIT(1) of our hearts. Go make something cute in an empty directory, bestie. πππΈ
π¦ where this page comes from
- arch rolling: dub 1.42.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms