ts-auto-types for VS Code
Generate TypeScript types from JSON without leaving the editor.
A VS Code extension for ts-auto-types, the smart TypeScript type generator. Select JSON, generate types in seconds — no configuration required.
Features
✨ Smart Type Generation — Automatically detects optional fields, nullable unions, string-literal unions, and more.
🔧 No Configuration by Default — Works perfectly on real-world JSON without setup.
🎯 Fast and Local — Instant results, your data never leaves your machine.
Commands
ts-auto-types: Generate from Selection
- Select JSON text in any file (or use the whole document if nothing is selected)
- Run from the Command Palette (
Ctrl+Shift+P) or right-click in the editor
- Generated TypeScript opens in a new, unsaved document beside your JSON
ts-auto-types: Generate from JSON File
- Right-click a
.json file in the Explorer
- Generates a sibling
<name>.ts file automatically
- You'll be prompted to confirm before overwriting existing files
Requirements
- VS Code 1.85+
- That's all! The generator is bundled with the extension.
Features Inherited from ts-auto-types
- ✅ Union & Optional Detection — Handles
string | null and optional fields perfectly
- ✅ Smart Deduplication — Reuses identical structures, no redundant interfaces
- ✅ Deep Nesting Support — Works with complex nested objects
- ✅ Real-World Data — Designed for actual API responses, databases, and configs
See the ts-auto-types documentation for more details.
Known Limitations
- Configuration overrides (
literalFields, freeformFields, etc.) are only available via the CLI or programmatic API — not exposed in the extension UI yet
- Zod schema generation is planned but not yet available in the extension
Changelog
See CHANGELOG.md for release notes.