init

Function init 

Source
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:

  1. Run make setup to prepare your environment
  2. Edit schema/domain.ttl with your domain model
  3. Create Tera templates in templates/ for your target languages
  4. Run make build to generate code from your ontology