# Overview

> Read provider and virtual tag keys, check tag coverage, and manage virtual tags from YAML files in the terminal.

Source: https://docs.levelfour.ai/cli/commands/tags


`l4 tags` reads your organization's tag keys, both the provider keys from your cloud bills and the virtual keys you defined. It also manages virtual keys from YAML files you keep in version control. [Virtual tags](/guides/virtual-tags) explains how a virtual key picks a value for each cost.

```bash
l4 tags <command> [flags]
```

## Subcommands

| Command                                     | Purpose                                                            | Scope        |
| ------------------------------------------- | ------------------------------------------------------------------ | ------------ |
| [`list`](/cli/commands/tags/list)           | Every key, with its values, resources and spend                    | `read`       |
| [`show`](/cli/commands/tags/show)           | One key: its rules in order, spend per value, unallocated spend    | `read`       |
| [`coverage`](/cli/commands/tags/coverage)   | Tagged share of spend and resources, with and without virtual tags | `read`       |
| [`resources`](/cli/commands/tags/resources) | Resources carrying a key, and the value each one holds             | `read`       |
| [`costs`](/cli/commands/tags/costs)         | Spend per value of a key                                           | `read`       |
| [`preview`](/cli/commands/tags/preview)     | Dry run of a tag file. Stores nothing                              | `read`       |
| [`apply`](/cli/commands/tags/apply)         | Create or replace a virtual key from a tag file                    | `read-write` |
| [`delete`](/cli/commands/tags/delete)       | Delete a virtual key                                               | `read-write` |

## Naming a key

`show`, `resources`, `costs` and `delete` take a `<key>` argument: a key ID or a key name. [`l4 tags list`](/cli/commands/tags/list) prints both. A `vtk_` ID belongs to a virtual key and a `ptk_` ID to a provider key. A virtual key can share its name with a provider key, and the ID then picks the one you mean.

Two commands narrow that. `delete` refuses a `ptk_` ID, since a provider tag comes from the bill. `costs` takes a name or a `vtk_` ID and reads a `ptk_` ID as a literal tag key, which matches nothing.

When the argument is a name, the CLI resolves it against the key list before making the real request, so a name nobody holds fails locally with `no tag key named ...` rather than a `404` from the API.

## Dates

`--start` and `--end` take `YYYY-MM-DD` and go together. Without them, a command reads the last 30 complete days. [`l4 tags costs`](/cli/commands/tags/costs) is the exception, and reads the current month to date.

Global flags (`--json`, `--jq`, `--template`, `--quiet`) apply to every subcommand. See [CLI overview](/cli#global-flags).

## Examples

```bash
l4 tags list --origin virtual
l4 tags show Teams
l4 tags coverage --provider aws
l4 tags preview -f teams.yaml
l4 tags apply -f teams.yaml --dry-run
```

## Related

* [Virtual tags](/guides/virtual-tags): evaluation order, worked examples, dimensions, operators and limits
* [`l4 costs`](/cli/commands/costs): the cost breakdown, with provider tag filters
* [Output formats](/cli/output-formats): what `--json`, `--jq` and `--template` emit
* [Tags API reference](/api-reference/tags): the endpoints underneath
