{"id":50965685,"url":"https://github.com/harehare/pkl.mq","last_synced_at":"2026-06-18T20:01:59.406Z","repository":{"id":365005252,"uuid":"1270113402","full_name":"harehare/pkl.mq","owner":"harehare","description":"A PKL Apple's configuration language parser implemented as an mq module","archived":false,"fork":false,"pushed_at":"2026-06-15T12:02:15.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-15T13:25:01.255Z","etag":null,"topics":["markdown","mq","pkl"],"latest_commit_sha":null,"homepage":"https://mqlang.org","language":null,"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/harehare.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-15T11:56:56.000Z","updated_at":"2026-06-15T12:27:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/harehare/pkl.mq","commit_stats":null,"previous_names":["harehare/pkl.mq"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/harehare/pkl.mq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fpkl.mq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fpkl.mq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fpkl.mq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fpkl.mq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harehare","download_url":"https://codeload.github.com/harehare/pkl.mq/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fpkl.mq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34505423,"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-18T02:00:06.871Z","response_time":128,"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":["markdown","mq","pkl"],"created_at":"2026-06-18T20:01:55.832Z","updated_at":"2026-06-18T20:01:59.400Z","avatar_url":"https://github.com/harehare.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003epkl.mq\u003c/h1\u003e\n\nA [PKL](https://pkl-lang.org/) (Apple's configuration language) parser implemented as an [mq](https://github.com/harehare/mq) module.\n\n## Features\n\n- Line comments (`//`) and block comments (`/* */`)\n- Triple-quoted strings (`\"\"\"...\"\"\"`)\n- Type annotations (`key: Type = value`)\n- Object blocks (`key { ... }`)\n- `List(...)` and `Set(...)` literals\n- `Mapping { [\"key\"] = value }` literals\n- Negative numbers\n- Module directives (`amends`, `extends`, `module`, `import`) are skipped\n- Converts to JSON or Markdown tables\n\n## Installation\n\nCopy `pkl.mq` to your mq module directory, or place it anywhere and reference it with `-L`.\n\n```sh\ncp pkl.mq ~/.local/mq/config/\n```\n\n### HTTP Import (no local installation needed)\n\nIf `mq` was built with the `http-import` feature, you can import directly from GitHub without any local setup:\n\n```sh\nmq -I raw 'import \"github.com/harehare/pkl.mq\" | pkl::pkl_parse(.)' config.pkl\n```\n\nPin to a specific release with `@vX.Y.Z`:\n\n```sh\nmq -I raw 'import \"github.com/harehare/pkl.mq@v0.1.0\" | pkl::pkl_parse(.)' config.pkl\n```\n\n## Usage\n\n```sh\nmq -L /path/to/modules -I raw \\\n  'include \"pkl\" | pkl_parse(.)' config.pkl\n```\n\nIf you copied it to the mq built-in module directory:\n\n```sh\nmq -I raw 'include \"pkl\" | pkl_parse(.)' config.pkl\n```\n\n## API\n\n### `pkl_parse(input)`\n\nParses a PKL string and returns the corresponding mq value (dict).\n\n| Input type | Output |\n|---|---|\n| String | Parsed PKL properties as a dict |\n\n### `pkl_stringify(data)`\n\nConverts an mq value back to a PKL string.\n\n| Input type | Output |\n|---|---|\n| Dict | PKL property assignments |\n| Other | PKL literal representation |\n\n### `pkl_to_json(data)`\n\nConverts an mq value to a JSON string.\n\n| Input type | Output |\n|---|---|\n| Any | JSON string |\n\n### `pkl_to_markdown_table(data)`\n\nConverts an mq value to a Markdown table.\n\n| Input type | Output |\n|---|---|\n| Dict | Key/Value table |\n| Array of dicts | Columns from first element's keys |\n| Scalar | Single-column Value table |\n\n## Example\n\nGiven `config.pkl`:\n\n```pkl\namends \"pkl:base\"\n\n// Application configuration\nname = \"my-app\"\nversion: String = \"1.0.0\"\nport = 8080\ndebug = false\n\ndatabase {\n  host = \"localhost\"\n  port = 5432\n}\n\ntags = List(\"production\", \"stable\")\n\nenv = Mapping {\n  [\"LOG_LEVEL\"] = \"info\"\n  [\"MAX_CONN\"] = \"100\"\n}\n```\n\n```sh\nmq -L . -I raw 'include \"pkl\" | pkl_parse(.) | .[\"name\"]' config.pkl\n# =\u003e \"my-app\"\n\nmq -L . -I raw 'include \"pkl\" | pkl_parse(.) | pkl_to_json(.)' config.pkl\n# =\u003e {\"name\":\"my-app\",\"version\":\"1.0.0\",\"port\":8080,...}\n\nmq -L . -I raw 'include \"pkl\" | pkl_parse(.) | pkl_to_markdown_table(.)' config.pkl\n# =\u003e | Key | Value |\n#    | --- | --- |\n#    | name | my-app |\n#    ...\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharehare%2Fpkl.mq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharehare%2Fpkl.mq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharehare%2Fpkl.mq/lists"}