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