JSON to TypeScript - Interface Generator
Generate TypeScript interfaces from JSON data or API responses. Auto-type your APIs instantly. Free CLI tool for TypeScript developers.
- License 许可
- MIT
- 最近更新
- 2026-04-05
- Stars
- ★ 7
- Forks
- 1
01 前言 Front Matter
- name
- JSON to TypeScript - Interface Generator
- description
- Generate TypeScript interfaces from JSON data or API responses. Auto-type your APIs instantly. Free CLI tool for TypeScript developers.
02 资源文件 1
- 参考文档_meta.json482 B
03 SKILL.md 正文
JSON to TypeScript
Generate TypeScript interfaces from JSON. Stop writing types by hand.
Installation
npm install -g @lxgicstudios/json-to-ts
Commands
From File
npx @lxgicstudios/json-to-ts data.json
npx @lxgicstudios/json-to-ts response.json -n User
From URL
npx @lxgicstudios/json-to-ts https://api.example.com/users -n User
From Pipe
curl https://api.example.com/data | npx @lxgicstudios/json-to-ts -n ApiResponse
Output to File
npx @lxgicstudios/json-to-ts api.json -o src/types/api.ts
Example
Input JSON:
{
"id": 1,
"name": "John",
"email": "john@example.com",
"address": { "city": "NYC" },
"tags": ["dev", "ts"]
}
Output:
export interface Address {
city: string;
}
export interface Root {
id: number;
name: string;
email: string;
address: Address;
tags: string[];
}
Options
| Option | Description |
|---|---|
-n, --name |
Root interface name (default: Root) |
-o, --output |
Write to file |
-t, --type |
Use type instead of interface |
--optional |
Make all properties optional |
--no-export |
Don't add export keyword |
Features
- Nested objects become separate interfaces
- Arrays properly typed
- Mixed arrays become union types
- Fetches directly from URLs
- Handles empty arrays as
unknown[]
Common Use Cases
Type an API response:
curl https://api.github.com/users/octocat | npx @lxgicstudios/json-to-ts -n GitHubUser
Generate types for project:
npx @lxgicstudios/json-to-ts sample-response.json -o src/types/api.ts -n ApiResponse
Built by LXGIC Studios
04 同仓库更多 Skills
zyfai
Earn yield on any Ethereum wallet on Base, Arbitrum, and Plasma. Use when a user wants passive DeFi yield on their funds. Deploys a non-custodial subaccount (Safe) linked to their EOA, enables automated yield optimization, and lets them deposit/withdraw anytime.
zerion-api
暂无简介
zerion-api-skill
暂无简介
zerion-api-mcp
暂无简介
yahoo-finance-forex
Fetches real-time FOREX news and market data from Yahoo Finance for major currency pairs (EUR/USD, GBP/USD, USD/JPY, etc.). Analyzes sentiment and provides trading context.
yahoo-finance
This skill should be used when the user asks to "get stock prices", "check stock quotes", "look up earnings", "get financial data", "find trending stocks", or needs stock market data from Yahoo Finance.