dub-init(1)

dub-init1

Initializes an empty package skeleton

Usage

dub init [<directory> [<dependency> ...]] OPTIONS ... [-- <application arguments ... >]

Overview

Initializes an empty package of the specified type in the given directory.

By default, the current working directory is used.

Custom templates can be defined by packages by providing a sub-package called "init-exec". No default source files are added in this case.

The "init-exec" sub-package is compiled and executed inside the destination folder after the base project directory has been created.

Free arguments "dub init -t custom -- free args" are passed into the "init-exec" sub-package as app arguments.

Options

-t, --type=VALUE

Set the type of project to generate. Available types:

minimal - simple "hello world" project (default) vibe.d - minimal HTTP server based on vibe.d deimos - skeleton for C header bindings custom - custom project provided by dub package

-f, --format=VALUE

Sets the format to use for the package description file. Possible values:
json (default), sdl

-n, --non-interactive

Don't enter interactive mode.

Common options

See dub(1)

Exit status

0

DUB succeeded

1

usage errors, unknown command line flags

2

package not found, package failed to load, miscellaneous error

Files

dub.sdl, dub.json

Online documentation

http://code.dlang.org/docs/commandline

Releases

5 releases since Debian 10 (Buster); the text changed 4 times.

  1. 10
  2. 11
  3. 12
  4. 13
  5. Arch

--format since Debian 13 (Trixie); --non-interactive since Debian 13 (Trixie); --type since Debian 13 (Trixie); -f since Debian 13 (Trixie); -n since Debian 13 (Trixie); -t since Debian 13 (Trixie).

Author

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

From dub 1.42.0-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.