{"id":32161325,"url":"https://github.com/poscat0x04/hinit","last_synced_at":"2025-10-21T13:53:12.328Z","repository":{"id":56844354,"uuid":"323771802","full_name":"poscat0x04/hinit","owner":"poscat0x04","description":"A generic project initialization tool written in Haskell.","archived":false,"fork":false,"pushed_at":"2023-11-30T03:29:00.000Z","size":981,"stargazers_count":1,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-21T13:53:11.401Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/poscat0x04.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-12-23T01:27:36.000Z","updated_at":"2022-12-07T14:02:02.000Z","dependencies_parsed_at":"2022-09-09T04:11:22.051Z","dependency_job_id":null,"html_url":"https://github.com/poscat0x04/hinit","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/poscat0x04/hinit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poscat0x04%2Fhinit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poscat0x04%2Fhinit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poscat0x04%2Fhinit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poscat0x04%2Fhinit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poscat0x04","download_url":"https://codeload.github.com/poscat0x04/hinit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poscat0x04%2Fhinit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280272338,"owners_count":26302260,"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-21T02:00:06.614Z","response_time":58,"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-10-21T13:53:09.555Z","updated_at":"2025-10-21T13:53:12.322Z","avatar_url":"https://github.com/poscat0x04.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hinit\n\n[![Hackage](https://img.shields.io/hackage/v/hinit.svg)](http://hackage.haskell.org/package/hinit)\n\n`hi` is a generic project initialization tool that is written in Haskell. It is similar to cookiecutter in functionality.\n\n## Installation\n\nCurrently it's only possible to compile `hi` from source.\n\n### cabal\n\nAfter cloning this repository, run:\n\n```\n$ cabal install hi\n```\n\n### nix\n\nTo build `hi`, run:\n\n```\n$ nix build github:poscat0x04/hinit\n```\n\nAfter that, you could install hi to your user profile by running:\n\n```\nnix-env -i ./result ./result-data\n```\n\nIf you instead want to install `hi` as a sysetm package, you could make this repository a input of your flake and add `defaultPackage` to `systemPackages`.\n\n## Usage\n\n1. Initialize a project\n\n```\n$ hi init haskell my-project\n```\n\nwhich creates a project with the following directory structure:\n\n```\nmy-project\n├── cabal.project\n├── CHANGELOG.md\n├── hie.yaml\n├── LICENSE\n├── my-project.cabal\n├── README.md\n├── src\n└── test\n    └── Spec.hs\n```\n\n2. List all templates available\n\n```\n$ hi list\n```\n\nwhich outputs:\n\n```\n- local templates\n  • haskell\n```\n\n## Configuration\n\n### Global configuration\n\nGlobal configuration is read from `$XDG_CONFIG_HOME/hi/config.toml`. If this file is not present on your system, `hi` will ask for user inputs so that a minimal configuration can be constructed.\n\nTop-level configuration options:\n\n- `name :: string`\\\n  required, your full name, used in `LICENSE` files and some default templates\n- `github_username :: string`\\\n  required, your github username, used in some default templates\n- `email :: string`\\\n  required, your email, used in some default templates\n- `license :: string`\\\n  optional, the default license, must be a valid [SPDX license identifier](https://spdx.org/licenses/).\n- `vcs :: string`\\\n  optional, the version control tool, can by any string but `Git`, `Darcs`, `Mercurial`, `Pijul` has special meanings (`hi` will call these vcs tools after the project has been initialized)\n\nAddtionaly, default values of variables can be set under the table `[custom]`, note that the value must be either a bool or a piece of text.\n\n## Templating\n\nUnlike cookiecutter, hi uses [mustache](https://mustache.github.io/), a much simpler templating language for writing project templates. User templates are placed under `$XDG_DATA_HOME`.\n\n### Template configuration\n\nEvery template is required to have a config file `template.toml` and here are its configuration options:\n\n- `desc :: string`\\\n  optional, description for the template.\n- `ignores :: [string]`\\\n  required, ignored files, can use [globbing syntax](https://hackage.haskell.org/package/Glob-0.10.1/docs/System-FilePath-Glob.html#v:compile). Note that when judging whether a file should be ignored, it is the file's path relative the the root of the template that will be matched against the patterns specified here, not just the file name.\n- `tags :: [string]`\\\n  required, tags (duh), currently this is not being used by any command.\n- `options :: array of tables`\\\n  parameters of the template.\\\n  suboptions:\n    - `name :: string`\\\n      required, the name of the option.\n    - `desc :: string`\\\n      optional, the description for this option.\n    - `type :: string`\\\n      rquired if `default` is not set, otherwise it will be ignored completely, the type of this option, currently only supports `\"bool\"` and `\"text\"`.\n    - `default :: string | bool`\\\n      optional, the default value for this option, if this is not set then the program will ask for user input when initializing a project from this template\n- `optionals :: array of tables`\\\n  optionally ignored files, when the expression specified by `when` evaluates to true, the `ignores` field will be merged into the top-level ignored files.\\\n  suboptions:\n    - `when :: string`\\\n      required, an arbitrary boolean expression constructed from variables (must contain only alphanumeric characters), negations (`!` or `¬`), conjunctions (`\u0026` or `∧`) and disjunctions (`|` or `∨`), can have parenthesis.\n    - `ignores :: [string]`\\\n      required, see the description of the top-level `ignores` option.\n\nWhen initializing from a template, both the the file content and the file name will be read as mustache templates. After performing a substitution, the new file will be written to the corresponding location inside the project directory.\n\nYou can also take a look at [bundled templates](https://github.com/poscat0x04/hinit/tree/master/data/templates).\n\n### Special variables names\n\n`hi` will set the values for some special variables and can overwrite user configs. These names should not be used in your `options`. These special variables include:\n\n- `name`, `email`, `github_usernmae`, `license`\n- `year`, `month`, `day`, `iso8601`: system time\n- `project`: the name of the project that is trying to create.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposcat0x04%2Fhinit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposcat0x04%2Fhinit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposcat0x04%2Fhinit/lists"}