Skip to content

igrek8/dynamic-inputs

Repository files navigation

This extension lets you populate a dynamic list of options from which you can pick a value during debugging or running tasks.

Features

  • Supports multi value selection
  • Supports other script languages (bash, python, nodejs etc.)
  • Supports memoization of the parameter using var parameter in args and dynamic-inputs.read command
  • Supports remap options to values by using unwrap
  • Supports params serializations via serializer option with the following value: json or plain (will pass multiple selections with a space delimiter)

Commands

  • dynamic-inputs.read - attempts to read from memory or shows a selection list
  • dynamic-inputs.write - always offers to a selection and saves the selection to the memory if args.var is given

Demo

demo

Setup

  1. Create a script which populates options by writing JSON array to stdout
  2. Create a script for debugging
  3. Run a task with a dynamic variable
  4. Debug the script with a dynamic variable

Variables

Supported variables in interpolation

Map options to values

Given

[
  { "label": "$(notebook-state-success) A", "value": "A", "picked": true },
  { "label": "$(notebook-state-error) B", "value": "B" },
  { "label": "$(notifications-configure) C", "value": "C" }
]

To receive ["A", "B"] as your selection, you can use the following JSON path expression $[*].value

Playground

git clone https://github.com/igrek8/dynamic-inputs
code dynamic-inputs/playground

Credits

Icons made by Freepik from www.flaticon.com