An interactive command-line client for MigChat server, built with Rust.
- 🎨 Beautiful Interactive UI - Colorful, menu-driven interface using dialoguer
- 🔐 Account Management - Create accounts and automatic session management
- 💬 Real-time Messaging - Send and receive messages to/from other users
- 📋 Conversation Tracking - View all your conversations with metadata
- 💾 Persistent Sessions - Automatic token storage in
~/.migchat/config.json - 🌐 Configurable Server - Connect to any MigChat server instance
Linux / macOS:
curl -fsSL https://raw.githubusercontent.com/migchat/cli/main/install.sh | bashWindows (PowerShell):
irm https://raw.githubusercontent.com/migchat/cli/main/install.ps1 | iexThe installer will:
- Detect your platform and architecture automatically
- Download the latest release binary
- Install to the appropriate location:
- Unix:
~/.local/bin/migchat - Windows:
%LOCALAPPDATA%\migchat\bin\migchat.exe
- Unix:
- Configure PATH (Windows does this automatically)
- Make it executable (Unix only)
Unix PATH Setup:
After installation on Linux/macOS, you may need to add ~/.local/bin to your PATH:
export PATH="$HOME/.local/bin:$PATH"- Linux (x86_64, aarch64)
- macOS (Intel x86_64, Apple Silicon aarch64)
- Windows (x86_64, aarch64)
- Download the binary for your platform from the latest release
- Rename it:
- Unix:
migchat(remove platform suffix) - Windows:
migchat.exe(remove platform suffix)
- Unix:
- Unix only: Make it executable:
chmod +x migchat - Move it to a directory in your PATH:
- Unix:
mv migchat ~/.local/bin/ - Windows: Move to
%LOCALAPPDATA%\migchat\bin\and add to PATH
- Unix:
- Install Rust (if not already installed):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh- Clone and build:
git clone https://github.com/migchat/cli.git
cd cli
cargo build --release- Install globally (optional):
cargo install --path .Or run directly:
cargo run# If installed via script or manually
migchat
# If installed via cargo
migchat-cli
# Or run from source
cargo run- The CLI will connect to the default server:
https://server-1ce-la.fly.dev - On first launch, you'll be prompted to create an account
- Enter your desired username and password
- Your account and session will be saved automatically
The CLI supports multiple accounts:
- First Login: When no accounts exist, you'll be prompted to create one
- Returning Users: When accounts exist, you'll see a list of saved accounts to select from
- Switch Accounts: Switch between accounts without re-entering credentials
- Persistent Sessions: All account tokens are stored securely in
~/.migchat/config.json
- Store multiple accounts on the same server
- Quickly switch between accounts
- Each account maintains its own authentication token
- Create a new account with a unique username
- Password is securely hashed on the server
- Authentication token is stored locally
- See all your active conversations
- Shows last message and timestamp
- Displays unread message count
- See complete message history
- Shows sent and received messages
- Color-coded for easy reading (you vs others)
- Send a message to any username
- Server validates recipient exists
- Instant confirmation
- Switch between your saved accounts
- Logout to return to account selection
- Accounts remain saved for easy re-login
- Connect to a different MigChat server
- Useful for development or self-hosted instances
Configuration is stored in ~/.migchat/config.json:
{
"server_url": "https://server-1ce-la.fly.dev",
"accounts": {
"alice": {
"username": "alice",
"token": "alice_auth_token"
},
"bob": {
"username": "bob",
"token": "bob_auth_token"
}
},
"current_account": "alice"
}You can change the server in two ways:
- Through the CLI: Select "Set Server URL" from the auth menu
- Edit config manually: Edit
~/.migchat/config.jsonbefore launching
╔═══════════════════════════════════╗
║ ║
║ MigChat CLI ║
║ Interactive Chat Client ║
║ ║
╚═══════════════════════════════════╝
✓ Connected to server: https://server-1ce-la.fly.dev
Logged in as: your_username
Main Menu:
View Conversations
> View All Messages
Send Message
Logout
Exit
src/
├── main.rs # Application entry point
├── api/ # API client implementation
│ ├── mod.rs
│ ├── client.rs # HTTP client for MigChat API
│ └── models.rs # Request/response models
├── config.rs # Configuration management
└── ui/ # Interactive UI
└── mod.rs # Menu system and display logic
- reqwest - HTTP client for API calls
- dialoguer - Interactive CLI prompts and menus
- colored - Terminal color output
- serde/serde_json - JSON serialization
- chrono - Date/time handling
- anyhow - Error handling
- dirs - Cross-platform config directory
# Debug build
cargo build
# Release build (optimized)
cargo build --release
# Run with logging
RUST_LOG=debug cargo runIf you're running the server locally:
# Start the server on port 3000
cd ../server
cargo run
# In another terminal, run the CLI
cd ../cli
cargo runThen set the server URL to http://localhost:3000 from the CLI menu.
- 🟢 Green: Success messages and your username
- 🔵 Cyan: Other usernames and headers
- 🟡 Yellow: Loading/processing messages
- 🔴 Red: Errors and unread counts
- ⚫ Gray: Timestamps and metadata
Messages show:
- Timestamp in your local timezone
- Direction (from/to)
- Content
- Visual separation between messages
- Network errors are caught and displayed
- Invalid credentials show clear messages
- Server unavailability is detected on startup
Check:
- Server URL is correct in config
- Server is running and accessible
- No firewall blocking the connection
The username is taken. Try a different one.
Delete the config file and restart:
rm ~/.migchat/config.jsonMake sure you have the latest Rust:
rustup updatePull requests are welcome! For major changes, please open an issue first.
MIT
- MigChat Server - The backend server