{"id":18140691,"url":"https://github.com/simonw/llm-jq","last_synced_at":"2026-01-14T06:57:16.335Z","repository":{"id":259644969,"uuid":"879120642","full_name":"simonw/llm-jq","owner":"simonw","description":"Write and execute jq programs with the help of LLM","archived":false,"fork":false,"pushed_at":"2024-10-27T17:35:32.000Z","size":20,"stargazers_count":180,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-28T11:27:36.377Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonw.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},"funding":{"github":"simonw"}},"created_at":"2024-10-27T03:18:09.000Z","updated_at":"2025-09-11T00:38:17.000Z","dependencies_parsed_at":"2024-10-28T15:48:44.249Z","dependency_job_id":null,"html_url":"https://github.com/simonw/llm-jq","commit_stats":null,"previous_names":["simonw/llm-jq"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/simonw/llm-jq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonw%2Fllm-jq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonw%2Fllm-jq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonw%2Fllm-jq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonw%2Fllm-jq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonw","download_url":"https://codeload.github.com/simonw/llm-jq/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonw%2Fllm-jq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-01T16:02:28.295Z","updated_at":"2026-01-14T06:57:16.320Z","avatar_url":"https://github.com/simonw.png","language":"Python","funding_links":["https://github.com/sponsors/simonw"],"categories":["Python"],"sub_categories":[],"readme":"# llm-jq\n\n[![PyPI](https://img.shields.io/pypi/v/llm-jq.svg)](https://pypi.org/project/llm-jq/)\n[![Changelog](https://img.shields.io/github/v/release/simonw/llm-jq?include_prereleases\u0026label=changelog)](https://github.com/simonw/llm-jq/releases)\n[![Tests](https://github.com/simonw/llm-jq/actions/workflows/test.yml/badge.svg)](https://github.com/simonw/llm-jq/actions/workflows/test.yml)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/llm-jq/blob/main/LICENSE)\n\nWrite and execute jq programs with the help of LLM\n\nSee [Run a prompt to generate and execute jq programs using llm-jq](https://simonwillison.net/2024/Oct/27/llm-jq/) for background on this project.\n\n## Installation\n\nInstall this plugin in the same environment as [LLM](https://llm.datasette.io/).\n```bash\nllm install llm-jq\n```\n## Usage\n\nPipe JSON directly into `llm jq` and describe the result you would like:\n\n```bash\ncurl -s https://api.github.com/repos/simonw/datasette/issues | \\\n  llm jq 'count by user.login, top 3'\n```\nOutput:\n```json\n[\n  {\n    \"login\": \"simonw\",\n    \"count\": 11\n  },\n  {\n    \"login\": \"king7532\",\n    \"count\": 5\n  },\n  {\n    \"login\": \"dependabot[bot]\",\n    \"count\": 2\n  }\n]\n```\n```\ngroup_by(.user.login) | map({login: .[0].user.login, count: length}) | sort_by(-.count) | .[0:3]\n```\nThe JSON is printed to standard output, the jq program is printed to standard error.\n\nOptions:\n\n- `-s/--silent`: Do not print the jq program to standard error\n- `-o/--output`: Output just the jq program, do not run it\n- `-v/--verbose`: Show the prompt sent to the model and the response\n- `-m/--model X`: Use a model other than the configured LLM default model\n- `-l/--length X`: Use a length of the input other than 1024 as the example\n\nBy default, the first 1024 bytes of JSON will be sent to the model as an example along with your description. You can use `-l` to send more or less example data.\n\n## Development\n\nTo set up this plugin locally, first checkout the code. Then create a new virtual environment:\n```bash\ncd llm-jq\npython -m venv venv\nsource venv/bin/activate\n```\nNow install the dependencies and test dependencies:\n```bash\nllm install -e '.[test]'\n```\nTo run the tests:\n```bash\npython -m pytest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonw%2Fllm-jq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonw%2Fllm-jq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonw%2Fllm-jq/lists"}