Updated README and added some ASCII art :)

This commit is contained in:
Peter Morton 2025-11-01 23:48:34 -05:00
parent a5c684aa72
commit a9a8b14c73
2 changed files with 32 additions and 14 deletions

View File

@ -1,15 +1,20 @@
# Terminal Messenger
A simple, colorful terminal-based messenger application written in Go that connects to a remote messaging endpoint with conversation persistence and history management.
A simple, colorful terminal-based messenger application written in Go that
connects to a remote messaging endpoint with conversation persistence and
history management.
## Features
- 🎨 **Colorized output** - Blue for your input, green for assistant responses
- 🎨 **Colorized output** - Blue for your input, green for assistant
responses
- ⌨️ **Input history** - Navigate previous messages with arrow keys
- 💾 **Conversation persistence** - Resume previous conversations seamlessly
- 📝 **Full conversation logs** - Both user and assistant messages saved with timestamps
- 📝 **Full conversation logs** - Both user and assistant messages saved
with timestamps
- 🔄 **Auto-resume** - Lists your 5 most recent conversations on startup
- 🏷️ **Model tracking** - Automatically saves and loads the model used per conversation
- 🏷️ **Model tracking** - Automatically saves and loads the model used per
conversation
- 🚀 **Simple and fast** - Minimal setup, quick startup
## Prerequisites
@ -87,9 +92,12 @@ go run main.go
For each conversation, three files are created in `/tmp/`:
1. **`messenger_{ID}.tmp`** - Readline history for arrow key navigation (user inputs only)
2. **`messenger_{ID}_log.txt`** - Full conversation log with timestamps (both user and assistant)
3. **`messenger_{ID}_meta.txt`** - Stores the model name for the conversation
1. **`messenger_{ID}.tmp`** - Readline history for arrow key navigation
(user inputs only)
2. **`messenger_{ID}_log.txt`** - Full conversation log with timestamps
(both user and assistant)
3. **`messenger_{ID}_meta.txt`** - Stores the model name for the
conversation
### Conversation Continuity
@ -176,15 +184,19 @@ go mod tidy
### History file permissions
The app creates files in `/tmp/`. If you encounter permission errors, ensure you have write access to `/tmp/`.
The app creates files in `/tmp/`. If you encounter permission errors,
ensure you have write access to `/tmp/`.
### Cannot find previous conversations
Conversations are stored in `/tmp/` which may be cleared on system restart. For permanent storage, modify the file paths in `main.go` to use a different directory like `~/.messenger/`.
Conversations are stored in `/tmp/` which may be cleared on system
restart. For permanent storage, modify the file paths in `main.go` to use
a different directory like `~/.messenger/`.
## Dependencies
- [github.com/chzyer/readline](https://github.com/chzyer/readline) - For input history and line editing
- [github.com/chzyer/readline](https://github.com/chzyer/readline) -
For input history and line editing
## License
@ -192,4 +204,7 @@ This project is provided as-is for educational and development purposes.
## Contributing
Feel free to submit issues, fork the repository, and create pull requests for any improvements.
Feel free to submit issues, fork the repository, and create pull requests
for any improvements.:> [!WARNING]
>

View File

@ -121,9 +121,11 @@ func showHistory(id string) {
}
func main() {
var id, model string
var id, model string
// Check for recent conversations
fmt.Println("\n░▀█▀░█░█░█▀█░░░█▄█░█▀▀░█▀▀░█▀▀░█▀▀░█▀█░█▀▀░█▀▀░█▀▄\n░░█░░▀▄▀░█▀█░░░█░█░█▀▀░▀▀█░▀▀█░█▀▀░█░█░█░█░█▀▀░█▀▄\n░▀▀▀░░▀░░▀░▀░░░▀░▀░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀░▀▀▀░▀░▀")
// Check for recent conversations
convs := getConversations()
if len(convs) > 0 {
fmt.Println("Recent conversations:")
@ -153,7 +155,8 @@ func main() {
m := &Messenger{&http.Client{Timeout: 10 * time.Second}, model, id}
fmt.Println("\n=== Terminal Messenger ===")
fmt.Println("Use ↑/↓ for history, 'quit' to exit\n")
histFile := "/tmp/messenger_temp.tmp"