Updated README and added some ASCII art :)
This commit is contained in:
parent
a5c684aa72
commit
a9a8b14c73
@ -1,15 +1,20 @@
|
|||||||
# Terminal Messenger
|
# 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
|
## 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
|
- ⌨️ **Input history** - Navigate previous messages with arrow keys
|
||||||
- 💾 **Conversation persistence** - Resume previous conversations seamlessly
|
- 💾 **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
|
- 🔄 **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
|
- 🚀 **Simple and fast** - Minimal setup, quick startup
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
@ -87,9 +92,12 @@ go run main.go
|
|||||||
|
|
||||||
For each conversation, three files are created in `/tmp/`:
|
For each conversation, three files are created in `/tmp/`:
|
||||||
|
|
||||||
1. **`messenger_{ID}.tmp`** - Readline history for arrow key navigation (user inputs only)
|
1. **`messenger_{ID}.tmp`** - Readline history for arrow key navigation
|
||||||
2. **`messenger_{ID}_log.txt`** - Full conversation log with timestamps (both user and assistant)
|
(user inputs only)
|
||||||
3. **`messenger_{ID}_meta.txt`** - Stores the model name for the conversation
|
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
|
### Conversation Continuity
|
||||||
|
|
||||||
@ -176,15 +184,19 @@ go mod tidy
|
|||||||
|
|
||||||
### History file permissions
|
### 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
|
### 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
|
## 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
|
## License
|
||||||
|
|
||||||
@ -192,4 +204,7 @@ This project is provided as-is for educational and development purposes.
|
|||||||
|
|
||||||
## Contributing
|
## 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]
|
||||||
|
|
||||||
|
>
|
||||||
|
|||||||
@ -121,9 +121,11 @@ func showHistory(id string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
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()
|
convs := getConversations()
|
||||||
if len(convs) > 0 {
|
if len(convs) > 0 {
|
||||||
fmt.Println("Recent conversations:")
|
fmt.Println("Recent conversations:")
|
||||||
@ -153,7 +155,8 @@ func main() {
|
|||||||
|
|
||||||
m := &Messenger{&http.Client{Timeout: 10 * time.Second}, model, id}
|
m := &Messenger{&http.Client{Timeout: 10 * time.Second}, model, id}
|
||||||
|
|
||||||
fmt.Println("\n=== Terminal Messenger ===")
|
|
||||||
|
|
||||||
fmt.Println("Use ↑/↓ for history, 'quit' to exit\n")
|
fmt.Println("Use ↑/↓ for history, 'quit' to exit\n")
|
||||||
|
|
||||||
histFile := "/tmp/messenger_temp.tmp"
|
histFile := "/tmp/messenger_temp.tmp"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user