Template repository for building a Node.js tool that follows the Tool Specification container contract.
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.js from src/tool.yml. At runtime, run.js uses the generated bindings to validate /in/input.json, load parameters and data paths, and write structured run logs.
/
|- in/
| |- input.json
|- out/
| |- ...
|- src/
| |- tool.yml
| |- run.js
| |- parameters.js (generated at build time)
| |- CITATION.cff
Build the image from the template root:
docker build -t tbr_node_template .Run the sample tool:
docker run --rm -it \
-v "$(pwd)/in:/in" \
-v "$(pwd)/out:/out" \
-e TOOL_RUN=foobar \
tbr_node_templateTOOL_RUN is only needed when the image contains more than one tool entry. The main runtime interface is still /in/input.json plus gotap run.
- Update
src/tool.ymlto describe your tool. - Add npm or system dependencies in
Dockerfile. - Implement your tool logic in
src/run.js. - Rebuild the image so
gotap generaterefreshesparameters.js.
The generated parameters.js file is not edited by hand. It exposes:
getParameters()getData()getRunContext()getLogger()
The starter runtime uses getLogger() for structured JSON Lines logging while keeping the sample parameter echo on standard output.