{"id":16099037,"url":"https://github.com/hellerve/cli","last_synced_at":"2026-03-18T17:54:26.262Z","repository":{"id":79626195,"uuid":"51288701","full_name":"hellerve/cli","owner":"hellerve","description":"A composable CLI library for zepto","archived":false,"fork":false,"pushed_at":"2020-01-29T16:54:50.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-06T04:50:06.345Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hellerve.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2016-02-08T09:26:33.000Z","updated_at":"2023-10-02T12:28:21.000Z","dependencies_parsed_at":"2023-03-05T20:45:40.537Z","dependency_job_id":null,"html_url":"https://github.com/hellerve/cli","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/hellerve/cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellerve%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellerve%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellerve%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellerve%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hellerve","download_url":"https://codeload.github.com/hellerve/cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellerve%2Fcli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29037478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T06:39:36.383Z","status":"ssl_error","status_checked_at":"2026-02-03T06:39:32.787Z","response_time":96,"last_error":"SSL_read: 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-10-09T18:25:29.609Z","updated_at":"2026-02-03T07:31:41.624Z","avatar_url":"https://github.com/hellerve.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# cli\n\nA simple CLI library for Carp.\n\n```clojure\n(load \"https://veitheller.de/git/carpentry/cli@master\")\n\n(defn main []\n  (let [p (=\u003e (CLI.new @\"My super cool tool!\")\n              (CLI.add \u0026(CLI.int \"flag\" \"f\" \"my flag\" true))\n              (CLI.add \u0026(CLI.str \"thing\" \"t\" \"my thing\" false @\"hi\" \u0026[@\"a\" @\"b\" @\"hi\"])))]\n    (match (CLI.parse \u0026p)\n      (Result.Success flags)\n        (println* \u0026(str \u0026(Map.get \u0026flags \"flag\")) \" \" \u0026(str \u0026(Map.get \u0026flags \"thing\")))\n      (Result.Error msg) (do (IO.errorln \u0026msg) (CLI.usage \u0026p)))))\n```\n\n## Installation\n\n```clojure\n(load \"https://veitheller.de/git/carpentry/cli@master\")\n```\n\n## Usage\n\n`CLI` should be built using combinators, as in the example above. It has, as of\nnow, three option types: integrals (longs), floating point numbers (doubles),\nand strings. They can be built using `CLI.int`, `CLI.float`, and `CLI.str`,\nrespectively. Their structure is always the same:\n\n```clojure\n(CLI.int \u003clong\u003e \u003cshort\u003e \u003cdescription\u003e \u003crequired?\u003e)\n; or\n(CLI.int \u003clong\u003e \u003cshort\u003e \u003cdescription\u003e \u003crequired?\u003e \u003cdefault\u003e)\n; or\n(CLI.int \u003clong\u003e \u003cshort\u003e \u003cdescription\u003e \u003crequired?\u003e \u003cdefault\u003e \u003coptions-array\u003e)\n```\n\nYou’ll have to set a default if you want to specify options, although you can\nset it to `(Maybe.Nothing)` if you want to make sure that it has to be set\nmanually.\n\nOnce you’re done building your flag structure, you can run `CLI.parse`. It\nwill not abort the program on error, instead it will tell you what went wrong\nin a `Result.Error`. If it succeeds, the `Result.Success` contains a `Map` from\nthe long flag name to the value (the values are `Maybe`s, since they might be\noptional arguments.\n\n\u003chr/\u003e\n\nHave fun!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellerve%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhellerve%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellerve%2Fcli/lists"}