A lightning-fast, cross-platform file structure generator written in Erlang. Tree Weaver enables you to easily define and create directory structures using simple tree-like text files.
- Overview
- Features
- Installation
- Usage
- Examples
- File Format
- Command Line Options
- Development
- Testing
- Contributing
- License
Tree Weaver transforms text-based tree representations into actual directory structures. It's perfect for:
- Quickly scaffolding new projects
- Creating consistent file structures across teams
- Documenting and implementing project architectures
- Setting up development, testing, and CI environments
- Simple Syntax: Uses familiar tree-like text format
- Cross-Platform: Works on Linux, macOS, and Windows
- Lightning Fast: Written in Erlang for optimal performance
- Flexible: Support for comments and various formatting options
- Dry Run Mode: Preview changes before creating files
- Custom Destinations: Specify output locations
- Intelligent Scaffolding: (Coming soon) AI-powered project templates
- Erlang/OTP 25 or newer
- Rebar3 (Erlang build tool)
brew update
brew install erlang# Add Erlang Solutions repository
wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb
sudo dpkg -i erlang-solutions_2.0_all.deb
sudo apt-get update
sudo apt-get install esl-erlang- Download from Official Erlang Website
- Run the installer
- Add Erlang to system PATH
Download the latest release from our GitHub Releases page.
# Clone the repository
git clone https://github.com/zackkitzmiller/tree-weaver.git
cd tree-weaver
# If you have 'just' installed (recommended)
just setup
just build
# Or using rebar3 directly
rebar3 compile
rebar3 escriptizeThe executable will be available at _build/default/bin/tree-weaver.
# Basic usage with a tree file
tree-weaver project.tree
# Dry run (preview without creating files)
tree-weaver --dry-run project.tree
# Custom destination
tree-weaver --dest /path/to/destination project.tree
# Use current directory as root (skips creating the root directory)
tree-weaver --dest . project.tree
# Display help
tree-weaverCreate a file simple-project.tree:
simple-project/
|-- src/
| |-- main.erl
|-- test/
| |-- main_tests.erl
|-- README.md
Run:
tree-weaver simple-project.treeThis creates:
simple-project/
βββ src/
β βββ main.erl
βββ test/
β βββ main_tests.erl
βββ README.md
See the feelsbank.tree example in the repository for a complex Go web application structure.
Tree Weaver uses a simple text format to represent directory structures:
- First line: Root directory name
- Subsequent lines: Directory structure with indentation
- Lines ending with
/: Directories - Lines without
/: Files - Comments: Use
# Comment textanywhere in a line
Example with comments:
my-project/ # Root directory
|-- src/ # Source code
| |-- main.erl # Main entry point
|-- README.md # Documentation
- Use
|--to indicate items - Use
| |--or multiple spaces for nested items - Consistent indentation is recommended but not strictly required
Tree Weaver supports the following command line options:
| Option | Description |
|---|---|
--dry-run |
Show what would be created without making changes |
--dest PATH |
Specify destination path (default: current directory) |
--dest . |
Use current directory as root (skip creating root directory) |
We recommend using Just for common development tasks:
# Setup development environment
just setup
# Compile
just compile
# Run tests
just test
# Create executable
just build
# Create sample and run with it
just demoIf you prefer not to use Just:
# Compile the project
rebar3 compile
# Run tests
rebar3 eunit
# Create executable
rebar3 escriptize
# Start dev shell
rebar3 shellRun the test suite:
just test
# or
rebar3 eunitTo run a specific test:
just test-one tree_weaver_tests
# or
rebar3 eunit --module=tree_weaver_testsWe welcome contributions! See CONTRIBUTING.md for details.
Quick steps:
- Fork the repository
- Create a feature branch
- Make your changes
- Add or update tests
- Submit a pull request
Please follow the Code of Conduct.
This project is licensed under the MIT License - see the LICENSE file for details.
- The Erlang community
- All contributors and supporters
Built with β€οΈ by Zack Kitzmiller# Tree Weaver