Reason and OCaml project generator.
Features • Installation • Templates • Usage • Roadmap • Contributing • License • Acknowledgements
Features
Installation
Using Homebrew (macOS)
brew install tmattio/tap/spinUsing Opam
opam install spinUsing npm
yarn global add @tmattio/spin
# Or
npm -g install @tmattio/spinUsing a script
curl -fsSL https://github.com/tmattio/spin/raw/master/script/install.sh | bashTemplates
You can generate a new project using a template with spin new. For instance:
spin new bin my_appWill create a new binary application in the directory ./my_app/
Anyone can create new Spin templates, but we provide official templates for a lot of use cases.
Official templates
The official Spin templates templates are the following:
- bin - Native project containing a binary.
- cli - Command Line Interface releasable on Opam.
- lib - Library releasable on Opam.
- ppx - PPX library with prebuilt binaries for native and bucklescript.
- c-bindings - Bindings to a C library.
- js - Js application with Js_of_ocaml.
If you'd like to add an official template, don't hesitate to open a PR!
Other Reason/OCaml templates
Here are some non-official Spin templates that you can use:
- spin-rescript - Spin template for ReScript applicatoins
- spin-jsoo-react - Spin template for React applicatoins with Js_of_ocaml
- spin-incr-dom - Single page application with Js_of_ocaml using Incr_dom
Other non-OCaml templates
Although the focus of Spin is to offer a great project generator for the OCaml ecosystem, it can also be used to generate non-OCaml templates. Here are a few examples:
- spin-python-cli - Spin template for Python CLIs
Usage
For a detailed documentation of Spin's CLI, run spin --help, or refer to the CLI documentation.
spin new TEMPLATE [PATH] [--default] [--ignore-config]
Create a new ReasonML/Ocaml project from a template.
PATH defaults to the current working directory.
When --default is passed, the user will not be prompted for configurations that have a default value.
When --ignore-config is passed, the configuration file will be ignored and the user will be prompted for all the configurations.
spin ls
List the official Spin templates.
spin gen
List the generators available for the current project.
spin gen GENERATOR
Generate a new component in the current project.
spin config
Prompt the user for values that can be saved in the configuration file.
If a value is present in the configuration file, it will not be prompted when generating a new project.
Roadmap
See our development board for a list of selected features and issues.
Contributing
We'd love your help improving Spin!
Take a look at our Contributing Guide to get started.
License
Distributed under the MIT License. See LICENSE for more information.
Acknowledgements
Thanks to everyone who contributed to Spin!
Special thanks to @wesoudshoorn for creating Spin's logo.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
