hdresearch / nolita

Work with web-enabled agents quickly — whether running a quick task or bootstrapping a full-stack product.
https://nolita.ai
MIT License
79 stars 3 forks source link

run: prompt user to save api keys #64

Closed matildepark closed 2 months ago

matildepark commented 2 months ago

Fixes #61.

Rewrites some config resolution code to be a bit nicer to look at; adds some utilities to check for and merge two potential configs (the ones we pipe in as a flag, and the .nolitarc), and prompts the user to save to .nolitarc if they're entering HDR or agent API keys.

It's a little annoying because we take in so many possible options:

All these need to be merged into one big config as we go, mutating it as we ask the user questions.

In the process I also fixed a bug prohibiting piping the output -- we just need to console.log it when we're done.

matildepark commented 2 months ago

Tested a few cases on Mac and Windows now. Needed to nestle the request to save the key into the promise, but only on Mac? Well, okay. We pass on requesting to save if there's nothing entered. Removed the call to dashboard, which will always error out if anyone tries to sign up.

I have reasonable belief that the priority list above is being respected in mixed configuration edge cases, so will place into dev.