{"id":19573954,"url":"https://github.com/hexresearch/config-app","last_synced_at":"2026-05-15T10:35:35.250Z","repository":{"id":99625931,"uuid":"95542308","full_name":"hexresearch/config-app","owner":"hexresearch","description":"Creates CLI-apps with config files in yaml format","archived":false,"fork":false,"pushed_at":"2017-07-18T07:50:46.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-01-09T03:56:56.747Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hexresearch.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}},"created_at":"2017-06-27T09:36:30.000Z","updated_at":"2017-07-05T15:04:42.000Z","dependencies_parsed_at":"2023-04-06T18:16:32.879Z","dependency_job_id":"f2d9fb06-ab11-4fb9-b449-301c25bdb651","html_url":"https://github.com/hexresearch/config-app","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexresearch%2Fconfig-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexresearch%2Fconfig-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexresearch%2Fconfig-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexresearch%2Fconfig-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hexresearch","download_url":"https://codeload.github.com/hexresearch/config-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240840106,"owners_count":19866168,"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":[],"created_at":"2024-11-11T06:37:07.680Z","updated_at":"2026-05-15T10:35:30.219Z","avatar_url":"https://github.com/hexresearch.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# config-app\n\nCreates CLI-apps with config files in yaml format.\nThe app has only one field `conf`:\n\n~~~\n\u003e app-name --conf config.yaml\n~~~\n\nIt reads the data from the YAML-file. If the file is missing it tires\nto find it at the directory `$(HOME)/.{app-name}/$({APP_NAME}_ENV)/config.yaml`\n\nAn example:\n\n~~~haskell\n{-# Language\n          TemplateHaskell\n        , DeriveDataTypeable\n        , DeriveGeneric #-}\nmodule Main where\n\nimport Data.Data\nimport GHC.Generics\n\nimport System.ConfigApp\n\ndata Config = Config {\n      appFieldA :: !String\n    , appFieldB :: !Int\n  } deriving (Show,Eq,Generic,Data)\n\n$(deriveFromJSON defaultOptions ''Config)\n\nmain = configApp desc runConfig\n  where\n    desc = AppDesc {\n                appName = \"echo-config\"\n              , appDesc = \"An app to echo parsed YAML-files\"\n            }\n\nrunConfig :: Config -\u003e IO ()\nrunConfig = print\n~~~\n\nTo run:\n\n~~~\n\u003e echo-config --conf config.yaml\n~~~\n\nConfig file contains fields with stripped prefix:\n\n~~~yaml\nfieldA:  'first'\nfieldB:  2\n~~~\n\n## Using custom CLI-arguments\n\nThe function `configApp` uses only one argument `--conf` if it's not enough\nwe can use more generic function. To use custom arguments there is a function:\n\n~~~haskell\nconfigAppWith :: (MonadIO m, Data config, FromJSON config)\n  =\u003e Parser args\n  -\u003e AppDesc -\u003e (args -\u003e config -\u003e m ()) -\u003e m ()\n~~~\n\nIt's almost the same as `configApp` but it also takes in an Parser for the rest arguments.\nAnd the callback `runConfig` now takes parsed result as the firt argument.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexresearch%2Fconfig-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhexresearch%2Fconfig-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexresearch%2Fconfig-app/lists"}