# catalogers/hooks

* `lunar-config.yml -> catalogers.<cataloger-index>.hook`
* `lunar-config.yml -> catalogers.<cataloger-index>.hooks`
* `lunar-cataloger.yml -> catalogers.<cataloger-index>.hook`
* `lunar-cataloger.yml -> catalogers.<cataloger-index>.hooks`
* Type: `object` (singular `hook`) or `array` (plural `hooks`)
* Form:

  ```yaml
  hook:
    type: <hook-type>
    <options>
  ```

  or

  ```yaml
  hooks:
    - type: <hook-type>
      <options>
    - type: <hook-type>
      <options>
    - ...
  ```

A cataloger hook defines a trigger point for when a cataloger should run. Catalogers can be triggered by various events such as code changes, or cron schedules. Both `hook` (singular) and `hooks` (plural array) are supported. Using `hook` is equivalent to using a single hook in the `hooks` field.

A hook has different configuration options depending on the type of event it is triggered by.

## Hook types

### `cron`

* Form:

  ```yaml
  type: cron
  schedule: <cron-schedule>
  ```

The `cron` type triggers the cataloger on a specified schedule. The schedule is defined using a cron expression.

### `repo`

* Form:

  ```yaml
  type: repo
  repo: github://<org>/<repo>
  ```

The `repo` type triggers the cataloger when a commit is made to a specified repository. The repository is defined using the GitHub URL format. This cataloger type is most useful for centralized repositories that contain information about domains and/or components.

### `component-repo`

* Form:

  ```yaml
  type: component-repo
  ```

The `component-repo` type triggers the cataloger when a commit is made to a component repository. This cataloger type is most useful when additional information about components is available in each of the respective repositories.

Although this cataloger type cannot be used to define new components, it can be used to augment the metadata (such as owner, description and tags) associated with existing components.

### `component-cron`

* Form:

  ```yaml
  type: component-cron
  schedule: <cron-schedule>
  ```

The `component-cron` type triggers a cataloger run for each component, on a specified schedule. Although this cataloger type cannot be used to define new components, it can be used to augment the metadata (such as owner, description and tags) based on its component JSON.


---

# Agent Instructions: 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:

```
GET https://docs-lunar.earthly.dev/configuration/lunar-config/cataloger-hooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
