# nsx module register

Register an external module override for a single app and vendor it into that app.

## Usage

```text
nsx module register [-h] --metadata METADATA --project PROJECT
                           [--project-url PROJECT_URL]
                           [--project-revision PROJECT_REVISION]
                           [--project-path PROJECT_PATH]
                           [--project-local-path PROJECT_LOCAL_PATH]
                           [--app-dir APP_DIR] [--override] [--dry-run]
                           module
```

## Arguments

| Option | Value | Default | Description |
| --- | --- | --- | --- |
| module | value | required | Module name |

## Options

| Option | Value | Default | Description |
| --- | --- | --- | --- |
| --metadata METADATA | value | required | Path to the module's nsx-module.yaml |
| --project PROJECT | value | required | Registry project key for this module |
| --project-url PROJECT_URL | value | optional | Override git project URL |
| --project-revision PROJECT_REVISION | value | optional | Override git project revision |
| --project-path PROJECT_PATH | value | optional | Override git project path |
| --project-local-path PROJECT_LOCAL_PATH | value | optional | Local filesystem path to vendor from |
| --app-dir APP_DIR | value | . | App directory containing nsx.yml |
| --override | flag | optional | Override existing module entry |
| --dry-run | flag | optional | Show changes without writing |

## Notes

Use this to register an external module for one app without editing the packaged registry,
for local filesystem modules and custom git repos that are not part of the built-in NSX
catalog. `register` writes an app-local override into `nsx.yml` and then vendors the
registered module into that app.

Local filesystem example:

```bash
cd <app-dir>
nsx module register my-custom-module \
    --metadata /path/to/my-custom-module/nsx-module.yaml \
    --project my_custom_repo \
    --project-local-path /path/to/my-custom-module
```

Git-backed example:

```bash
cd <app-dir>
nsx module register my-custom-module \
    --metadata /path/to/my-custom-module/nsx-module.yaml \
    --project my_custom_repo \
    --project-url https://github.com/myorg/my_custom_repo.git \
    --project-revision main \
    --project-path modules/my_custom_repo
```

`-v/--verbose`, `-q/--quiet` are parsed by `nsx` itself, so they go before the command name, as `nsx -v module register`.
