# amfelt docs generate

Generate the project's Markdown documentation.

Generates Markdown documentation for the project from its data contracts and
configuration, and writes the result into the documentation directory named by
docs.path in the project file (docs.enabled must be true). This is the only
command in amfelt that deletes files from your project repository; run `docs
check` first to preview what it would change, without writing anything.

Every page the generator produces is written, or left untouched if its content
did not change. Every page already in that directory that this run does not
produce is deleted — including a page for a source, target, or object removed
from the project since the last run — so the documentation directory always
matches the project exactly.

Only Markdown files are managed at all; anything else under the directory,
images for instance, is left exactly as it is. A Markdown page the generator did
not write itself, a symbolic link anywhere under the directory, or a directory
that itself contains a .git repository stops the command with an error before a
single file is written or deleted, rather than silently overwriting, deleting,
or working around it.

Prose you add inside a page's protected regions is preserved across runs. If an
object that carried such a region is removed from the project, its authored
prose has nowhere left to go and the command reports it as a warning naming the
page and region — recover it from git history if you still need it.

## Usage

```text
amfelt docs generate [flags]
```

## Examples

```text
docs generate
Generates documentation for the project in the current directory and writes it
into docs.path.

docs generate --path pcf/PCF-postgres.yaml
Generates documentation for the project defined by the given project file.
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--path` | `string` | `amfelt.yaml` | path of the Amfelt project file |
| `--strict` | `bool` | `true` | use strict validation |
{.clidoc-flags-table}

## Global flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--amfelt-dir` | `string` | `.amfelt` | directory for workspace files (such as plugins); does not move agent identity (controlled by AMFELT_DIR) |
| `--config` | `string` | — | directory or filename of the application configuration |
| `-f`, `--format` | `string` | `default` | log format to use; either default, pretty, or json |
| `-l`, `--level` | `string` | `info` | minimum log level to display; either error, warn, info, or debug |
| `-v`, `--verbose` | `bool` | `false` | trigger to use verbose logging |
{.clidoc-flags-table}

## See also

- [`docs`](/docs/reference/command-line/docs/) — the parent command

---

Generated from `amfelt` v5.6.3.
