# Select a project manifest

Commands that operate on an existing project need a `docinsight.json` or legacy `.diproj` manifest. Let DocInsight discover the project during routine work, or use `--manifest` when a command needs an explicit project context.

## Use the discovered manifest

When a command runs inside a documentation project, DocInsight searches the current directory and then its parent directories for `docinsight.json`. It uses the nearest manifest it finds:

shell

    docinsight check
    docinsight build

This lets commands run from the project root or from a documentation or source subdirectory.

Discovery follows the directory hierarchy, so a command started outside the project root cannot find that project's manifest automatically. Sources outside the project root remain valid inputs, but run commands from within the project or use `--manifest` to select the project explicitly.

If DocInsight does not find `docinsight.json`, it uses a single legacy `.diproj` manifest in the current directory. When the directory contains more than one `.diproj` file, select one explicitly.

## Specify a manifest

Use `--manifest` to point a command at a specific `docinsight.json` or legacy `.diproj` manifest:

shell

    docinsight check --manifest products/mylibrary/docinsight.json
    docinsight build --manifest ../product-docs/docinsight.json

A relative `--manifest` path is resolved from the current working directory. Explicit selection is useful in scripts, CI jobs, monorepos, and repository layouts where documentation and source code live in different locations.

Manifest selection identifies the project; it does not choose which configured outputs a command uses. For that behavior, see Select output targets.