0

I'm using click to create a CLI tool and need to prompt for a JSON payload. Is there a way to prompt for multiple lines using the following (or any other API)?

click.prompt(
    "Payload",
    type=click.STRING
)

Thanks!

Jerome VDL
  • 3,376
  • 4
  • 32
  • 33
  • Does this answer your question: https://stackoverflow.com/questions/30239092/how-to-get-multiline-input-from-user ? I tried the second example of the accepted answer and it worked just as you need it (if I understand your question correctly) – mbostic Feb 27 '22 at 16:35
  • 1
    I saw this one yes. Was wondering if something was available in the click library. – Jerome VDL Feb 27 '22 at 22:43

1 Answers1

0

I believe you're looking for the Click edit API. Like it says in its documentation here:

This is very useful for asking users for multi-line input.

Ugo
  • 587
  • 8
  • 12