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 any custom templates you have defined. Generation is deterministic template rendering: the service substitutes your parameters into a fixed template body and returns the assembled script. It is not an AI or LLM-based code generator, and it does not parse natural-language directives or stream partial output.
Use this capability when you want to produce a script that follows a known shape — for example, a health-check, a deployment helper, or a recurring maintenance task — without writing the boilerplate by hand.
Available operations
Section titled “Available operations”All operations live in the exec.templates namespace of the Hoody SDK and are documented in full on the Script Templates page.
| Operation | HTTP | SDK call |
|---|---|---|
| List available templates | GET /api/v1/exec/templates/list | client.exec.templates.list() |
| Preview a template | GET /api/v1/exec/templates/preview | client.exec.templates.preview(...) |
| Generate code from a template | POST /api/v1/exec/templates/generate | client.exec.templates.generate(...) |
| Create a custom template | POST /api/v1/exec/templates/create-custom | client.exec.templates.createCustom(...) |
| Update a custom template | PUT /api/v1/exec/templates/update-custom/:name | client.exec.templates.updateCustom(...) |
| Delete a custom template | DELETE /api/v1/exec/templates/delete-custom/:name | client.exec.templates.deleteCustom(...) |
A typical workflow is: list the templates to find one that matches your use case, preview it to see the rendered output for your parameters, then call generate to produce the final script body. If none of the built-in templates fit, create a custom template and use it the same way.
Authentication
Section titled “Authentication”Every request uses the standard API key header:
Authorization: Bearer <HOODY_API_KEY>No additional scopes, quotas, or per-request rate-limit headers are required for template operations.
Related
Section titled “Related”- Script Templates — full reference for every templates endpoint, including parameters, request bodies, and response schemas.
- Code Validation — run the generated script through the validation pipeline before executing it in a container.