knip
Knip
Finds unused files, dependencies, and exports in TypeScript/JavaScript projects.
Usage
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
bunx knip --reporter compact # Compact output
bunx knip --reporter json # JSON for tooling
bunx knip --reporter github-actions # CI annotations
Filtering
bunx knip --workspace packages/client # Specific workspace
bunx knip --exclude "test/**/*" # Exclude patterns
Debugging
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.
Related Skills
- maintenance: Refactoring and technical debt management
- jscpd: Find duplicate code blocks
- bun: Package management for JS/TS projects
More from knoopx/pi
podman
Manages containers, builds images, configures pods and networks with Podman. Use when running containers, creating Containerfiles, grouping services in pods, or managing container resources.
122jujutsu
Manages version control with Jujutsu (jj), including rebasing, conflict resolution, and Git interop. Use when tracking changes, navigating history, squashing/splitting commits, or pushing to Git remotes.
117nix-flakes
Creates reproducible builds, manages flake inputs, defines devShells, and builds packages with flake.nix. Use when initializing Nix projects, locking dependencies, or running nix build/develop commands.
54scraping
Fetches web pages, parses HTML with CSS selectors, calls REST APIs, and scrapes dynamic content. Use when extracting data from websites, querying JSON APIs, or automating browser interactions.
48jscpd
Finds duplicate code blocks and analyzes duplication metrics across files. Use when identifying copy-pasted code, measuring technical debt, or preparing for refactoring.
45yt-dlp
Downloads videos from YouTube and other sites using yt-dlp. Use when downloading videos, extracting metadata, or batch downloading multiple files.
42