Last Verified: 2025-01-27
Package:
@hopx-ai/sdk on npm
Overview
TheTemplate class provides a fluent API for building custom sandbox templates.
Import
Methods
Base Image Methods
template.fromUbuntuImage(version: string): Templatetemplate.fromPythonImage(version: string): Templatetemplate.fromNodeImage(version: string): Templatetemplate.fromImage(image: string, auth?: AuthConfig): Template
Configuration Methods
template.copy(src: string, dest: string): Templatetemplate.run(command: string): Templatetemplate.env(key: string, value: string): Templatetemplate.expose(port: number): Templatetemplate.workdir(path: string): Templatetemplate.readyCheck(check: ReadyCheck): Templatetemplate.startCmd(command: string): Template
Building
Related Classes
- Ready Checks - Ready check utilities
- Sandbox - Use templates with
Sandbox.create({ template: ... })
See Also
- Ready Checks - Learn about ready checks
- Core Concepts: Templates - Learn about templates
Next Steps
Now that you understand template building, explore:- Ready Checks - Add readiness verification
- Building Templates - Learn template building concepts
- Template Configuration - Configure templates
- CLI Reference - Use HopX from the command line
- Custom Templates - Build custom templates

