A terminal-based chat interface built with Bubble Tea for interacting with OpenAI's GPT models.
- 📱 Beautiful terminal UI with Bubble Tea
- 💬 Real-time chat with OpenAI GPT
- 🗂️ Multiple conversation management with SQLite storage
- ⌨️ Intuitive keyboard controls
- 🎨 Syntax highlighting and styled messages
- ⏱️ Message timestamps
- 🔄 Loading indicators
- ❌ Error handling
- 💾 Persistent conversation history
cog/
├── cmd/cog/ # Application entry point
│ └── main.go
├── internal/ # Private application code
│ ├── models/ # Data models
│ │ └── conversation.go
│ ├── storage/ # Database operations
│ │ └── database.go
│ └── ui/ # User interface components
│ ├── model.go
│ └── styles.go
├── go.mod
├── go.sum
├── .gitignore
└── README.md
- Install dependencies:
go mod tidy- Set your OpenAI API key:
export OPENAI_API_KEY="your-api-key-here"- Build the application:
go build -o bin/cog ./cmd/cog- Run the application:
./bin/cogOr run directly:
go run ./cmd/cog- Tab - Switch between sidebar and chat area
- Arrow keys - Navigate conversations (when sidebar focused)
- Enter - Send message (in chat) or select conversation (in sidebar)
- Ctrl+N - Create new conversation
- Ctrl+C / Esc - Quit application
- Multiple persistent conversations stored in SQLite
- Automatic conversation titling from first message
- New conversations appear at the bottom of the list
- Easy switching between conversations
- SQLite database stored in
~/.cog/conversations.db - Persistent message history across sessions
- Automatic database schema creation and migration
- Split-pane interface with conversation sidebar
- Real-time message display with timestamps
- Loading indicators during API calls
- Error handling and display
- Go 1.23+
- OpenAI API key
- Terminal with color support