Usage
Why type-tune?
Move shared declarations without manually chasing every import and barrel export.
The problem
Shared types often begin next to the first feature that needs them. Later, API code, UI, tests, and application state all import the same declaration from a file that no longer feels like the right home.
The hard part is not choosing a destination. It is moving the declaration without missing an import, breaking a barrel export, or losing a local type dependency. type-tune handles that mechanical work while leaving the decision in a reviewable plan.
How it differs from related tools
type-tune is a focused refactoring tool, not a dead-code detector or a general-purpose codemod framework. Its input is a live exported type or interface; its output is a reviewed, validated move.
| Tool or category | Best at | Typical action |
|---|---|---|
| Knip and dead-code tools | Finding unused files, dependencies, and exports | Report or remove code that can disappear |
| IDE refactors | Moving one declaration you have already chosen | Perform an interactive, editor-driven move |
| Codemod toolkits | Building custom source transformations | Provide AST matching and rewrite primitives |
| type-tune | Finding live shared types that need a better home | Plan, move, update imports, validate, and roll back on failure |
Using type-tune with Knip
type-tune may leave a type-only compatibility re-export at the original module path. This protects star barrels and consumers outside the selected TypeScript project, but Knip may correctly see that old-path export as unused by the files it analyzed.
Keep the re-export when the old path is still a supported public surface. In that case,
Knip supports marking the export with @public; see its JSDoc and TSDoc tag guidance . Remove the compatibility export only after framework builds and external consumers confirm
that nothing still relies on the old path. Review this case before running Knip auto-fix for
unused exported types.
Current scope
type-tune analyzes exported type aliases and interfaces in .ts and
.tsx files loaded from one tsconfig.json. .mts and
.cts files are not scanned. Run the CLI separately for each package in a
monorepo. Installation and platform support are in
Getting started .