Template repository for building a TypeScript tool that follows the Tool Specification container contract.
Use this template when you want TypeScript with generated typings. For plain JavaScript, use tool_template_node instead.
This template installs gotap inside the image and uses it as the default runtime shim:
CMD ["gotap", "run", "foobar", "--input-file", "/in/input.json"]At build time, gotap generate creates parameters.ts from src/tool.yml. At runtime, run.ts uses the generated bindings to validate /in/input.json, load typed parameters and data paths, and write structured run logs.
/
|- in/
| |- input.json
|- out/
| |- ...
|- src/
| |- tool.yml
| |- run.ts
| |- parameters.ts (generated at build time)
| |- CITATION.cff
docker build -t tbr_typescript_template .
docker run --rm -it \
-v "$(pwd)/in:/in" \
-v "$(pwd)/out:/out" \
-e TOOL_RUN=foobar \
tbr_typescript_templateTOOL_RUN is only needed when the image contains more than one tool entry.
- Update
src/tool.ymlto describe your tool. - Add dependencies in
Dockerfile. - Implement the tool logic in
src/run.ts. - Rebuild the image so
gotap generaterefreshesparameters.ts.
The generated parameters.ts file is not edited by hand. It exposes:
getParameters()getData()getRunContext()getLogger()
The starter runtime uses getLogger() for structured JSON Lines logging and still prints the sample parsed input to standard output.