# nsx clean

Clean a generated NSX app build directory

## Usage

```text
nsx clean [-h] [--app-dir APP_DIR] [--board BOARD]
                 [--build-dir BUILD_DIR] [--toolchain TOOLCHAIN] [--full]
                 [--reset] [--force] [--timeout SECONDS]
                 [app]
```

## Arguments

| Option | Value | Default | Description |
| --- | --- | --- | --- |
| app | value | optional | App name or directory (overrides --app-dir; resolved under ./ and ./examples) |

## Options

| Option | Value | Default | Description |
| --- | --- | --- | --- |
| --app-dir APP_DIR | value | . | App directory containing nsx.yml |
| --board BOARD | value | optional | Override board from nsx.yml |
| --build-dir BUILD_DIR | value | optional | Build directory override |
| --toolchain TOOLCHAIN | value | optional | Toolchain override (gcc, armclang, atfe) |
| --full | flag | optional | Remove the full build directory instead of only running the build-system clean target |
| --reset | flag | optional | Reset the app to a freshly-cloned state: remove all build*/ directories, the synced modules/ tree, and the .nsx/ folder. Use this before `git pull` to force `nsx configure` to re-sync from scratch. |
| --force | flag | optional | With --reset, discard locally-modified files under modules/ without prompting |
| --timeout SECONDS | value | optional | Wall-clock budget per subprocess (seconds). Kills the whole process group on timeout. |

## Notes

`--reset` is broader than a normal or `--full` clean: it removes all `build*/` directories,
the synced `modules/` tree and `.nsx/`, restoring freshly cloned app state. Review local
module changes before combining it with `--force`, which discards modified files under
`modules/` without prompting.

```bash
cd <app-dir>
nsx clean
```

Run `nsx commands --json` for the authoritative machine-readable argument schema.

`--app-dir` names the app directory containing `nsx.yml`; when it is omitted NSX searches
upward from the current directory. The positional `app` argument overrides `--app-dir` and
is resolved under the current directory and under `examples/`.

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