{"id":26769889,"url":"https://github.com/bbuck/draconic","last_synced_at":"2025-10-10T08:36:36.914Z","repository":{"id":57491812,"uuid":"120125538","full_name":"bbuck/draconic","owner":"bbuck","description":"A small DSL/Framework for building advanced command line applications in Elixir.","archived":false,"fork":false,"pushed_at":"2018-03-26T03:09:44.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-16T00:19:55.316Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/bbuck.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}},"created_at":"2018-02-03T20:09:00.000Z","updated_at":"2020-11-26T00:02:16.000Z","dependencies_parsed_at":"2022-08-30T04:00:11.770Z","dependency_job_id":null,"html_url":"https://github.com/bbuck/draconic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bbuck/draconic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuck%2Fdraconic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuck%2Fdraconic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuck%2Fdraconic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuck%2Fdraconic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbuck","download_url":"https://codeload.github.com/bbuck/draconic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuck%2Fdraconic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003276,"owners_count":26083555,"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-10T02:00:06.843Z","response_time":62,"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":[],"created_at":"2025-03-28T22:46:19.742Z","updated_at":"2025-10-10T08:36:36.872Z","avatar_url":"https://github.com/bbuck.png","language":"Elixir","readme":"# Draconic\n\n[![docs](https://img.shields.io/badge/docs-hex.pm-blue.svg)](https://hexdocs.pm/draconic/api-reference.html) ![status active](https://img.shields.io/badge/status-active-green.svg)\n\nDraconic is a DSL for building command line programs. It allows you to define your\nCLI via simplistic macro functions that get compiled into simple modules used at \nrun time to execute the desired command users enter. It's built on top of the\nbuilt in `OptionParser` so it's flag definitions are a remnant of those supported\nby `OptionParser`. Although the goal was to unify aspects of an option flag as \nsingular unit.\n\nWith Draconic commands are defined as their own modules, and as behaviors you \njust implement the run method that will be invoked if the command is given.\nAssociating these commands to a program is a simple call to a macro passing in the\nmodule defining the command.\n\nCommands in Draconic function like a tree, supporting nested (or \"sub\") commands\nwith their own set of flags. Flags are parsed from top to bottom, following the\npath of commands, so global flags are parsed, the flags for the first command,\nthe second and down to the nth. So the lowest command executed (the only one the\n`run` method will be called for) has access to all flags defined before it.\n\n#### Examples\n\nDefine a program.\n\n```elixir\ndefmodule CSVParser.CLI do\n  use Draconic.Program\n\n  alias CSVParser.CLI.Commands\n\n  name \"awesome\"\n  \n  command Commands.Mapper\n  command Commands.Lister\nend\n```\n\nConfigure your escipt program.\n\n```elixir\ndefmodule CSVParser.MixProject do\n  # ...\n  def escript do\n    [\n      main_module: CSVParser.CLI\n    ]\n  end\n  # ...\nend\n```\n\nThen just execute your program!\n\n```bash\ncsv_parser list --input example.csv\n```\n\n## Installation\n\nDraconic can be installed from Hex by adding `draconic` to your list of \ndependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:draconic, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n## Roadmap\n\n - [ ] Options for `command` macro\n   - [ ] Override command name\n   - [ ] Override flag defaults\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbuck%2Fdraconic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbuck%2Fdraconic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbuck%2Fdraconic/lists"}