---
title: "ezgh flags toggle"
description: "Turn a flag's targeting on or off in an environment."
---

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

# ezgh flags toggle

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh flags toggle <key> --env <environment> --on|--off [--comment text] [flags]
```

Turn a flag's targeting on (its targets, rules and default apply) or off (everyone gets its off variation) in one environment. The change is a new version of the flag's config there, with `--comment` (required where the environment requires one). If someone else changes the config at the same moment, ezgh reads it again and retries once.

Part of [`ezgh flags`](/cli/reference/flags).

## Examples

```sh
ezgh flags toggle new-checkout --env production --on --comment "Launch"
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--comment` | string |  | why, kept with the version |
| `--env` | string |  | the environment's key (required) |
| `--off` | boolean |  | turn targeting off |
| `--on` | boolean |  | turn targeting on |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/flags-toggle/index.mdx
