openlawlibrary / taf

The Archive Framework
GNU Affero General Public License v3.0
10 stars 10 forks source link

Pass in a custom json as pipe to CLI commands #526

Closed n-dusan closed 1 month ago

n-dusan commented 2 months ago

Example:

More information in click docs and stackoverflow.

renatav commented 1 month ago

I've been looking into this and this is actually going to be really hard. The problem is that we have our yubikey prompts which don't work in combination with < and |. This is what happens:

Do you want to reuse already set up Yubikey? [y/N]: Aborted!

Standard Input Stream State: When a CLI function reads from stdin that has been redirected from a file (using <), it consumes all the input from that file. After the end of this input, stdin is considered exhausted and effectively closed from the perspective of awaiting further interactive input. This means no additional data can be read through standard input mechanisms like prompts directly within the same execution context or process flow.

I can refactor some of these commands to expect a config file, but it looks like supporting < would take a lot of work. I removed the good first issue label since this is far from trivial sadly.

renatav commented 1 month ago

Partially addressed by merging #550, not worth fully implementing due to restrictions mentioned in the previous commit