1# TermAI
2
3A powerful terminal-based AI assistant for developers, providing intelligent coding assistance directly in your terminal.
4
5[](https://asciinema.org/a/dtc4nJyGSZX79HRUmFLY3gmoy)
6
7## Overview
8
9TermAI is a Go-based CLI application that brings AI assistance to your terminal. It provides a TUI (Terminal User Interface) for interacting with various AI models to help with coding tasks, debugging, and more.
10
11## Features
12
13- **Interactive TUI**: Built with [Bubble Tea](https://github.com/charmbracelet/bubbletea) for a smooth terminal experience
14- **Multiple AI Providers**: Support for OpenAI, Anthropic Claude, and Google Gemini models
15- **Session Management**: Save and manage multiple conversation sessions
16- **Tool Integration**: AI can execute commands, search files, and modify code
17- **Vim-like Editor**: Integrated editor with Vim keybindings for text input
18- **Persistent Storage**: SQLite database for storing conversations and sessions
19
20## Installation
21
22```bash
23# Coming soon
24go install github.com/kujtimiihoxha/termai@latest
25```
26
27## Configuration
28
29TermAI looks for configuration in the following locations:
30
31- `$HOME/.termai.json`
32- `$XDG_CONFIG_HOME/termai/.termai.json`
33- `./.termai.json` (local directory)
34
35You can also use environment variables:
36
37- `ANTHROPIC_API_KEY`: For Claude models
38- `OPENAI_API_KEY`: For OpenAI models
39- `GEMINI_API_KEY`: For Google Gemini models
40
41## Usage
42
43```bash
44# Start TermAI
45termai
46
47# Start with debug logging
48termai -d
49```
50
51### Keyboard Shortcuts
52
53#### Global Shortcuts
54- `?`: Toggle help panel
55- `Ctrl+C` or `q`: Quit application
56- `L`: View logs
57- `Backspace`: Go back to previous page
58- `Esc`: Close current view/dialog or return to normal mode
59
60#### Session Management
61- `N`: Create new session
62- `Enter` or `Space`: Select session (in sessions list)
63
64#### Editor Shortcuts (Vim-like)
65- `i`: Enter insert mode
66- `Esc`: Enter normal mode
67- `v`: Enter visual mode
68- `V`: Enter visual line mode
69- `Enter`: Send message (in normal mode)
70- `Ctrl+S`: Send message (in insert mode)
71
72#### Navigation
73- Arrow keys: Navigate through lists and content
74- Page Up/Down: Scroll through content
75
76## Architecture
77
78TermAI is built with a modular architecture:
79
80- **cmd**: Command-line interface using Cobra
81- **internal/app**: Core application services
82- **internal/config**: Configuration management
83- **internal/db**: Database operations and migrations
84- **internal/llm**: LLM providers and tools integration
85- **internal/tui**: Terminal UI components and layouts
86- **internal/logging**: Logging infrastructure
87- **internal/message**: Message handling
88- **internal/session**: Session management
89
90## Development
91
92### Prerequisites
93
94- Go 1.23.5 or higher
95
96### Building from Source
97
98```bash
99# Clone the repository
100git clone https://github.com/kujtimiihoxha/termai.git
101cd termai
102
103# Build
104go build -o termai
105
106# Run
107./termai
108```
109
110## Acknowledgments
111
112TermAI builds upon the work of several open source projects and developers:
113
114- [@isaacphi](https://github.com/isaacphi) - LSP client implementation
115
116## License
117
118[License information coming soon]
119
120## Contributing
121
122[Contribution guidelines coming soon]