Skip to content

tool-spec/gotap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gotap

DOI

CLI shim for tool-spec compliant tools. It runs inside Docker containers and handles metadata verification, conversion, input parsing, and parameter binding generation.

Part of the tool-spec ecosystem. See the specification for context.

Templates

These templates will use gotap (or already plan to):

Commands

Command Purpose
parse Read input.json and tool.yml, validate, output validated parameters and data as JSON to stdout
generate Generate language-specific parameter bindings (Python, R, JavaScript, MATLAB) that call gotap parse
metadata Output tool metadata in schema.org or nfdi4earth format
verify Validate tool-spec metadata and report errors/warnings
prepare Create or update inputs.json via interactive CLI
run Validate inputs and execute the tool entrypoint

Flags are inherited from the root where relevant: --spec-file, --input-file, --citation-file, --license-file, --output-folder. Version check: gotap --version or gotap -v.

Bindings

gotap generate produces parameter access code for Python, R, JavaScript (plain or TypeScript), and MATLAB. Each binding runs gotap parse and returns structured parameters and data paths.

Generate usage

gotap generate --target=python --output=src/parameters.py --spec-file=src/tool.yml
gotap generate --target=r --output=src/parameters.R --spec-file=src/tool.yml
gotap generate --target=node-js --output=src/parameters.js --spec-file=src/tool.yml
gotap generate --target=node-ts --output=src/parameters.ts --spec-file=src/tool.yml
gotap generate --target=matlab --output=get_parameters.m --spec-file=src/tool.yml
  • node-js: plain JavaScript (ESM), for Node.js projects
  • node-ts: TypeScript with interfaces, for Node.js TypeScript projects

If the spec defines a single tool, you can omit the tool name. Otherwise pass it as the first argument or set RUN_TOOL.

The generate command overwrites the output file if it already exists.

Development workflow

  1. Build gotap:

    go build -ldflags "-X github.com/hydrocode-de/gotap/cmd.Version=$(git describe --tags --always --dirty)" -o gotap .
  2. Regenerate bindings when tool.yml changes:

    ./gotap generate --target=python --output=src/parameters.py --spec-file=src/tool.yml
  3. Either:

    • Add generated files to .gitignore and regenerate as part of the build, or
    • Commit the generated files so they are always up to date and usable offline.

Build

go build -ldflags "-X github.com/hydrocode-de/gotap/cmd.Version=$(git describe --tags --always --dirty)" -o gotap .

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •  

Languages