| name | knip |
| description | Finds 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
Finds unused files, dependencies, and exports in TypeScript/JavaScript projects.
Usage
bunx knip
bunx knip --production
bunx knip --strict
bunx knip --fix
bunx knip --include files
bunx knip --include exports
bunx knip --include dependencies
Output Formats
bunx knip --reporter compact
bunx knip --reporter json
bunx knip --reporter github-actions
Filtering
bunx knip --workspace packages/client
bunx knip --exclude "test/**/*"
Debugging
bunx knip --debug
bunx knip --trace-file src/utils.ts
bunx knip --trace-export myFunction
Configuration
Configure via .knip.json or knip.config.js for custom entry points and exclusions.
Related Skills
- maintenance: Refactoring and technical debt management
- jscpd: Find duplicate code blocks
- bun: Package management for JS/TS projects