{"id":13503026,"url":"https://github.com/vmchale/project-init","last_synced_at":"2025-04-05T08:06:54.927Z","repository":{"id":44735741,"uuid":"89826593","full_name":"vmchale/project-init","owner":"vmchale","description":"Project templates in rust","archived":false,"fork":false,"pushed_at":"2023-09-11T13:20:54.000Z","size":79802,"stargazers_count":139,"open_issues_count":10,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T07:06:13.765Z","etag":null,"topics":["command-line-tool","cookiecutter","elm","elm-lang","haskell","idris","miso","mustache","rust","template-project"],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/vmchale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2017-04-30T03:17:53.000Z","updated_at":"2025-01-25T20:18:04.000Z","dependencies_parsed_at":"2024-01-12T18:49:27.072Z","dependency_job_id":null,"html_url":"https://github.com/vmchale/project-init","commit_stats":{"total_commits":633,"total_committers":5,"mean_commits":126.6,"dds":"0.40126382306477093","last_synced_commit":"722b36504c554814c3cdfe374810d789527ad872"},"previous_names":[],"tags_count":142,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmchale%2Fproject-init","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmchale%2Fproject-init/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmchale%2Fproject-init/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmchale%2Fproject-init/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vmchale","download_url":"https://codeload.github.com/vmchale/project-init/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305934,"owners_count":20917208,"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":["command-line-tool","cookiecutter","elm","elm-lang","haskell","idris","miso","mustache","rust","template-project"],"created_at":"2024-07-31T22:02:33.936Z","updated_at":"2025-04-05T08:06:54.903Z","avatar_url":"https://github.com/vmchale.png","language":"Rust","readme":"# project init (pi)\n\n[![Build Status](https://travis-ci.org/vmchale/project-init.svg?branch=master)](https://travis-ci.org/vmchale/project-init)\n[![](https://img.shields.io/crates/d/project-init.svg)](https://crates.io/crates/project-init)\n[![Windows build status](https://ci.appveyor.com/api/projects/status/github/vmchale/project-init?svg=true)](https://ci.appveyor.com/project/vmchale/project-init)\n\n`pi` is a command-line utility to initialize projects. It is written in rust.\n\nIt is intended to provide something like \n[cookiecutter](https://github.com/audreyr/cookiecutter), but faster.\n\nReasons to use pi:\n  - You want to automate the process of starting a new project, for *all* your\n    projects.\n  - You want project initialization that's *quick*\n\nReasons to use pi over cookiecutter:\n  - Templates are smaller. Define files you need in a `.toml`.\n  - *Fast*. pi is **30x faster** than cookiecutter when rendering the sample vim\n    plugin template.\n  - pi uses mustache, a logic-less language, for templates.\n  - pi can initialize a darcs, pijul, mercurial, or git repository inside your projects\n  - pi provides opinionated templates for many languages\n  - pi is extensible in Rust\n\nReasons to not use pi over cookiecutter:\n  - cookiecutter uses [jinja](http://jinja.pocoo.org/) templates, which are far more sophisticated.\n  - pi is newer and presumably more buggy\n  - cookiecutter is extensible in Python\n\nBenchmarks (with Haskell's [bench](https://github.com/Gabriel439/bench)):\n\n| Tool | Language | Time (vim example plugin) | Time (rust library) |\n| ---- | -------- | ------------------------- | ------------------- |\n| pi init | rust | 10.10 ms | 8.809 ms |\n| pi new | rust | 6.672 ms | 8.653 ms |\n| cookiecutter | python | 317.1 ms | 316.9 ms |\n\n## Installation\n\n### Script\n\nEnter the following in a command prompt:\n\n```\ncurl -LSfs https://japaric.github.io/trust/install.sh | sh -s -- --git vmchale/project-init\n```\n\n### Binary releases\n\nThe easiest way for most users is simply to download the prebuilt binaries.\nYou can find binaries for various platforms on the\n[release](https://github.com/vmchale/project-init/releases) page.\n\n### Cargo\n\nFirst, install [cargo](https://rustup.rs/). Then:\n\n```bash\n $ cargo install project_init\n```\n\nYou will need to use the nightly release for this to work; if in doubt run\n\n```bash\nrustup run nightly cargo install project_init\n```\n\n## Use\n\n`pi` reads from `$HOME/.pi_templates/` *and* your current directory. So, if you\nplace a template in the `$HOME/.pi_templates/idris/`, you can initialize a\nproject *anywhere* with\n\n```bash\n $ pi init idris treesod\n```\n\nThere is a repo containing pi templates\n[here](https://github.com/vmchale/pi-templates). \n\nYou can also use pi with built-in templates, viz. \n\n```bash\n $ pi new haskell really-good-project\nFinished initializing project in really-good-project/\n```\n\nOr to fetch a template from github:\n\n```bash\n $ pi git vmchale/haskell-ats ambitious-insane-project\n```\n\n### Examples\n\n  * [haskell-ats](https://github.com/vmchale/haskell-ats) - a template for\n    Haskell/ATS polyglot projects.\n  * [madlang-miso](https://github.com/vmchale/madlang-miso) - a template for\n    frontend using [Miso](https://haskell-miso.org/) and\n    [Madlang](https://hub.darcs.net/vmchale/madlang).\n  * [ats-makefile](https://github.com/vmchale/ats-makefile) - a template for ATS\n    projects that uses a plain `Makefile`.\n\n### Configuration\n\nGlobal configuration is via the `$HOME/.pi.toml` file. The following is an example:\n\n```toml\nlicense = \"BSD3\"         # set default license to BSD3 \nversion_control = \"git\"  # initialize new repositories with git\nversion = \"0.1.0\"        # start new projects at version 0.1.0\n\n[author]\nname = \"Vanessa McHale\"\nemail = \"vanessa.mchale@reconfigure.io\"\ngithub_username = \"vmchale\"\n\n# put any custom keys you want under a [[user]] table\n[[user]]\nwebsite = \"https://vmchale.com\"\n```\n\nProject-specific config lives in `$PROJECT_NAME/template.toml`. The following is\nan example for a vim plugin:\n\n```toml\nlicense = \"BSD3\"        # overrides global value if set\nwith_readme = true      # add README.md\n\n[files]\nfiles = [\"syntax/{{ project }}.vim\",\"plugin/{{ project }}.vim\",\"doc/{{ project }}.txt\"] # blank files\ndirectories = [\"doc\",\"syntax\",\"plugin\"]\ntemplates = [\"vimball.txt\"] # files to be processed\n\n[config]\nversion = \"0.1.0\"\nversion_control = \"darcs\"\n\n# put any custom keys you want below [[user]]\n[[user]]\nvim_org_username = \"vmchale\"\n```\n\nThis will generate the following directory structure:\n\n```\nvim-plugin\n├── LICENSE\n├── README.md\n├── doc\n│  └── vim-plugin.txt\n├── plugin\n│  └── vim-plugin.vim\n├── syntax\n│  └── vim-plugin.vim\n└── vimball.txt\n```\n\nFor a more in-depth example, see\n[here](https://github.com/vmchale/madlang-miso). This is a template based off\nthe [recursion schemes\ngenerator](http://vmchale.com/recursion-scheme-generator/index.html).\n\n### Templates\n\n`pi` uses [mustache](https://mustache.github.io/) for templating, via the\n[rustache](https://github.com/rustache/rustache) crate.\n\nYou can find examples and help on the [mustache page](https://mustache.github.io/), or you can my look at [the example repo](https://github.com/vmchale/pi-templates).\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmchale%2Fproject-init","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvmchale%2Fproject-init","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmchale%2Fproject-init/lists"}