# flyteplugins.union.cli

## Directory

### Methods

| Method | Description |
|-|-|
| [`edit_with_retry()`](#edit_with_retry) | Open an editor and retry or save to file on failure. |

## Methods

#### edit_with_retry()

```python
def edit_with_retry(
    yaml_text: str,
    apply_fn,
    console,
    noun: str,
)
```
Open an editor and retry or save to file on failure.

| Parameter | Type | Description |
|-|-|-|
| `yaml_text` | `str` | Initial YAML content to edit. |
| `apply_fn` |  | Callable that takes the edited YAML string and applies it. Should raise on failure. |
| `console` |  | Rich console for output. |
| `noun` | `str` | Name of the resource for messages (e.g. "role", "policy"). |

**Returns:** The result of apply_fn on success, or None if cancelled.

---
**Source**: https://github.com/unionai/unionai-docs/blob/main/content/api-reference/integrations/union/packages/flyteplugins.union.cli/_index.md
**HTML**: https://www.union.ai/docs/v2/byoc/api-reference/integrations/union/packages/flyteplugins.union.cli/
