{"id":51118935,"url":"https://github.com/sulthonzh/jsonl-cli","last_synced_at":"2026-06-25T00:30:33.646Z","repository":{"id":363863610,"uuid":"1261627378","full_name":"sulthonzh/jsonl-cli","owner":"sulthonzh","description":"CLI toolkit for JSON Lines — filter, select, count, stats, pretty-print JSONL from the terminal","archived":false,"fork":false,"pushed_at":"2026-06-23T02:25:36.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-23T04:13:05.083Z","etag":null,"topics":["cli","filter","json","json-lines","jsonl","pretty-print"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sulthonzh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-07T00:15:13.000Z","updated_at":"2026-06-23T02:25:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sulthonzh/jsonl-cli","commit_stats":null,"previous_names":["sulthonzh/jsonl-cli"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sulthonzh/jsonl-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fjsonl-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fjsonl-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fjsonl-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fjsonl-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sulthonzh","download_url":"https://codeload.github.com/sulthonzh/jsonl-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fjsonl-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34755061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","filter","json","json-lines","jsonl","pretty-print"],"created_at":"2026-06-25T00:30:33.496Z","updated_at":"2026-06-25T00:30:33.631Z","avatar_url":"https://github.com/sulthonzh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jsonl — CLI toolkit for JSON Lines\n\nWork with JSONL (JSON Lines / newline-delimited JSON) files directly from your terminal.\n\nMost log systems, event streams, and data pipelines emit JSONL. `jsonl` gives you a fast, pipe-friendly CLI to slice through them — no `jq` cheatsheet needed.\n\n## Install\n\n```bash\nnpm install -g jsonl-cli\n```\n\n## Usage\n\nAll commands read from **stdin** if no files are given. Pipe freely.\n\n### Pretty-print\n\n```bash\ncat logs.jsonl | jsonl pretty --color\n```\n\n### Filter\n\n```bash\n# exact match\ncat logs.jsonl | jsonl filter 'level=error'\n\n# regex\ncat logs.jsonl | jsonl filter 'message=~timeout'\n\n# numeric comparison\ncat logs.jsonl | jsonl filter 'status\u003e=400'\n```\n\nSupported operators: `=`, `!=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=`, `=~` (regex)\n\n### Select fields\n\n```bash\ncat logs.jsonl | jsonl select 'timestamp,message'\n```\n\nDot-notation for nested fields:\n\n```bash\ncat logs.jsonl | jsonl select 'user.id,user.email'\n```\n\n### Pluck (jq-like expressions)\n\n```bash\n# single field → outputs raw value\ncat logs.jsonl | jsonl pluck '.message'\n\n# nested\ncat logs.jsonl | jsonl pluck '.user.email'\n\n# multiple fields → outputs JSON object\ncat logs.jsonl | jsonl pluck '.timestamp,.level'\n```\n\n### Sort\n\n```bash\n# ascending (string sort)\ncat logs.jsonl | jsonl sort timestamp\n\n# numeric descending\ncat logs.jsonl | jsonl sort response_time --numeric --reverse\n```\n\n### Head / Tail\n\n```bash\n# first 10 records\ncat logs.jsonl | jsonl head 10\n\n# last 5 records\ncat logs.jsonl | jsonl tail 5\n```\n\n### Count records\n\n```bash\ncat logs.jsonl | jsonl count\n```\n\n### Group by field\n\n```bash\n# count records per level\ncat logs.jsonl | jsonl group level\n# {\"level\":\"error\",\"count\":23,\"percent\":4.6}\n# {\"level\":\"info\",\"count\":450,\"percent\":90.0}\n```\n\n### Rename fields\n\n```bash\ncat logs.jsonl | jsonl rename 'msg:message,ts:timestamp'\n```\n\n### Sample\n\n```bash\n# keep ~10% of records\ncat logs.jsonl | jsonl sample 0.1\n```\n\n### Unique values\n\n```bash\ncat logs.jsonl | jsonl uniq level\n```\n\n### Stats\n\n```bash\n# numeric stats for a field (includes p95)\ncat logs.jsonl | jsonl stats --field response_time\n# → {\"field\":\"response_time\",\"count\":1500,\"min\":12,\"max\":4500,\"mean\":234.5,\"median\":180,\"p95\":890,\"sum\":351750}\n```\n\n### Schema inference\n\n```bash\ncat logs.jsonl | jsonl schema\n# Infers field types, required/optional, and presence from your data\n```\n\n### Frequency distribution\n\n```bash\n# Top 5 most common values for a field\ncat logs.jsonl | jsonl freq level -n 5\n# {\"field\":\"level\",\"totalRecords\":1000,\"uniqueValues\":3,\n#  \"distribution\":[{\"value\":\"info\",\"count\":800,\"percent\":80},...]}\n```\n\n### Flatten\n\n```bash\ncat nested.jsonl | jsonl flat\n# {\"user.name\":\"Sulthon\",\"user.email\":\"test@example.com\"}\n```\n\n## Why this exists\n\nI work with JSONL files constantly — server logs, analytics exports, event streams. The usual workflow was `jq` one-liners I could never remember, or opening files in an editor and scrolling. `jsonl` gives me the 80% case in memorable commands.\n\n## Real examples\n\n```bash\n# How many errors today?\ncat production.log | jsonl filter 'level=error' | jsonl count\n\n# What unique status codes appeared?\ncat api.jsonl | jsonl uniq status\n\n# Top 5 slowest requests\ncat api.jsonl | jsonl sort response_time --numeric --reverse | jsonl head 5\n\n# Breakdown by status code\ncat api.jsonl | jsonl group status\n\n# Sample 5% of traffic for analysis\ncat traffic.jsonl | jsonl sample 0.05 \u003e sample.jsonl\n\n# Pull just the error messages\ncat logs.jsonl | jsonl filter 'level=error' | jsonl pluck '.message'\n\n# What does my data look like?\ncat logs.jsonl | jsonl schema\n\n# Most common user agents\ncat api.jsonl | jsonl freq user_agent -n 5\n```\n\n## Commands\n\n| Command | What it does |\n|---------|-------------|\n| `pretty` | Pretty-print with optional colors |\n| `filter` | Filter by field value |\n| `select` | Pick specific fields |\n| `pluck` | Extract values with dot expressions |\n| `sort` | Sort by field (asc/desc, string/numeric) |\n| `head` | Take first N records |\n| `tail` | Take last N records |\n| `count` | Count records |\n| `group` | Group by field with counts and percentages |\n| `rename` | Rename fields |\n| `sample` | Random sample |\n| `uniq` | Unique values for a field |\n| `stats` | Numeric stats (min, max, mean, median, p95) |\n| `flat` | Flatten nested objects |\n| `schema` | Infer JSON schema from data |\n| `freq` | Top-N frequency distribution |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsulthonzh%2Fjsonl-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsulthonzh%2Fjsonl-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsulthonzh%2Fjsonl-cli/lists"}