Stop rewriting boilerplate. Start generating structure.
Hix is a template-driven code generator that turns simple JSON models into full-featured source code โ from backend models and database schema to HTML forms and API handlers.
Designed for developers who value consistency, automation, and clean architecture, Hix helps you build smarter, faster, and with fewer bugs.
- ๐ One model โ many files
- ๐งฉ Template everything: Python, TypeScript, HTML, SQL, C#, you name it
- โ๏ธ Drop-in CLI with Windows installer and editor integration
- ๐ง Built with Haskell for safe, predictable rendering
"Build once. Template forever. Let Hix do the repetition."
Hix ๐งฉ โ Flexible Code Generator
Hix is a flexible, template-driven code generator for developers who love clean, structured automation.**
Whether you're generating classes, config files, or scaffolding code, Hix combines the power of JSON models and expressive templates to deliver clean, readable output.
Documentation
Full documentation is available at:
๐ https://joelbugarini.github.io/hix/
โจ Features
- ๐
[[prop]]loops over model properties - โ
[[if ...]],[[else]]conditionals - ๐ค Text transformation functions:
[[upper ...]],[[lower ...]],[[snake_case ...]],[[kebab_case ...]],[[lowerFirst ...]] - ๐ง Full AST parser and golden test suite
- ๐จ VS Code / TextMate grammar for syntax highlighting
- ๐ช Windows installer with PATH integration
๐ Getting Started
1. Using the CLI (Windows)
Download and run the latest installer:
Then open a terminal and run:
hix template.hix model.json
2. Using the CLI (Dev / Haskell)
stack install --local-bin-path=dist dist/hix template.hix model.json
๐ Template Syntax
[[prop]]
[[if prop.type=bool]]
<input type="checkbox" name="[[prop.name]]">
[[else]]
<input type="text" name="[[snake_case prop.name]]">
[[/if]]
[[/prop]]
๐งช Tests
Includes golden tests for templates and rendering.
๐จ Syntax Highlighting
You can generate a .tmLanguage.json file for use in VS Code or any TextMate-compatible editor:
hix --gen-grammar hix.tmLanguage.json
๐ฆ Packaging (Windows)
Build and package using Inno Setup:
stack install --local-bin-path=dist cd utils/installer Open hix_installer.iss in Inno Setup and click Compile
๐ License
Licensed under GNU GPL v2, like Git.
๐ค Contributing
Pull requests are welcome! Open an issue to discuss new features, syntax extensions, or improvements.
๐ง Roadmap
-
[[include file]]support for template partials - Custom filters and functions
- Model validation
- LSP integration / live preview
Made with โค๏ธ by Joel Bugarini