---
url: https://docs.mochiexec.io/reference/cli/mochi_views_set.md
description: Replace the views document from a JSON file (- for stdin)
---

# mochi views set

Replace the views document from a JSON file (- for stdin)

## Synopsis

Replace the whole views document. Start from `mochi views get -o json`, edit it, and send it back with its revision; a set whose revision no longer matches the file is refused. Unknown section types and fields are rejected: see `mochi views schema`.

```shell
mochi views set [flags]
```

## Options

| Flag | Type | Description |
|------|------|-------------|
| `--file` | `string` | JSON document to write, or - for stdin |
| `-h, --help` |  | help for set |
| `-o, --output` | `string` | Output format: text or json (default "text") |

## Options inherited from parent commands

| Flag | Type | Description |
|------|------|-------------|
| `-L, --log-level` | `string` | Log verbosity level (debug, info, fatal) (default "info") |
| `--sync` |  | Sync the executable cache first, pulling git-sourced workspaces from their remotes |

## See also

* [mochi views](mochi_views.md) — Manage saved views
