# Initialize a project

`docinsight init` creates a `docinsight.json` manifest and, when requested, starter Markdown documentation. Run it from the directory that should become the DocInsight project root.

Migrating an existing `.diproj` project? Skip to Import a legacy project.

## Initialize Markdown and Delphi documentation

Open a terminal in the directory that should become the project root, then use the `delphi` template to combine authored Markdown with generated Delphi API reference:

shell

    docinsight init --template delphi

DocInsight prompts for one or more Delphi project files or glob patterns, optional exclusions, the Delphi compiler version, and the target platform. It then creates the manifest and a starter Markdown guide, and configures both the guide and API reference in one HTML output target.

If the project needs only Markdown documentation, use the `markdown` template instead:

shell

    docinsight init --template markdown

Both templates create `docs/overview.md` and `docs/toc.md`. Their HTML target writes to `dist/docs/site`.

## Set the project identity

DocInsight derives the project name and title from the project directory. Use `--name` and `--title` to set them explicitly:

shell

    docinsight init --template delphi --title "My Library" --name my-library

## Replace an existing manifest

Initialization stops when `docinsight.json` already exists. Use `--force` only when you intend to replace it with a newly generated manifest:

shell

    docinsight init --template delphi --force

`--force` replaces `docinsight.json` but does not overwrite existing starter Markdown files.

## Import a legacy project

Use `--from-legacy` instead of a template to migrate an existing `.diproj` project:

shell

    docinsight init --from-legacy MyLibrary.diproj

DocInsight converts the legacy configuration to `docinsight.json` and creates starter Markdown guide files when needed.

After initialization, edit `docinsight.json` to adjust content, source analysis, site settings, and output targets.

## Related topics

- DocInsight project

- Project manifest

- `init` command reference