> For the complete documentation index, see [llms.txt](https://bitpicky.gitbook.io/dbt-sugar/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bitpicky.gitbook.io/dbt-sugar/commands/dbt-sugar-doc/doc-cli-reference.md).

# doc CLI reference (full-list)

### Model Name

The `-m/--model` argument followed by the name of the model you want to document allows dbt-sugar to know which model you wish to document.

### Syrup

The `--syrup` argument controls the configuration you wish dbt-sugar to use (see [how to configure your `sugar_config.yml`](/dbt-sugar/installation-and-configuration/configuration/sugar-config.md)). Normally, you will have specified a **default syrup** in your `sugar_config.yaml` but you may want to override it on-demand. To do so, you can pass `--syrup maple_syrup` on the `dbt-sugar doc` CLI call and dbt-sugar will use this config for that specific run instead of your default one. **Note: if you have not set up a default syrup, dbt-sugar will error and demand that you define one or pass it via the CLI for each use (see** [**sugar\_config setup**](/dbt-sugar/installation-and-configuration/configuration/sugar-config.md)**)**.

### Target

dbt-sugar will **read the dbt profile associated with the dbt project you want it to manage.** It does so well because you declare the profile dbt should use when running models for you in your dbt\_project.yml file (for more info check the [dbt project documentation](https://docs.getdbt.com/reference/dbt_project.yml/)). You also generally declare a **target** in your dbt\_profile.yml file (see [dbt documentation](https://docs.getdbt.com/dbt-cli/configure-your-profile/)). dbt-sugar figures it all out for you, how sweet is that?!

The `--target` argument allows you to override the default target that would normally be specified in [dbt's `profiles.yml`](https://docs.getdbt.com/dbt-cli/configure-your-profile/) for the profile associated with the [dbt\_project ](https://docs.getdbt.com/reference/dbt_project.yml/)associated with the model you want to document. **It is best practice to avoid using the \`--target\` argument unless you know what you are doing as it can lead to surprises (see** [**Caveats & Gotchas**](/dbt-sugar/caveats-and-gotchas/things-to-know-that-we-know-you-should-know.md)**).** It is best to set a `target:` variable in your `profiles.yml` for each dbt project, you plan to have in dbt-sugar's scope (see [dbt documentation](https://docs.getdbt.com/dbt-cli/configure-your-profile/)).

### Schema

Although dbt-sugar will figure out the database schema in which your model lives from the [dbt\_profiles.yml](https://docs.getdbt.com/dbt-cli/configure-your-profile/) you may want to override it. If so, you can pass the `--schema` argument followed by the name of the schema you wish to target. **It is best not to use this argument unless you have a good reason to as dbt-sugar will make a database call to see if the table you want to document exists in your database's metadata.** If you point to a schema that does not contain that dbt model, dbt-sugar will error.

### Preserve Yaml Order

The `--preserve-yaml-order` CLI flag disables dbt-sugar default behaviour alphabetical ordering sanitisation of your model descriptor files. **This is particularly handy if you have comments in your YAML files that you want to keep.**&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bitpicky.gitbook.io/dbt-sugar/commands/dbt-sugar-doc/doc-cli-reference.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
