# edit

Use `greymatter edit` to **edit the configuration of an existing object** in the Grey Matter mesh. Objects can be `zone`, `proxy`, `domain`, `route`, `shared_rules`, `cluster`, `catalog_zone`, and `catalog_cluster`.

## Usage

```bash
greymatter [GLOBAL OPTIONS] edit [OPTIONS] <object type> [object key]
```

### Sample Usage

By setting the `EDITOR` environment variable, the `greymatter` tool will open the editor of choice and let the user edit the object directly.

```bash
EDITOR=vim greymatter edit domain domain-localhost
```

After editing the JSON directly in vim, the returned object will look something like the below (depending on the user input).

```
[info] 2019/07/10 03:38:43 Preferring --api.key for authentication
{
  "domain_key": "domain-localhost",
  "zone_key": "zone-default",
  "name": "localhost",
  "port": 443,
  "redirects": null,
  "gzip_enabled": false,
  "cors_config": null,
  "aliases": null,
  "force_https": false,
  "checksum": "a35ccf0634599ac83b0b9cb61b07297e925f28bbc669a9a63cb65b9c6a6ea309"
}
```

The API objects are updated directly in the mesh after exiting the editor.

#### Help

To list available commands run with the global help flag:

```bash
greymatter edit --help
```

## Questions

{% hint style="success" %}
**Need help with the CLI?**

Create an account at [Grey Matter Support](https://support.greymatter.io/support/home) to reach our team.
{% endhint %}
