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

# jnc clean

> Clean workspace environments and caches.

# jnc clean

Removes environment directories and caches. When run without a subcommand, it cleans the `.jnc` folder of the current workspace, removing all installed environments. Use the `cache` subcommand to clean the global package cache.

## Usage

```bash theme={null}
jnc clean [OPTIONS]
jnc clean cache [CACHE_OPTIONS]
```

## Options

| Option                | Short | Description                                                        |
| --------------------- | ----- | ------------------------------------------------------------------ |
| `--environment <ENV>` | `-e`  | Only remove the specified environment instead of all environments. |
| `--activation-cache`  |       | Only remove the activation cache.                                  |
| `--build`             |       | Only remove the build cache.                                       |

## Global Options

| Option                   | Short | Description                                    |
| ------------------------ | ----- | ---------------------------------------------- |
| `--manifest-path <PATH>` | `-m`  | Path to `jnc.toml` or the workspace directory. |

## Subcommand: `jnc clean cache`

Removes cached packages from the global cache directory. Without any flags, removes the entire cache (after confirmation).

### Cache Options

| Option             | Description                                                                |
| ------------------ | -------------------------------------------------------------------------- |
| `--pypi`           | Clean only the PyPI package cache.                                         |
| `--conda`          | Clean only the conda package cache.                                        |
| `--repodata`       | Clean only the repodata cache.                                             |
| `--mapping`        | Clean only the conda-PyPI mapping cache.                                   |
| `--exec`           | Clean only the `exec` temporary environment cache.                         |
| `--build-backends` | Clean only the build backend environments cache.                           |
| `--build`          | Clean only build-related caches (git, work dirs, backends, source builds). |
| `--yes` / `-y`     | Answer yes to all confirmation prompts.                                    |

## Examples

Clean all environments in the current workspace:

```bash theme={null}
jnc clean
```

Clean a specific environment:

```bash theme={null}
jnc clean --environment test
```

Clean the entire global cache:

```bash theme={null}
jnc clean cache --yes
```

Clean only the conda package cache:

```bash theme={null}
jnc clean cache --conda
```

Clean temporary exec environments:

```bash theme={null}
jnc clean cache --exec
```

Clean build-related caches:

```bash theme={null}
jnc clean cache --build
```
