We’ve all stared at a schema or a complex function (especially when it's written in TypeScript) and thought... "What the heck type am I actually supposed to put here?".
To save time and keep your momentum, you slap an any type on it and promise yourself you'll "fix it later." (Spoiler alert: we rarely do).
Manually tracking down missing implicit any definitions or unannotated parameters can ruin your development flow. While paid AI extensions exist, they can be costly and frequently spam your terminal console with unreadable, messy raw string blocks.
To solve this, I built typecraft-cli ⚡ — an entirely open-source, minimal static analysis tool that scans your codebase and leverages free Hugging Face LLMs to generate accurate TypeScript annotations automatically.
Instead of cluttering your local environment, it streams suggestions straight into a neatly formatted type-checker.md file right in your workspace directory so you can reference it side-by-side with your code editor.
🚀 Key Features
- Automated Type Detection: Scans local directories to catch loose parameters and missing strict types.
- Open Source & Free AI: Leverages specialized, open-source code models via Hugging Face. No OpenAI API keys required.
- Zero Terminal Clutter: Keeps your workspace completely quiet while processing everything into clean Markdown reports.
🛠️ Quick Start
You can run it instantly using npx:
npx typecraft-cli
(Or install it globally via npm install -g typecraft-cli)
Prerequisties
Before running the tool, you'll need a Hugging Face Inference API token (it's free!) so the CLI can communicate with the open-source LLMs:
- 1. - Grab your token from your Hugging Face Settings.
- 2. - Create a .env file in the root of your project.
- 3. - Add your token like this: Code snippet
HF_TOKEN=your_actual_token
Top comments (0)