> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ankra.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ankra stack-profiles

> Manage reusable stack profiles

## ankra stack-profiles

List, export, and import organisation-level stack profiles.

## ankra stack-profiles apply

Apply (instantiate) a stack profile onto a cluster.

By default this creates a reviewable stack DRAFT on the target cluster - nothing is
deployed until you review it in the Ankra dashboard or pass --deploy.

Bind profile parameters with --set name=value. For secret parameters prefer
\--set-file name=path or --set-env name=ENV\_VAR so the value never appears in your
shell history or process list. Use 'ankra stack-profiles get \<profile-id>' to see
which parameters a profile expects.

```bash theme={null}
ankra stack-profiles apply [profile-id|profile-name] [flags]
```

**Flags**

| Flag             | Default | Description                                                                            |
| ---------------- | ------- | -------------------------------------------------------------------------------------- |
| `--cluster`      |         | Target cluster name or ID (defaults to the selected cluster)                           |
| `--deploy`       | `false` | Deploy the stack immediately instead of leaving a draft for review                     |
| `-o`, `--output` |         | Output format: json or yaml (default: human-readable)                                  |
| `--set`          | `[]`    | Bind a parameter: name=value (repeatable; not for secrets)                             |
| `--set-env`      | `[]`    | Bind a parameter from an environment variable: name=ENV\_VAR (repeatable; secret-safe) |
| `--set-file`     | `[]`    | Bind a parameter from a file: name=path (repeatable; secret-safe)                      |
| `--stack-name`   |         | Name for the new stack (defaults to the profile's stack name)                          |
| `--version`      |         | Profile version to apply, as 1 or v1 (defaults to the profile's current version)       |

## ankra stack-profiles drafts

Work with stack profile builder drafts from the terminal.

A draft is the editable working copy behind a profile version: open one from
an existing profile (or from a deployed stack), annotate its parameters with
the titles and descriptions the launch form shows as guidance, and publish it
as the next version.

## ankra stack-profiles drafts annotate

Set a parameter's title and description on a draft. The description is
the guidance the launch form shows under the field, so this is how a profile
author instructs the person filling it in. Publishing the draft makes the
annotations live.

```bash theme={null}
ankra stack-profiles drafts annotate <draft-id> [flags]
```

**Flags**

| Flag             | Default | Description                                           |
| ---------------- | ------- | ----------------------------------------------------- |
| `--description`  |         | Guidance shown under the field in the launch form     |
| `-o`, `--output` |         | Output format: json or yaml (default: human-readable) |
| `--parameter`    |         | Parameter name to annotate                            |
| `--title`        |         | Display title for the field (optional)                |

## ankra stack-profiles drafts create

Open a builder draft: --profile edits an existing profile (publishing
creates its next version), --name starts a brand-new profile, and
\--source-cluster with --source-stack seeds the draft from a deployed stack.

```bash theme={null}
ankra stack-profiles drafts create [flags]
```

**Flags**

| Flag               | Default | Description                                                        |
| ------------------ | ------- | ------------------------------------------------------------------ |
| `--name`           |         | Name for a brand-new profile draft                                 |
| `-o`, `--output`   |         | Output format: json or yaml (default: human-readable)              |
| `--profile`        |         | Existing profile (name or ID) to open a draft on                   |
| `--source-cluster` |         | Cluster (name or ID) to seed the draft from a deployed stack       |
| `--source-stack`   |         | Deployed stack name to seed the draft from (with --source-cluster) |

## ankra stack-profiles drafts delete

Discard a builder draft

```bash theme={null}
ankra stack-profiles drafts delete <draft-id> [flags]
```

**Flags**

| Flag             | Default | Description                                           |
| ---------------- | ------- | ----------------------------------------------------- |
| `-o`, `--output` |         | Output format: json or yaml (default: human-readable) |

## ankra stack-profiles drafts get

Show a draft's parameters and their annotations

```bash theme={null}
ankra stack-profiles drafts get <draft-id> [flags]
```

**Flags**

| Flag             | Default | Description                                           |
| ---------------- | ------- | ----------------------------------------------------- |
| `-o`, `--output` |         | Output format: json or yaml (default: human-readable) |

## ankra stack-profiles drafts list

List the organisation's open builder drafts

```bash theme={null}
ankra stack-profiles drafts list [flags]
```

**Flags**

| Flag             | Default | Description                                           |
| ---------------- | ------- | ----------------------------------------------------- |
| `-o`, `--output` |         | Output format: json or yaml (default: human-readable) |

## ankra stack-profiles drafts publish

Publish a draft as a profile version

```bash theme={null}
ankra stack-profiles drafts publish <draft-id> [flags]
```

**Flags**

| Flag             | Default  | Description                                                    |
| ---------------- | -------- | -------------------------------------------------------------- |
| `--changelog`    |          | Changelog entry for the version                                |
| `--channel`      | `stable` | Release channel for the version                                |
| `-o`, `--output` |          | Output format: json or yaml (default: human-readable)          |
| `--visibility`   |          | Profile visibility applied at publish (organisation or public) |

## ankra stack-profiles export-iac

Export a profile version as ClusterInfrastructureAsCode YAML

```bash theme={null}
ankra stack-profiles export-iac [profile-id|profile-name] [flags]
```

**Flags**

| Flag             | Default | Description                                                                       |
| ---------------- | ------- | --------------------------------------------------------------------------------- |
| `-o`, `--output` |         | Write YAML to this file instead of stdout                                         |
| `--version`      |         | Profile version to export, as 1 or v1 (defaults to the profile's current version) |

## ankra stack-profiles get

Describe a stack profile: its metadata, published versions, and the parameters you can bind when applying it.

```bash theme={null}
ankra stack-profiles get [profile-id|profile-name] [flags]
```

**Flags**

| Flag             | Default | Description                                                               |
| ---------------- | ------- | ------------------------------------------------------------------------- |
| `-o`, `--output` |         | Output format: json or yaml (default: human-readable)                     |
| `--version`      |         | Profile version to describe, as 1 or v1 (defaults to the current version) |

## ankra stack-profiles import

Import a profile from a ClusterInfrastructureAsCode YAML file

```bash theme={null}
ankra stack-profiles import [file] [flags]
```

**Flags**

| Flag         | Default   | Description                                          |
| ------------ | --------- | ---------------------------------------------------- |
| `--category` | `general` | Profile category                                     |
| `--name`     |           | Profile name (defaults to metadata.name in the file) |

## ankra stack-profiles list

List stack profiles in the active organisation

```bash theme={null}
ankra stack-profiles list [flags]
```

**Flags**

| Flag             | Default | Description                                           |
| ---------------- | ------- | ----------------------------------------------------- |
| `--category`     |         | Filter profiles by category (e.g. 'monitoring')       |
| `-o`, `--output` |         | Output format: json or yaml (default: human-readable) |
| `--page`         | `1`     | Page number                                           |
| `--page-size`    | `25`    | Page size                                             |
| `--search`       |         | Filter profiles by name                               |
