{"id":15651285,"url":"https://github.com/borkdude/specter-cli","last_synced_at":"2025-04-30T18:43:41.610Z","repository":{"id":142283380,"uuid":"382322521","full_name":"borkdude/specter-cli","owner":"borkdude","description":"A native Specter CLI, compiled with GraalVM native-image and executed by SCI.","archived":false,"fork":false,"pushed_at":"2021-07-03T13:51:27.000Z","size":25,"stargazers_count":34,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-02-25T10:22:59.207Z","etag":null,"topics":["clojure","graalvm","graalvm-native-image"],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/borkdude.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},"funding":{"github":"borkdude"}},"created_at":"2021-07-02T11:16:27.000Z","updated_at":"2024-05-31T07:57:31.000Z","dependencies_parsed_at":"2024-01-30T01:59:35.677Z","dependency_job_id":"78908d40-c520-4fee-8f8b-dc87e10d9498","html_url":"https://github.com/borkdude/specter-cli","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borkdude%2Fspecter-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borkdude%2Fspecter-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borkdude%2Fspecter-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borkdude%2Fspecter-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/borkdude","download_url":"https://codeload.github.com/borkdude/specter-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242685799,"owners_count":20169240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["clojure","graalvm","graalvm-native-image"],"created_at":"2024-10-03T12:37:48.467Z","updated_at":"2025-03-09T11:31:19.090Z","avatar_url":"https://github.com/borkdude.png","language":"Clojure","readme":"# Specter CLI\n\nAn native CLI that uses [Specter](https://github.com/redplanetlabs/specter) to transform EDN from stdin.\n\nThis CLI is compiled with GraalVM `native-image` and executed using [SCI](https://github.com/borkdude/sci).\n\n## Download\n\nYou can get pre-built binaries for macOS and linux under\n[Releases](https://github.com/borkdude/specter-cli/releases). If your OS is not\nyet supported, you can try [building](#build) the CLI yourself.\n\n## Usage\n\nCurrently the CLI accepts one argument, `-e`, that represents a Clojure\nexpression. The public vars from `com.rpl.specter` are referred\nautomatically. The question mark variable is bound to EDN from stdin.\n\n``` clojure\n$ echo '{:a {:aa 1} :b {:ba -1 :bb 2}}' | ./specter -e '(transform [MAP-VALS MAP-VALS] inc ?)'\n{:a {:aa 2}, :b {:ba 0, :bb 3}}\n```\n\n## Status\n\nFor now this is mostly a proof of concept to see if I could get Specter working\nwithin the contect of SCI and `native-image` (see\n[this](https://github.com/borkdude/sci/issues/370) issue).\n\n## Implementation details\n\nThe configuration contains a number of interesting tweaks:\n\n- A patch for the `com.rpl.specter.impl/closed-source` function which originally\n  uses `clojure.core/eval`, which doesn't work in native images. This is\n  replaced by `sci/eval-form`.\n- A patch for the `com.rpl.specter/path` macro which originally uses\n  `clojure.core/intern` as a side effect during macro-expansion. This is\n  replaced by `sci.core/intern`.\n\nFor GraalVM we need to provide a reflection config that contains\n`clojure.lang.Equiv/equals` since the `path` macro generates code which does\ninterop on this class and this macro is expanded at runtime inside the SCI\ncontext. We also need to add `clojure.lang.Util` to SCI's `:classes` option for\nthe same reason.\n\n## Build\n\nSet `GRAALVM_HOME` to your local GraalVM install.\nRun `script/build`.\n\n## License\n\nCopyright © 2021 Michiel Borkent\n\nThis Specter CLI is licensed under Apache License v2.0, same as Specter. See\nLICENSE.\n","funding_links":["https://github.com/sponsors/borkdude"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborkdude%2Fspecter-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborkdude%2Fspecter-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborkdude%2Fspecter-cli/lists"}