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

# occtoo managed-tags

> Manage managed tags and their values

A managed tag is a list of values, plain or translated, that your organization maintains. `occtoo tags` is short for `occtoo managed-tags`.

## List and show

```bash theme={null}
occtoo managed-tags list --type text
occtoo managed-tags show <ID>
```

`show` prints the tag and its values.

| Flag (`list`) | Description |
| - | - |
| `--name <NAME>` | Only managed tags whose name contains this text |
| `--type <KIND>` | `text` or `localized-text` |
| `--parent <PARENT>` | Only the children of this managed tag |
| `--limit <LIMIT>` | Maximum number to return. Default `100` |

## Create a managed tag

```bash theme={null}
occtoo managed-tags create
echo '{"displayName": "Colors", "type": "Text"}' | occtoo managed-tags create
```

`parentId` is optional:

```json theme={null}
{ "displayName": "Colors", "type": "Text", "parentId": "<ID>" }
```

The type is `Text` or `LocalizedText`, and can't change later.

## Edit and delete

```bash theme={null}
echo '{"displayName": "Colours"}' | occtoo managed-tags edit <ID>
occtoo managed-tags delete <ID> --yes
```

`edit` changes the name or parent. Both fields are optional, and `"parentId": null` removes the parent. Changing or removing the parent clears the parent of every value. `delete` removes the tag and its values.

## Values

```bash theme={null}
occtoo managed-tags values list <TAG>
echo '{"key": "red", "value": {"singleValue": "Red"}}' | occtoo managed-tags values create <TAG>
echo '{"order": 2}' | occtoo managed-tags values edit <TAG> red
occtoo managed-tags values delete <TAG> red --yes
```

| Command | What it does |
| - | - |
| `values list <TAG>` | Lists the values. `--key` filters by key, `--parent-key` lists the children of one value, `--limit` defaults to `1000` |
| `values create <TAG>` | Adds a value from prompts or JSON |
| `values edit <TAG> <KEY>` | Changes a value. Every field is optional, and `"parentKey": null` removes the parent |
| `values delete <TAG> <KEY>` | Deletes a value. Values that had it as parent lose their parent |

JSON for `values create`. `order` and `parentKey` are optional. Give the text as `singleValue` for a `Text` tag, or as `localizedValue` for a `LocalizedText` tag:

```json theme={null}
{"key": "red", "value": {"singleValue": "Red"}, "order": 1, "parentKey": "warm"}
{"key": "red", "value": {"localizedValue": {"en": "Red", "sv": "Röd"}}}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.