Code Generation from Templates
Section titled “Code Generation from Templates”The exec service can scaffold ready-to-run script code from built-in templates and from custom templates you define. Code is produced through deterministic template rendering: a named template and its inputs are merged into a fixed script body. This is not AI or natural-language code synthesis; the output for a given template and input set is reproducible and predictable.
Use this capability when you want to:
- Bootstrap common script patterns (HTTP clients, data processing, file operations) without writing boilerplate by hand.
- Standardize how a team writes scripts by publishing shared templates.
- Compose scripts programmatically from a known set of inputs.
Available operations
Section titled “Available operations”The full reference for each operation, including parameters, request bodies, and response schemas, lives on the Script Templates page. The operations are:
GET /api/v1/exec/templates/list— list all built-in and custom templates available in the exec service.GET /api/v1/exec/templates/preview— preview the rendered output of a template with sample inputs before generating.POST /api/v1/exec/templates/generate— generate a runnable script from a template and a set of inputs.POST /api/v1/exec/templates/create-custom— create a new custom template that is available alongside the built-ins.PUT /api/v1/exec/templates/update-custom/:name— update an existing custom template.DELETE /api/v1/exec/templates/delete-custom/:name— remove a custom template.
Authentication
Section titled “Authentication”All requests use the standard API authentication header:
Authorization: Bearer <HOODY_API_KEY>Include this header on every request to the exec service.
Workflow
Section titled “Workflow”A typical generation flow is:
templates/listto discover which templates are available and what inputs each one expects.templates/previewto render the template with your inputs and confirm the output.templates/generateto produce the final script, which can then be passed to execution or to code validation.
Next steps
Section titled “Next steps”- Script Templates — full reference for the template list, preview, generate, create, update, and delete operations.
- Code Validation — validate generated scripts for syntax and structural issues before running them.