sadrazam
v0.1.8
Published
Dependency analysis CLI for JavaScript and TypeScript projects with optional AI-powered insights.
Maintainers
Readme
⚡ What is Sadrazam?
Sadrazam is a CLI tool that scans your project and tells you:
- which dependencies are unused
- which ones are misplaced or risky
- what you can safely remove or fix
👉 And if you enable AI:
it explains why, what to do next, and supports agent-friendly TOON output for automation and LLM workflows.
🚀 Quick Start
npx sadrazam .That’s it.
🧠 Example Output
❌ Unused dependency: lodash
💡 Suggested: remove
⚠️ Misplaced dependency: typescript
💡 Suggested: move to devDependenciesWith AI:
🧠 lodash is not imported anywhere in your codebase.
Removing it will reduce bundle size and install time.🎯 Why Sadrazam?
JavaScript projects accumulate dependencies over time.
- unused packages slow installs
- wrong dependencies increase risk
- messy
package.jsonhurts maintainability
Sadrazam answers one question:
👉 What can I safely remove from this project?
🔥 What Makes It Different?
Unlike traditional tools:
- detects unused dependencies AND unused files/exports
- understands monorepos and modern frameworks
- optional AI layer for real explanations (not raw output)
- safe auto-fix for
package.json
⚡ Common Use Cases
- clean up old projects
- audit dependency bloat
- prepare for production
- CI dependency checks
- monorepo hygiene
🛠️ Usage
Basic scan:
npx sadrazam .JSON output:
npx sadrazam . --reporter jsonTOON output:
npx sadrazam . --reporter toonAuto-fix:
npx sadrazam . --fix --formatTrace why something is used:
npx sadrazam . --trace typescript🧠 AI Mode (Optional)
Enable AI to get explanations and recommendations:
AI_PROVIDER=openai AI_TOKEN=your_token npx sadrazam . --aiAI will:
- explain why a dependency is unused
- suggest what action to take
- summarize cleanup steps
⚙️ Features
- unused dependency detection
- unused file + export detection
- monorepo & workspace support
- script-aware scanning
- CommonJS + modern import support
- safe auto-fix
- JSON + TOON + text output
- AI-powered insights
👉 Full feature list: https://borakilicoglu.github.io/sadrazam/features
📦 Install
npm install -g sadrazamor:
npx sadrazam .🧪 When to Use It
Run Sadrazam when:
- your project feels bloated
- you're unsure which deps are safe to remove
- you're preparing for deployment
- you're reviewing a codebase
💡 Philosophy
Sadrazam is built around a simple idea:
Keep your dependency tree clean, understandable, and safe.
AI is optional — the core tool works without it.
❤️ Support
If this tool saves you time:
⭐ Star the repo
☕ Support via GitHub Sponsors
https://github.com/sponsors/borakilicoglu
🔗 Links
- GitHub: https://github.com/borakilicoglu/sadrazam
- npm: https://www.npmjs.com/package/sadrazam
- Docs: https://borakilicoglu.github.io/sadrazam/features
