gptscript icon indicating copy to clipboard operation
gptscript copied to clipboard

why is program file always required?

Open solodov opened this issue 1 year ago • 1 comments

$ echo foo | gptscript -f - 
Usage:
  gptscript [flags] PROGRAM_FILE [INPUT...]
  gptscript [command]
...

The expectation here is to do something that doesn't require any non-system tools. However PROGRAM_FILE is still required, so this example doesn't work. Documentation says tools can be in script or system ones. So there's a case where running gptscript shouldn't require any tool definitions and input can contain everything.

If I create a file that contains the same input as above and nothing else then it works just fine:

$ gptscript test

This further adds to confusion between meaning of inputs and program files. Oh, and passing empty file as program file doesn't work, gptscript complains about no tools being defined.

solodov avatar Jun 07 '24 21:06 solodov

Hi. I think what you want is:

echo foo | gptscript -

I can see how this help text is confusing

  -f, --input string                  Read input from a file ("-" for stdin) ($GPTSCRIPT_INPUT)

We'll either fix to support -f - or clarify the documentation and help text.

This further adds to confusion between meaning of inputs and program files

Hopefully this is resolved based on the above. If not, let me know and explain the confusion in a bit more detail if you can.

Oh, and passing empty file as program file doesn't work, gptscript complains about no tools being defined.

Yes, that won't change. A gptscript needs at least one tool to execute. Otherwise it is invalid. In your above example "echo foo" is the tool

cjellick avatar Jun 10 '24 17:06 cjellick