# Generating a release definition

In a high velocity project operating on a trunk such as a #flxbl project and with substantial number of packages, manually generating release definition can be a chore. This can eased by using generating the release definition file automatically after every publish command.\
\
One can utilise [release config ](/flxbl/sfp/development/defining-a-domain/release-config.md)along with release definition generate command to automate the process of generating release definitions.

```bash
sfp server releasedefinition:generate \
  --gitref HEAD \
  --configfile config/release-config.yaml \
  --releasename "Release-2.0.0" \
  --repository myorg/myrepo \
  --branch main
```

## Command Attributes

| Flag                | Description                                                     | Required |
| ------------------- | --------------------------------------------------------------- | -------- |
| `-c, --gitref`      | Git reference (branch/tag/commit) to use for artifact selection | Yes      |
| `-f, --configfile`  | Path to the release configuration YAML file                     | Yes      |
| `-n, --releasename` | Name of the release for the definition                          | Yes      |
| `-b, --branch`      | Branch name for context (defaults to current branch)            | No       |
| `--repository`      | Repository identifier in the format org/repo                    | Yes      |
| `--skip-publish`    | Generate definition without publishing to server                | No       |
| `-m, --metadata`    | Additional metadata to include in the release definition        | No       |
| `--email`           | Email of the user generating the release                        | No       |

## How It Works

The command:

1. Reads the release configuration file to understand which packages to include
2. Uses the specified git reference to determine the latest artifact versions
3. Generates a release definition YAML with the correct versions
4. Publishes the definition to the server unless `--skip-publish` is used


---

# 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.flxbl.io/flxbl/sfp/releasing-artifacts/generating-a-release-definition.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.
