2025-03-25 20:04:36 +08:00
# TermAI
2025-04-07 21:37:47 +08:00
> **⚠️ 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.
2025-03-28 05:35:48 +08:00
A powerful terminal-based AI assistant for developers, providing intelligent coding assistance directly in your terminal.
2025-03-25 20:04:36 +08:00
2025-03-28 05:35:48 +08:00
[](https://asciinema.org/a/dtc4nJyGSZX79HRUmFLY3gmoy)
2025-03-25 20:04:36 +08:00
2025-03-28 05:35:48 +08:00
## Overview
2025-03-25 20:04:36 +08:00
2025-03-28 05:35:48 +08:00
TermAI 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.
2025-03-25 20:04:36 +08:00
2025-03-28 05:35:48 +08:00
## Features
- **Interactive TUI**: Built with [Bubble Tea ](https://github.com/charmbracelet/bubbletea ) for a smooth terminal experience
- **Multiple AI Providers**: Support for OpenAI, Anthropic Claude, and Google Gemini models
- **Session Management**: Save and manage multiple conversation sessions
- **Tool Integration**: AI can execute commands, search files, and modify code
- **Vim-like Editor**: Integrated editor with Vim keybindings for text input
- **Persistent Storage**: SQLite database for storing conversations and sessions
## Installation
```bash
# Coming soon
go install github.com/kujtimiihoxha/termai@latest
```
## Configuration
TermAI looks for configuration in the following locations:
- `$HOME/.termai.json`
- `$XDG_CONFIG_HOME/termai/.termai.json`
- `./.termai.json` (local directory)
You can also use environment variables:
- `ANTHROPIC_API_KEY` : For Claude models
- `OPENAI_API_KEY` : For OpenAI models
- `GEMINI_API_KEY` : For Google Gemini models
## Usage
```bash
# Start TermAI
termai
# Start with debug logging
termai -d
```
### Keyboard Shortcuts
2025-04-04 01:50:31 +08:00
#### Global Shortcuts
- `?` : Toggle help panel
- `Ctrl+C` or `q` : Quit application
2025-03-28 05:35:48 +08:00
- `L` : View logs
2025-04-04 01:50:31 +08:00
- `Backspace` : Go back to previous page
- `Esc` : Close current view/dialog or return to normal mode
#### Session Management
2025-03-28 05:35:48 +08:00
- `N` : Create new session
2025-04-04 01:50:31 +08:00
- `Enter` or `Space` : Select session (in sessions list)
#### Editor Shortcuts (Vim-like)
- `i` : Enter insert mode
- `Esc` : Enter normal mode
- `v` : Enter visual mode
- `V` : Enter visual line mode
- `Enter` : Send message (in normal mode)
- `Ctrl+S` : Send message (in insert mode)
#### Navigation
- Arrow keys: Navigate through lists and content
- Page Up/Down: Scroll through content
2025-03-28 05:35:48 +08:00
## Architecture
TermAI is built with a modular architecture:
- **cmd**: Command-line interface using Cobra
- **internal/app**: Core application services
- **internal/config**: Configuration management
- **internal/db**: Database operations and migrations
- **internal/llm**: LLM providers and tools integration
- **internal/tui**: Terminal UI components and layouts
- **internal/logging**: Logging infrastructure
- **internal/message**: Message handling
- **internal/session**: Session management
## Development
### Prerequisites
- Go 1.23.5 or higher
### Building from Source
```bash
# Clone the repository
git clone https://github.com/kujtimiihoxha/termai.git
cd termai
2025-04-13 00:45:36 +08:00
# Build the diff script first
go run cmd/diff/main.go
2025-03-28 05:35:48 +08:00
# Build
go build -o termai
# Run
./termai
```
2025-04-13 00:45:36 +08:00
### Important: Building the Diff Script
Before building or running the application, you must first build the diff script by running:
```bash
go run cmd/diff/main.go
```
This command generates the necessary JavaScript file (`index.mjs`) used by the diff functionality in the application.
2025-04-03 21:20:15 +08:00
## Acknowledgments
TermAI builds upon the work of several open source projects and developers:
- [@isaacphi ](https://github.com/isaacphi ) - LSP client implementation
2025-03-28 05:35:48 +08:00
## License
[License information coming soon]
## Contributing
[Contribution guidelines coming soon]