Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 2.52 KB

File metadata and controls

46 lines (31 loc) · 2.52 KB

Session Notes: Issue #325 — Add tools subcommand

2026-03-16: Initial implementation

Branch

325-tools-subcommand based on dev

What was done

Created abm/lib/tools.py with six subcommands:

  1. tools list — Lists all tools on the server. Supports --name, --section, and --id regex filters. Output: tab-separated ID, version, panel section, name.

  2. tools show — Shows full JSON details for a tool (with io_details=True for input/output info).

  3. tools inputs — Lists the inputs required by a tool in a human-readable format (name, type, required flag, label).

  4. tools search — Searches tools by matching a query (regex) against name, ID, and description.

  5. tools scaffold — Generates a YAML input template from a tool's input definition. Handles conditionals (shows default case active, other cases commented), sections, repeats, data/data_collection references, and all scalar types. Comments include labels, help text, allowed values.

  6. tools run — Runs a tool with inputs from a YAML file (-f), inline key=value args, or both (CLI overrides file). Dataset references use hda:ID / hdca:ID shorthand. Supports --wait to poll until the job completes. Uses BioBlend legacy pipe-delimited key format.

Key implementation details

  • _scaffold_inputs() recursively walks the tool input tree, emitting YAML with comments for each input type (conditional, section, repeat, data, boolean, select, integer, float, text, color, hidden)
  • _parse_value() converts string values to appropriate types (dataset refs, booleans, numbers)
  • _resolve_values() recursively processes a loaded YAML dict to resolve dataset reference strings
  • _flatten_inputs() converts nested dicts to pipe-delimited keys for BioBlend's legacy input format

Files created

  • abm/lib/tools.py — new module

Files modified

  • abm/lib/menu.yml — added tools menu entry with all 6 subcommands
  • abm/__main__.py — added tools import

Testing (on nlp instance at 34.11.7.111)

  • tools list — found 2579 tools, filters work correctly
  • tools list --name fastp — found 14 fastp versions
  • tools scaffold "Show beginning1" — generated correct YAML template
  • tools run with inline args — job completed successfully
  • tools run with YAML file — job completed successfully
  • tools run with YAML file + CLI override — job completed successfully
  • tools run --wait — correctly polled and reported job completion
  • All 4 test runs produced output datasets in state ok