> For the complete documentation index, see [llms.txt](https://docs.enclaive.cloud/virtual-hsm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.enclaive.cloud/virtual-hsm/cli/configuration-and-management/vhsm-namespace.md).

# vhsm namespace

The `namespace` command groups subcommands for managing namespaces in vHSM.

### **Examples**

| Action                                              | Command                                                                          |
| --------------------------------------------------- | -------------------------------------------------------------------------------- |
| List all namespaces                                 | `vhsm namespace list`                                                            |
| List all namespaces with details                    | `vhsm namespace list -detailed`                                                  |
| Create a namespace (`ns1/`) with no custom metadata | `vhsm namespace create ns1/`                                                     |
| Create a namespace with custom metadata             | `vhsm namespace create -custom-metadata=foo=abc -custom-metadata=bar=123 ns1/`   |
| Patch a namespace (`ns1/`) to add/remove metadata   | `vhsm namespace patch -custom-metadata=bar=123 -remove-custom-metadata=foo ns1/` |
| Delete a namespace (`ns1/`)                         | `vhsm namespace delete ns1/`                                                     |
| Lookup information of a namespace (`ns1/`)          | `vhsm namespace lookup ns1/`                                                     |
| Lock the API for the current namespace              | `vhsm namespace lock`                                                            |
| Lock the API for a descendant namespace (`ns1/`)    | `vhsm namespace lock ns1/`                                                       |
| Unlock the API for the current namespace            | `vhsm namespace unlock -unlock-key <unlock key>`                                 |
| Unlock the API for a descendant namespace (`ns1/`)  | `vhsm namespace unlock -unlock-key <unlock key> ns1/`                            |

***

### **Usage**

```
vhsm namespace <subcommand> [options] [args]
```

The command operates within the **namespace context** of the currently logged-in token.

#### **Subcommands**

| Subcommand | Description                    |
| ---------- | ------------------------------ |
| `create`   | Create a new namespace         |
| `delete`   | Delete an existing namespace   |
| `list`     | List child namespaces          |
| `lookup`   | Retrieve namespace details     |
| `lock`     | Lock the API for a namespace   |
| `unlock`   | Unlock the API for a namespace |

***

### **Command Options**

| Option                          | Description                                    | Default |
| ------------------------------- | ---------------------------------------------- | ------- |
| `-detailed`                     | Show additional namespace details when listing | `false` |
| `-custom-metadata=<K=V>`        | Set custom metadata when creating/patching     | `None`  |
| `-remove-custom-metadata=<key>` | Remove a metadata key when patching            | `None`  |
| `-unlock-key=<key>`             | Required to unlock a locked namespace          | `None`  |
