# Framework

URL: https://docs.hanzo.ai/docs/cli/framework

> The `hanzo framework` commands.

Also for this capability: [API](https://docs.hanzo.ai/docs/openapi/framework) · **CLI** · [MCP](https://docs.hanzo.ai/docs/mcp-tools/framework) · [SDKs](https://docs.hanzo.ai/docs/sdks)

Document types you define: describe a record once, then create, list, submit and cancel documents against it.

[API reference →](https://docs.hanzo.ai/docs/openapi/framework)

```bash
hanzo framework modules list
```

Every command takes `--json` for the raw response and `--help` for its own flags. Sign in once with `hanzo auth login`; the commands below use that session, and the org they act in is the one it carries.

| Command                         | What it does                                                                                                                               |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `hanzo framework add <doctype>` | Create one document of a DocType, from that DocType's own fields.                                                                          |
| `hanzo framework get <doctype>` | Returns the caller org's documents of one DocType, filtered, ordered and projected by the query.                                           |
| `hanzo framework summary`       | Reports how much of the DocType surface the caller's org uses: how many DocTypes it has defined, and how many documents exist across them. |

### Doctype

| Command                                           | What it does                                                                                |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `hanzo framework doctype cancel <doctype> <name>` | Moves a submitted document to cancelled (docstatus 1 → 2) after its on\_cancel hooks agree. |
| `hanzo framework doctype get <doctype> <name>`    | Returns one document by name, with Password fields redacted.                                |
| `hanzo framework doctype rm <doctype> <name>`     | Removes one document, after its on\_trash hooks agree.                                      |
| `hanzo framework doctype set <doctype> <name>`    | Replace a draft document's field data wholesale.                                            |
| `hanzo framework doctype submit <doctype> <name>` | Moves a draft to submitted (docstatus 0 → 1) after its on\_submit hooks agree.              |

### Doctypes

| Command                               | What it does                                                                                                                                                                               |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `hanzo framework doctypes create`     | Defines a DocType in the caller's org: the metadata that gives a document surface its fields, its naming rule, whether it has a submit/cancel lifecycle, and which role may do what to it. |
| `hanzo framework doctypes get <name>` | Returns one DocType definition — its fields, naming rule, permissions and lifecycle flags.                                                                                                 |
| `hanzo framework doctypes list`       | Returns every DocType defined in the caller's org.                                                                                                                                         |
| `hanzo framework doctypes rm <name>`  | Removes a DocType and every document stored under it.                                                                                                                                      |
| `hanzo framework doctypes set <name>` | Replaces a DocType definition wholesale (PUT semantics): the stored definition becomes the body.                                                                                           |

### Modules

| Command                                    | What it does                                                                                                                           |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| `hanzo framework modules get <module>`     | Returns one app lane's install state for the caller's org: the DocTypes the lane declares, and which of them already exist in the org. |
| `hanzo framework modules install <module>` | Creates an app lane's DocTypes in the caller's org.                                                                                    |
| `hanzo framework modules list`             | Returns every app lane compiled into this deployment and the DocTypes each one installs.                                               |
