callstack / ai-cli

AI assistant in your terminal.
https://callstack.github.io/ai-cli/
MIT License
21 stars 0 forks source link

feat: `init` command #9

Closed mdjastrzebski closed 6 months ago

mdjastrzebski commented 6 months ago

Describe the feature

Command to facilitate initial setup (i.e. creation of ~.airc.json file.

Motivation

Easier start for users should encourage more users.

UX:

$ ai init
Welcome to AI CLI. Let's set you up quickly.

Which inference provider would you like to set up:
- [x] OpenAI
- [ ] Perplexity

Do you already have OpenAI API key? [y/n]
[If no, then point user URL where to create API key]

Paste your OpenAI key here: _

I have written your settings into '~/.airc.json` file. You can now start using AI CLI.

For one of questions ask the prompt as command params
$ ai "Tell me a joke" 

For interactive session use `-i` (or "--interactive") option. 
$ ai -i "Tell me an interesting fact about JavaScript"

Or just start 'ai' without any parameters.
$ ai

If user has not yet invoked init commend (i.e. there is no ~/.airc file) then invoking prompt (the default command), should invoke init automatically.