jbang icon indicating copy to clipboard operation
jbang copied to clipboard

init template=gpt fails on mac

Open sgandon opened this issue 7 months ago • 2 comments

Describe the bug try to install the gpt template on my mac fails

To Reproduce brew install jbangdev/tap/jbang jbang init --template=gpt gpt.java

Expected behavior a new gpt.java file is generated but getting

jbang init --template=gpt gpt.java
[jbang] [ERROR] Resource not found on class path: init-gpt.java.qute
[jbang] Run with --verbose for more details. The --verbose must be placed before the jbang command. I.e. jbang --verbose run [...]

JBang version

jbang version 0.125.1

Additional context Add any other context about the problem here.

sgandon avatar Apr 18 '25 14:04 sgandon

the template is part of the listed templates

jbang template list
agent
   Agent template
cli
   CLI template
gpt
   Template using ChatGPT (requires --preview and OPENAI_API_KEY)
gpt.groovy
   Template using ChatGPT for groovy (requires --preview and OPENAI_API_KEY)
gpt.kt
   Template using ChatGPT for kotlin (requires --preview and OPENAI_API_KEY)
hello
   Basic Hello World template
hello.groovy
   Basic groovy Hello World template
hello.kt
   Basic kotlin Hello World template
jbang-catalog
   Template for creating a new JBang catalog hosted on github with automatic renovate updates
qcli
   Quarkus CLI template
qmetrics
   Quarkus Metrics template
qrest
   Quarkus REST template
readme.md
   Basic markdown readme template

sgandon avatar Apr 18 '25 14:04 sgandon

yeah, its not great. it was very much an experiement ;)

The right syntax to use it is:

jbang --preview init -t gpt almiray.java "write me a hello world using StringUtils from commons-lang3"

but i can see that then fails because openai's api seem to have changed.

probably should extract this to a dedicated command/script rather than hardwired in.

maxandersen avatar Apr 19 '25 07:04 maxandersen