Skip to main content

init

Function init 

Source
pub fn init(
    path: Option<String>,
    force: Option<bool>,
    skip_hooks: Option<bool>,
    name: Option<String>,
    version: Option<String>,
    description: Option<String>,
) -> 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)
  • output directory (current directory by default)

§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 –skip-hooks Skip git hooks installation

§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