# Select output targets

The `check`, `build`, `open`, and `clean` commands operate on selected output targets. Use the manifest defaults for routine work, or select named targets and override their output paths from the command line.

## Use the default targets

When a command does not pass a target selection option, DocInsight uses `output.default_targets` from the manifest. If `default_targets` is omitted, DocInsight selects all configured output targets.

Default targets keep routine `check`, `build`, and `clean` commands short while allowing other targets to remain available when needed.

## Select named targets

Use `--target` to select a named output target from `docinsight.json`:

shell

    docinsight build --target site
    docinsight open --target site
    docinsight clean --target site

Use target selection when a project builds multiple outputs, or when `open` should open one specific generated output.

Repeat `--target` to select more than one named target:

shell

    docinsight build --target site --target help

## Override target output paths

Append `=PATH` to a target name to replace its configured output path for one command:

shell

    docinsight build --target site=dist/site
    docinsight build --target "site=dist/my site"

Quote the complete `NAME=PATH` argument when the path contains spaces. A relative override path is resolved from the current working directory, not from the directory containing `docinsight.json`.

Repeat `--target` to override multiple targets in the same command:

shell

    docinsight build --target site=dist/site --target help=dist/help.chm

Overridden and configured output paths can also be used together:

shell

    docinsight build --target site=dist/site --target help

Each `NAME=PATH` value overrides only its named target. A selected target without `=PATH` continues to use the path configured in the manifest. Overrides change only the effective output locations for that command; they do not update target paths in the manifest.

The same syntax works with `check`, `build`, `open`, and `clean`:

shell

    docinsight check --target site=dist/site
    docinsight open --target site=dist/site
    docinsight clean --target site=dist/site

`check` validates the effective output locations without writing generated output. When you build to override paths, pass the same overrides to `clean` to operate on those outputs. The `open` command, and `build --open`, require exactly one selected target.

For shared team manifests, keep the configured target path local and excluded from version control. Use an override only when a publishing command intentionally writes to a shared or deployment location. See Keep team output local.

## Select all targets

Use `--all-targets` with `check`, `build`, or `clean` to ignore `output.default_targets` and select every configured output target:

shell

    docinsight check --all-targets
    docinsight build --all-targets
    docinsight clean --all-targets

## Select targets by format

Use `--format` to select every configured target with a particular output format:

shell

    docinsight build --format html
    docinsight clean --format chm

The supported values are `html` and `chm`. Because `open` requires exactly one target, use `--format` with `open` only when exactly one configured target has that format.

`--target`, `--all-targets`, and `--format` are mutually exclusive selection methods.

## Select legacy output formats

Legacy `.diproj` manifests do not define named output targets. Use `--format html` or `--format chm` with `build`. The legacy `open` command requires one of these format selections:

shell

    docinsight build --manifest MyLibrary.diproj --format html
    docinsight open --manifest MyLibrary.diproj --format html

`check` does not support target selection for legacy manifests, and `clean` does not support legacy manifests.