{"id":29052775,"url":"https://github.com/ndevreeze/cmdline","last_synced_at":"2025-10-08T20:26:11.870Z","repository":{"id":62433739,"uuid":"349991635","full_name":"ndevreeze/cmdline","owner":"ndevreeze","description":"Small wrapper around command line parsing with clojure.tools.cli","archived":false,"fork":false,"pushed_at":"2025-08-20T20:48:14.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-20T22:31:28.216Z","etag":null,"topics":["clojure","cmdline"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ndevreeze.png","metadata":{"files":{"readme":"README.org","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}},"created_at":"2021-03-21T12:27:13.000Z","updated_at":"2025-08-20T20:48:17.000Z","dependencies_parsed_at":"2024-03-27T21:31:17.279Z","dependency_job_id":"0c071bba-8113-4b8b-b2ea-b49934ee61a5","html_url":"https://github.com/ndevreeze/cmdline","commit_stats":{"total_commits":14,"total_committers":2,"mean_commits":7.0,"dds":0.0714285714285714,"last_synced_commit":"ed30c49ac56c4b1be4692884f4f5afc29048ec0b"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ndevreeze/cmdline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndevreeze%2Fcmdline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndevreeze%2Fcmdline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndevreeze%2Fcmdline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndevreeze%2Fcmdline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ndevreeze","download_url":"https://codeload.github.com/ndevreeze/cmdline/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndevreeze%2Fcmdline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000654,"owners_count":26082817,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"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":["clojure","cmdline"],"created_at":"2025-06-27T00:12:46.253Z","updated_at":"2025-10-08T20:26:11.863Z","avatar_url":"https://github.com/ndevreeze.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: cmdline\n\nSmall wrapper around command line parsing with clojure.tools.cli\n* Why?\n   :PROPERTIES:\n   :CUSTOM_ID: why\n   :END:\n\nCombine named command line arguments from three sources: 1. Explicitly\ngiven on the command line. 2. Given in a user defined config file. 3.\nDefaults as given in the source code.\n\n* Installation\n   :PROPERTIES:\n   :CUSTOM_ID: installation\n   :END:\n\nLeiningen/Boot\n\n#+BEGIN_EXAMPLE\n    [ndevreeze/cmdline \"0.2.0\"]\n#+END_EXAMPLE\n\nClojure CLI/deps.edn\n\n#+BEGIN_EXAMPLE\n    ndevreeze/cmdline {:mvn/version \"0.2.0\"}\n#+END_EXAMPLE\n\n[[https://clojars.org/ndevreeze/cmdline][https://img.shields.io/clojars/v/ndevreeze/cmdline.svg]]\n\n* Usage\n   :PROPERTIES:\n   :CUSTOM_ID: usage\n   :END:\n\nRequire:\n\n#+BEGIN_EXAMPLE\n    (ns my.namespace\n      (:require [nl.nicodevreeze.cmdline :as cl]))\n            \n#+END_EXAMPLE\n\nDefine the command line options:\n\n#+BEGIN_EXAMPLE\n    (def cli-options\n      [[\"-c\" \"--config CONFIG\" \"Config file\"\n        :default \"~/.config/my-program/my-program.edn\"]\n       [\"-h\" \"--help\" \"Show this help\"]\n       [\"-p\" \"--port PORT\" \"TCP port to use\"\n        :default 1234 :parse-fn #(Integer/parseInt %)]\n       [\"-v\" \"--verbose\" \"Verbose output\"]])\n#+END_EXAMPLE\n\nDefine the worker function:\n\n#+BEGIN_EXAMPLE\n    (defn do-script\n      \"Main script\"\n      [opt arguments ctx]\n      (when (:verbose opt)\n        (output-some-more)))\n#+END_EXAMPLE\n\nSmall -main function:\n\n#+BEGIN_EXAMPLE\n    (defn -main [\u0026 args]\n      (cl/check-and-exec \"Description of script\"\n                         cli-options do-script args ctx))\n#+END_EXAMPLE\n\nCtx/context can be anything, mostly a map.\n\n* Developing\n   :PROPERTIES:\n   :CUSTOM_ID: developing\n   :END:\n\n** Testing\n    :PROPERTIES:\n    :CUSTOM_ID: testing\n    :END:\n\n#+BEGIN_EXAMPLE\n    $ lein midje\n#+END_EXAMPLE\n\nor:\n\n#+BEGIN_EXAMPLE\n    $ lein repl (or start in Cider)\n    (use 'midje.repl)\n    (autotest)\n#+END_EXAMPLE\n\n** Bugs\n    :PROPERTIES:\n    :CUSTOM_ID: bugs\n    :END:\n\n-  No known errors, see Github/issues.\n\n** API docs\n    :PROPERTIES:\n    :CUSTOM_ID: api-docs\n    :END:\n\n-  See See codox generated\n   [[https://ndevreeze.github.io/cmdline/api/index.html][API docs]].\n-  Or: https://cljdoc.org/d/ndevreeze/cmdline/0.2.0/doc/readme\n\n* Related and similar projects (libraries)\n   :PROPERTIES:\n   :CUSTOM_ID: related-and-similar-projects-libraries\n   :END:\n\n-  https://github.com/clojure/tools.cli - main library for parsing\n   options.\n\n* License\n   :PROPERTIES:\n   :CUSTOM_ID: license\n   :END:\n\nCopyright © 2021 Nico de Vreeze\n\nDistributed under the Eclipse Public License, the same as Clojure.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndevreeze%2Fcmdline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fndevreeze%2Fcmdline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndevreeze%2Fcmdline/lists"}