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

# ocx remove

> Reference for the ocx remove command — remove installed components

## Usage

```bash theme={null}
ocx remove <components...> [options]
```

## Description

Remove installed components from your project. OCX deletes the component files and removes the entry from the receipt file (`.ocx/receipt.jsonc`).

## Arguments

| Argument        | Required | Description                                                                                                                                                                                                      |
| --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `components...` | Yes      | Component references to remove. Canonical IDs are authoritative (e.g., `https://ocx.kdco.dev::kdco/researcher@1.0.0`); shorthand `alias/component` refs (e.g., `kdco/researcher`) are accepted as a convenience. |

## Flags

| Flag           | Shorthand | Default           | Description                                       |
| -------------- | --------- | ----------------- | ------------------------------------------------- |
| `--dry-run`    |           | `false`           | Show what would be removed without making changes |
| `--force`      | `-f`      | `false`           | Force removal even if files have been modified    |
| `--cwd <path>` |           | Current directory | Working directory                                 |
| `--quiet`      | `-q`      | `false`           | Suppress output                                   |
| `--verbose`    | `-v`      | `false`           | Verbose output                                    |
| `--json`       |           | `false`           | Output as JSON                                    |

## Examples

### Remove a Single Component (Canonical ID)

```bash theme={null}
ocx remove https://registry.example.com::shadcn/button@1.2.3
```

### Remove a Single Component (Shorthand Convenience)

```bash theme={null}
ocx remove shadcn/button
```

### Remove Multiple Components

```bash theme={null}
ocx remove shadcn/button shadcn/card
```

### Preview What Would Be Removed

```bash theme={null}
ocx remove shadcn/button --dry-run
```

### Force Remove Modified Files

```bash theme={null}
ocx remove shadcn/button --force
```

If a component's files have been edited since installation, OCX rejects the removal by default to prevent accidental data loss. Use `--force` to override this safety check.

## See Also

* [ocx add](/docs/cli/add) — Add components to your project.
* [ocx update](/docs/cli/update) — Update components instead of removing.
* [CLI Reference](/docs/cli/commands) — All commands.
