UNIX-style JSON Structure Extractor — Collapse arrays and truncate strings for human/LLM readability.
Keywords: JSON schema extractor, JSON structure viewer, JSON skeleton, reduce JSON for LLM, JSON minifier, JSON simplifier, production JSON analyzer, API response structure, JSON to schema, large JSON viewer
- 🚀 Single Binary — Zero dependencies, ~700KB static executable
- 📦 Array Collapse — Retain only the first N elements of arrays
- ✂️ String Truncation — Automatically truncate long strings
- 🔧 UNIX Philosophy — stdin/stdout compatible, composable with other tools
- 🎯 LLM Ready — Output optimized for AI/human comprehension
Download from GitHub Releases.
| Platform | Binary |
|---|---|
| Windows x64 | jsonskim-windows-x86_64.exe |
| Linux x64 | jsonskim-linux-x86_64 |
| macOS x64 | jsonskim-darwin-x86_64 |
| macOS ARM | jsonskim-darwin-aarch64 |
cargo install --path .# Read from file
jsonskim data.json
# Read from stdin
cat huge_production_data.json | jsonskim
# Pipe from curl
curl -s https://api.example.com/data | jsonskimUsage: jsonskim [OPTIONS] [FILE]
Arguments:
[FILE] Input JSON file (reads from stdin if not provided)
Options:
-l, --limit <N> Array collapse limit: retain first N items [default: 1]
-s, --string-limit <N> Truncate strings longer than N chars [default: 64, 0 = no limit]
-c, --compact Output compact JSON instead of pretty-printed
-h, --help Print help
-V, --version Print version
# Extract structure with default settings
jsonskim production_log.json
# Keep 2 array samples, truncate strings at 100 chars
jsonskim -l 2 -s 100 data.json
# Compact output for LLM consumption
cat api_response.json | jsonskim -c
# No string truncation
jsonskim -s 0 config.jsonInput (imagine millions of users):
{
"status": "success",
"users": [
{"id": 1, "name": "Alice", "bio": "AAAA...1000 chars..."},
{"id": 2, "name": "Bob", "bio": "BBBB...1000 chars..."},
"... 10000 more users ..."
],
"logs": ["Log 1", "Log 2", "... 5000 more logs ..."]
}Output (jsonskim -l 1 -s 20):
{
"status": "success",
"users": [
{
"id": 1,
"name": "Alice",
"bio": "AAAAAAAAAAAAAAAAAAAA...<truncated_len_1000>"
}
],
"logs": ["Log 1"]
}| Scenario | Command |
|---|---|
| LLM Context Preparation | cat api.json | jsonskim -c | clipboard |
| API Schema Discovery | curl api.example.com | jsonskim |
| Log Structure Analysis | jsonskim -l 3 huge_log.json |
| Documentation Generation | jsonskim -s 0 sample.json > schema.json |
Use jsonskim via MCP (Model Context Protocol):
{
"mcpServers": {
"jsonskim": {
"command": "npx",
"args": ["-y", "jsonskim-mcp"]
}
}
}See mcp/README.md for details.
SEO: What problems does jsonskim solve?
- How to extract JSON schema from data?
- How to view large JSON file structure?
- How to reduce JSON size for LLM context?
- How to collapse arrays in JSON?
- How to truncate long strings in JSON?
- JSON structure extractor for AI/ChatGPT
- View production JSON without loading entire file
- Extract JSON skeleton for documentation