pub fn init(path: Option<String>, force: Option<bool>) -> Result<InitOutput>Expand description
Initialize a new ggen project with default structure and scripts.
Creates a minimal, working ggen project scaffold with:
- ggen.toml configuration
- schema/domain.ttl (RDF ontology with example)
- Makefile (setup, build, clean targets)
- scripts/startup.sh (project initialization script)
- templates/ (empty, ready for custom Tera templates)
- src/generated/ (output directory)
§Usage
# Initialize in current directory
ggen init
# Initialize in specific directory
ggen init --path my-project§Flags
–path PATH Project directory (default: current directory) –force Overwrite existing files
§Output
Returns JSON with created files and next steps.
§Next Steps
After initialization:
- Run
make setupto prepare your environment - Edit schema/domain.ttl with your domain model
- Create Tera templates in templates/ for your target languages
- Run
make buildto generate code from your ontology