Code Generation from Templates
Section titled “Code Generation from Templates”The exec service can scaffold ready-to-run script code from templates. A template packages a code skeleton, the language it targets, a set of fillable parameters, and a default runtime configuration. Rendering a template substitutes the caller’s parameter values into the skeleton and returns the final script as a string. This is deterministic template rendering: the output for a given template and parameter set is fully determined and reproducible, and is not produced by a language model or any generative AI system.
Hoody ships a library of built-in templates that cover common script patterns. You can also define your own custom templates and render those, which makes the same scaffolding flow available for project-specific boilerplate.
Operations
Section titled “Operations”The following operations are available. Their full reference, including request and response schemas, lives on the Script Templates page.
| Operation | Method | Path | Purpose |
|---|---|---|---|
| List templates | GET | /api/v1/exec/templates/list | Enumerate built-in and custom templates available to the caller |
| Preview a template | GET | /api/v1/exec/templates/preview | Read a template’s metadata, parameters, and default configuration without rendering it |
| Generate code from a template | POST | /api/v1/exec/templates/generate | Render a template into a runnable script and return the generated source |
| Create a custom template | POST | /api/v1/exec/templates/create-custom | Register a new custom template |
| Update a custom template | PUT | /api/v1/exec/templates/update-custom/:name | Modify the parameters or skeleton of an existing custom template |
| Delete a custom template | DELETE | /api/v1/exec/templates/delete-custom/:name | Remove a custom template |
Authentication
Section titled “Authentication”These routes do not take a Hoody API token. Whether a caller may reach the exec kit is decided by the container’s Hoody Proxy permission rules, configured under Hoody Proxy permissions. Requests that the proxy refuses return 403 forbidden.
Rate limiting
Section titled “Rate limiting”Template calls share the exec management API’s rate limit: 100 requests per 60 seconds per client. When the limit is exceeded the service returns 429 with a retryAfter field indicating how long the caller should wait before retrying.
Next steps
Section titled “Next steps”- Full request and response schemas for every operation on this page: Script Templates.
- Validate the output of a generation request before executing it: Code Validation.