Explosion-Scratch / claude-unofficial-api

Unofficial API for Claude-2 via Claude Web (Also CLI)
https://npmjs.com/package/claude-ai
The Unlicense
729 stars 78 forks source link

CLI Issues (Syntax and file uploading) #30

Closed BelugaWhale closed 1 year ago

BelugaWhale commented 1 year ago

There seems to be an issue handling square brackets in CLI:

claude "hello [friend]" Error: File not found: friend

I believe files can be handled with this syntax anyway: claude --files delete.txt "what's in the file?"

That said this seems to run in the same way as the command above: claude [delete.txt] "what's in the file?"

Regardless of which command you run, I get this error: Uploading file delete.txt ReferenceError: File is not defined at uploadFile (file:///C:/Ug/npm/node_modules/claude-cli/index.js:319:13) at getFiles (file:///C:/User/npm/node_modules/claude-cli/index.js:332:32) at main (file:///C:/Usoaming/npm/node_modules/claude-cli/index.js:112:25) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

So in short I see 2 issues:

  1. the square bracket syntax is impacting prompting and is generally not needed. I would suggest removing it.
  2. uploading files does not work.

Please let me know if there's more information I can provide, this is a great repo, thanks for your contribution.

Explosion-Scratch commented 1 year ago

I'll fix this on Saturday

Explosion-Scratch commented 1 year ago

Make sure your JS environment has the File object

BelugaWhale commented 1 year ago

Hey could you elaborate on what you mean by your last comment? I am running the CLI version through cmd in windows 10.

Explosion-Scratch commented 1 year ago

What's your node --version

BelugaWhale commented 1 year ago

v18.16.1