{"id":18464679,"url":"https://github.com/norfairking/template-cli","last_synced_at":"2025-04-08T08:31:16.262Z","repository":{"id":67628004,"uuid":"304875787","full_name":"NorfairKing/template-cli","owner":"NorfairKing","description":"Template Command-Line Interface","archived":false,"fork":false,"pushed_at":"2024-12-01T21:00:15.000Z","size":92,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T09:11:43.379Z","etag":null,"topics":["cli","haskell","template"],"latest_commit_sha":null,"homepage":"https://template.cs-syd.eu/template/NorfairKing/template-cli","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NorfairKing.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":"2020-10-17T12:45:09.000Z","updated_at":"2025-03-09T19:44:40.000Z","dependencies_parsed_at":"2024-05-13T14:00:57.084Z","dependency_job_id":"bbb29a97-0f30-4f3c-b5fc-b38fdbe9307c","html_url":"https://github.com/NorfairKing/template-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NorfairKing%2Ftemplate-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NorfairKing%2Ftemplate-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NorfairKing%2Ftemplate-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NorfairKing%2Ftemplate-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NorfairKing","download_url":"https://codeload.github.com/NorfairKing/template-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247804419,"owners_count":20998976,"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":["cli","haskell","template"],"created_at":"2024-11-06T09:10:44.620Z","updated_at":"2025-04-08T08:31:15.837Z","avatar_url":"https://github.com/NorfairKing.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CLI Template\n\nThis is a template implementation of a command-line tool.\nIt features complete option parsing, like in [template-optparse](https://github.com/NorfairKing/template-optparse) as well as command handlers, testing and best-practices.\n\n* Haskell code for a multi-command CLI tool\n* Per-command integration test\n* End-to-end test\n* Option parsing \u0026 Option parsing tests\n* Cabal build\n* Stack build\n* Nix build\n* Statically-linked nix build\n* Coverage report\n* Weeder check\n* Flake-based CI\n* Pre-commit hooks\n\n## License\n\nThis template is **not** free to use.\nSee https://template.cs-syd.eu/template/NorfairKing/template-cli for more information.\n\nCopyright (c) 2020-2024 Tom Sydney Kerckhove.\n\nAll Rights Reserved.\n\n## Instructions\n\nTo use this template in a new project, choose the name for your project, for example `homeless-shelter`.\nThen use [template-filler](https://github.com/NorfairKing/template-filler) to use the template, like this:\n\n```\ntemplate-filler --source /path/to/this/template-cli --destination /path/to/your/homeless-shelter --find FooBar --replace HomelessShelter\n```\n\n### Template overview\n\nThere is a single haskell package in `fooBar-cli`.\nIt contains the following structure:\n\n- The entry point in `Foo.Bar.Cli`\n- Option parsing in `Foo.Bar.Cli.OptParse`\n- The (read-only) environment and related functions in `Foo.Bar.Cli.Env`\n- Individual commands in `Foo.Bar.Cli.\u003ccommand\u003e`. There is an example in `Foo.Bar.Cli.Commands.Greet`\n\n### OptParse\n\nThe option parsing is based on [the option parsing template](https://github.com/NorfairKing/template-optparse).\nIt is included in this template so you will not need to also buy the option parsing template.\n\nFor more information about how to use the option parsing, follow the instructions in `template-cli/src/Foo/Bar/Cli/OptParse.hs`.\n\n### Nix build\n\nIf you don't need a nix build, remove these files:\n\n```\nrm -rf *.nix nix .github/workflows/nix.yaml\n```\n\nIn `nix/nixpkgs-version.nix`, we pin a `nixpkgs` commit.\nIn `nix/pkgs.nix` we define our own 'version' of the `nixpkgs` by adding our own overlays.\nThe project overlay is defined in `nix/overlay.nix`.\n\nSee the instructions in `nix/overlay.nix` for more details.\n\n### CI\n\nCI is set up for both a stack build and a nix build.\nSee `.github/workflows` for more details.\n\nThe stack build should \"just work\".\n\nFor the nix build to work, there is a manual step that you need to go through:\nFirst, make a cachix cache at cachix.org.\nPut its name in the right places within `.github/workflows/nix.yaml`.\nThen put its signing key in the 'Secrets' part of your repository on github.\n\n### Workflow examples\n\n#### Adding a command\n\n1. Add the new command's option parsing in the `Foo.Bar.Cli.OptParse` module according to the instructions within.\n\n2. Add a `Foo.Bar.Cli.Command.\u003cCommandName\u003e` module with a function as follows:\n\n   ```\n   commandName :: CommandNameSettings -\u003e C ()\n   ```\n\n3. Add a case to the `dispatch` function in `Foo.Bar.Cli`.\n4. Add tests in `Foo.Bar.Cli.Command.\u003cCommandName\u003eSpec`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnorfairking%2Ftemplate-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnorfairking%2Ftemplate-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnorfairking%2Ftemplate-cli/lists"}