This is a command-line interface (CLI) based AI chat application that allows users to interact with the various AI models offered by DuckDuckGo's AI chat. Other models and providers may be added later.
- Interactive AI chat: at your fingertips
- One-shot Prompts: Run a single prompt and exit.
- File Input: Append contents of a file to your prompt. (Allows to modify files easily)
- Run shell commands from inside the chat
- Pipe shell output into the chat
- Text to speech support (experimental): Listen to AI generated stories while coding :)!
- Model Selection: Choose from a variety of AI models for your chat.
git clone https://github.com/hek2mgl/chatcli
cd chatcli
python3 -mvenv venv
source venv/bin/activate
pip install .
chatcli --help- Start an interative chat with the default model:
chatcli- List available models:
chatcli --list-models- Use a specific model:
chatcli --model claude-3-haiku- Run a one-shot prompt:
chatcli --oneshot "What is the capital of France?"
# short version
chatcli -s "What is the capital of France?"- The prompt from the file (implies --oneshot):
chatcli -f my_prompt.txt
chatcli -s 'summarize' -f my_text.txt
chatcli -s 'translate' -f my_text.txt
chatcli -s 'remove trailing whitespace' -f my_code.py
some_program_with_error_msg | chatcli -s 'explain' -f /dev/stdin- Text to speech support (experimental)
chatcli supports text to speech (tts) via the Google text to speak API.
Note! You need a working speaker to hear the voice.
Note! The AI answers will be sent to Google's text to speech API. chatcli will not share account credentials or login at Google, but if you are concerned about your privacy don't use this feature.
chatcli --tts
chatcli --tts -s 'hello world'- Enable debug output:
chatcli --debugStart a in interactive shell
To start an interactive shell type !
you:!
exit the shell to return to the chat
Run a shell command
To run a shell commmand, type ! and the command:
you:!ls -al
you:!vi my.txt
you:!ssh server.xyz.org
The application uses Python's built-in logging module. If the --debug flag is set, the logging level is
set to DEBUG; otherwise, it defaults to WARNING.
Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs feature requests.
This project is licensed under the Apache License Version 2.0. See the LICENSE file for more details.
- Thanks to DuckDuckGo for their AI chat, which is the backend for this tool.
- Thanks to textualize/rich for the markdown renderer.