home / skills / knoopx / pi / knip

knip skill

/agent/skills/knip

npx playbooks add skill knoopx/pi --skill knip

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.3 KB
---
name: knip
description: Find unused dependencies, files, and exports in JS/TS projects. Use when cleaning up dead code, removing stale packages from package.json, or identifying unreferenced exports.
---

# Knip

Find unused files, dependencies, and exports in TypeScript/JavaScript projects.

## Usage

```bash
bunx knip                     # Analyze project
bunx knip --production        # Production only (no tests, devDeps)
bunx knip --strict            # Direct dependencies only
bunx knip --fix               # Auto-remove unused (use cautiously)
bunx knip --include files     # Only unused files
bunx knip --include exports   # Only unused exports
bunx knip --include dependencies  # Only unused deps
```

## Output Formats

```bash
bunx knip --reporter compact  # Compact output
bunx knip --reporter json     # JSON for tooling
bunx knip --reporter github-actions  # CI annotations
```

## Filtering

```bash
bunx knip --workspace packages/client  # Specific workspace
bunx knip --exclude "test/**/*"        # Exclude patterns
```

## Debugging

```bash
bunx knip --debug                      # Debug output
bunx knip --trace-file src/utils.ts    # Trace file
bunx knip --trace-export myFunction    # Trace export
```

## Configuration

Configure via `.knip.json` or `knip.config.js` for custom entry points and exclusions.