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

> ## Agent Instructions
> The docs are served at https://docs.devias.io. Every path in these docs is relative to that root: /llms.txt is https://docs.devias.io/llms.txt.
> Devias is an open-source platform that works as an operating system for a business: a core (records, views, workflows, agents, permissions) with installable modules.
> Pages are typed by folder. concepts/ explains what things are, guides/ gives procedures, reference/ is exhaustive (SDK, CLI, HTTP API), operate/ covers hosting. Use /start/glossary for exact terms.
> Every id in a module (module, object, field, view, action, workflow, step, connection, variable, event, policy) is a uuid. Generate them with `devias id <count>`. Never invent dotted or readable ids.
> Run `devias plan` and read its output before `devias apply`. Apply only what the plan says.
> The OpenAPI document, including the routes of the modules in the reference setup, is at /reference/api/openapi.json.
> Devias is young and changes quickly. If a page and the source repository (github.com/devias-io/devias) disagree, the repository is right.

# Plan and apply

> How installing or updating a module works in two steps. A plan marks each item create, update, delete or conflict, and destructive changes need explicit permission. Covers the studio flow, the devias plan and apply commands with their flags and exit codes, and the API key permission needed.

Installing or updating a module is always two steps: a **plan**, then an **apply**. The plan lists every change before anything is written.

## What a plan says

Devias compares the manifest with what the workspace already has and marks each item as one of:

| Mark | Meaning |
| - | - |
| `create` | New, and added. |
| `update` | It exists and something changed. |
| `delete` | It is gone from the manifest, so it would be removed. |
| `conflict` | Something with that name already exists and is not the module's. |

Changes that delete data are **destructive**. Apply refuses them unless explicitly allowed.

## Plan and apply in the studio

In **Settings → Modules**, open the module and its **Install** or **Changes** tab, and apply the plan there. In development, the studio applies plans that have no destructive changes and no conflicts by itself on start-up, and asks about the rest.

## Plan and apply from the command line

The `devias` command does the same against a running server. It needs the workspace id, a manifest file and an API key.

```bash theme={"dark"}
devias plan  -w <workspaceId> -m ./src/manifest/index.ts -k $DEVIAS_API_KEY
devias apply -w <workspaceId> -m ./src/manifest/index.ts -k $DEVIAS_API_KEY
```

| Command | What it does |
| - | - |
| `devias id [count]` | Prints new uuids for your manifest. |
| `devias plan` | Shows what apply would change. Exits with 2 if there are conflicts. |
| `devias apply` | Applies the manifest. Add `--allow-destructive` to allow deletions, and `-y` to skip the question. |
| `devias dev` | Watches the manifest and re-applies changes that aren't destructive. |
| `devias uninstall` | Removes everything the module owns. |

A different server is set with `-u` or `DEVIAS_URL` (default `http://localhost:3000`).

> [!WARNING]
>
> Plan and apply need an API key that may manage modules. A key made in **Settings → API keys** can only read records, so create the key through the API with `permissions: { "module": ["manage"] }`.

## Related

* [CLI reference](https://docs.devias.io/reference/cli/overview.md): every command and option.
* [Publish a module](https://docs.devias.io/guides/modules/publishing.md): version, logo and release.
* [Install and connect modules](https://docs.devias.io/guides/studio/modules.md): the same flow from the studio.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.