1.1 KiB
1.1 KiB
Selector and plugin-table usage
This project provides a small plugin/table/selector flow that lets plugins and cmdlets interact through a simple pipable API.
Key ideas:
plugin-tablerenders a plugin result set and emits pipeline-friendly dicts for each row.- Emitted rows can include
_selection_argsand, when needed,_selection_actionfor exact row replay. - Use
@Nto select an item from a table and chain it to the next cmdlet.
Example:
plugin-table -plugin example -sample | @1 | add-file -instance default
What plugins must implement:
- An adapter that yields
ResultModelobjects. - Optionally a
columnsfactory andselection_fn.
Implementation notes:
plugin-tableemits dicts like{ 'title': ..., 'path': ..., 'metadata': ..., '_selection_args': [...] }.- When a row includes
_selection_action,@1prefers that exact action. - Otherwise
@1falls back to_selection_args, then plugin selection logic, then sensible defaults such as-pathor-title.
This design keeps selector-focused workflows small and predictable while still
allowing full cmdlet interoperability through piping and -run-cmd.