---
title: "ktm variables delete"
description: "Delete a variable; refuses if any test references it"
sidebarTitle: "delete"
lastUpdated: "2026-09-23"
---

> **For AI agents:** the complete documentation index is at [llms.txt](/llms.txt). Append `.md` to any page URL for its markdown version.

{/* GENERATED FILE: do not edit by hand. Regenerate with: node scripts/generate.mjs */}

Delete a variable; refuses if any test references it

## Usage

```bash
ktm variables delete <id> [flags]
```

## Examples

```bash
ktm variables delete 17
```

## Arguments

| Argument | Required |
| --- | --- |
| `id` | Yes |

## Details

Refuses if any test references the variable, listing the references. The
platform enforces the same guard server-side and exposes no
override, so there is no --force flag here — remove the references first via
'ktm tests edit' (or delete the referencing tests) and re-run delete.

## Related

- [`ktm variables`](/cli/commands/variables)
- [`ktm tests`](/cli/commands/tests)

<Note>
  Global flags (`--output`, `--debug`, `--host`, …) apply to every command. See the [command reference overview](/cli/commands/overview).
</Note>

## What's next?

<Columns cols={2}>
  <Card title="All commands" icon="terminal" href="/cli/commands/overview">
    Browse the full CLI reference.
  </Card>
  <Card title="Get started" icon="rocket" href="/cli/getting-started">
    Install the CLI and authenticate.
  </Card>
</Columns>
