All-in-one chat and copilot CLI that integrates 10+ AI platforms.
Command Mode:
Aichat is a AI-powered CLI chat and copilot tool that seamlessly integrates with over 10 leading AI platforms, providing a powerful combination of chat-based interaction, context-aware conversations, and AI-assisted shell capabilities, all within a customizable and user-friendly environment.
* **Converse with Advanced AI:** Access and interact with 10+ leading AI platforms including OpenAI, Claude, Gemini, and more, all within one interface.
* **Streamline Your Workflow:** Generate code, execute shell commands using natural language, and automate tasks with AI assistance.
* **Unleash Your Creativity:** Utilize AI for writing, translation, image analysis, and exploring new ideas.
* **Customize Your Experience:** Configure settings, create custom roles for AI, and personalize your chat interface.
* **Empower Your Terminal:** Integrate AI into your shell for intelligent autocompletion and command suggestions.
* **Context & Session Management:** Maintain context within conversations and manage multiple sessions effortlessly.
Download pre-built binaries for macOS, Linux, and Windows from [GitHub Releases](https://github.com/sigoden/aichat/releases), extract them, and add the `aichat` binary to your `$PATH`.
### Binaries for macOS, Linux, and Windows
## Configuration
Download it from [GitHub Releases](https://github.com/sigoden/aichat/releases), unzip, and add aichat to your `$PATH`.
## Config
On first launch, aichat will guide you through the configuration.
Upon first launch, Aichat will guide you through the configuration process. An example configuration file is provided below:
```
> No config file, create a new one? Yes
> AI Platform: openai
> API Key: <your_api_key_here>
✨ Saved config file to <config-dir>/aichat/config.yaml
```
Feel free to adjust the configuration according to your needs.
> Get `config.yaml` path with command `aichat --info` or repl command `.info`.
```yaml
model: openai:gpt-3.5-turbo # LLM model
temperature: 1.0 # LLM temperature
save: true # Whether to save the message
save_session: null # Whether to save the session, if null, asking
highlight: true # Set false to turn highlight
light_theme: false # Whether to use a light theme
wrap: no # Specify the text-wrapping mode (no, auto, <max-width>)
wrap_code: false # Whether wrap code block
auto_copy: false # Automatically copy the last output to the clipboard
keybindings: emacs # REPL keybindings. values: emacs, vi
prelude: '' # Set a default role or session (role:<name>, session:<name>)
compress_threshold: 1000 # Compress session if tokens exceed this value (valid when >=1000)
model: openai:gpt-3.5-turbo # The Large Language Model (LLM) to use
temperature: 1.0 # Controls the randomness and creativity of the LLM's responses
save: true # Indicates whether to persist the message
save_session: null # Controls the persistence of the session, if null, asking the user
highlight: true # Controls syntax highlighting
light_theme: false # Activates a light color theme when true
wrap: no # Controls text wrapping (no, auto, <max-width>)
wrap_code: false # Enables or disables wrapping of code blocks
auto_copy: false # Enables or disables automatic copying the last LLM response to the clipboard
prelude: null # Set a default role or session to start with (role:<name>, session:<name>)
# Command that will be used to edit the current line buffer with ctrl+o
# if unset fallback to $EDITOR and $VISUAL
buffer_editor: null
# Compress session when token count reaches or exceeds this threshold (must be at least 1000)
compress_threshold: 1000
clients:
- type: openai
@ -101,15 +90,13 @@ clients:
name: localai
api_base: http://127.0.0.1:8080/v1
models:
- name: llama2
- name: llama3
max_input_tokens: 8192
```
Please review the [config.example.yaml](config.example.yaml) to see all available configuration options.
Refer to the [config.example.yaml](config.example.yaml) file for a complete list of configuration options. Environment variables can also be used for configuration; see the [Environment Variables](https://github.com/sigoden/aichat/wiki/Environment-Variables) page for details.
There are some configurations that can be set through environment variables, see [Environment Variables](https://github.com/sigoden/aichat/wiki/Environment-Variables).
## Command
## Command line
```
Usage: aichat [OPTIONS] [TEXT]...
@ -118,18 +105,19 @@ Arguments:
[TEXT]... Input text
Options:
-m, --model <MODEL> Choose a LLM model
-r, --role <ROLE> Choose a role
-s, --session [<SESSION>] Create or reuse a session
-e, --execute Execute commands using natural language
-c, --code Generate only code
-f, --file <FILE> Attach files to the message
-H, --no-highlight Disable syntax highlighting
-S, --no-stream No stream output
-w, --wrap <WRAP> Specify the text-wrapping mode (no, auto, <max-width>)
-m, --model <MODEL> Select a LLM model
-r, --role <ROLE> Select a role
-s, --session [<SESSION>] Start or join a session
--save-session Forces the session to be saved
-e, --execute Execute commands in natural language
-c, --code Output code only
-f, --file <FILE> Include files with the message
-H, --no-highlight Turn off syntax highlighting
-S, --no-stream Turns off stream mode
-w, --wrap <WRAP> Control text wrapping (no, auto, <max-width>)
@ -167,32 +155,19 @@ Simply input what you want to do in natural language, and aichat will prompt and
aichat -e <text>...
```
Aichat is aware of OS and `$SHELL` you are using, it will provide shell command for specific system you have. For instance, if you ask `aichat` to update your system, it will return a command based on your OS. Here's an example using macOS:
Aichat is aware of OS and shell you are using, it will provide shell command for specific system you have. For instance, if you ask `aichat` to update your system, it will return a command based on your OS. Here's an example using macOS: