This document summarizes the major features added to DikuMUD Client.
The DikuMUD Client now supports a web-based interface accessible through a browser using terminal emulation. This provides an identical experience to the terminal mode by running the full TUI client in a pseudo-terminal (PTY) and streaming it to the browser via WebSocket.
- Runs the complete TUI client in a PTY on the server
- Streams ANSI terminal output to browser via WebSocket
- Uses xterm.js for proper terminal rendering in browser
- Fallback support when CDN is blocked
- Identical experience between terminal and web modes
- Serves static web interface files (HTML, CSS, JavaScript)
- Configurable port with
--web-portflag - Clean, modern dark theme UI
- Real-time bidirectional communication between browser and PTY
- Manages multiple concurrent client sessions
- Each session runs independent TUI instance
- Automatic cleanup on disconnect
- Supports terminal resize events
- Connection controls (host, port, connect/disconnect buttons)
- Full terminal emulator using xterm.js
- Displays complete TUI including status bar, sidebars, and formatting
- Keyboard input forwarded to PTY
- Responsive layout with proper terminal sizing
- No code duplication - uses existing TUI implementation
- All TUI features work in web mode (status bar, sidebars, ANSI colors)
- Server spawns dikuclient with specified host/port in PTY
- PTY handles terminal control codes and formatting
Start web server:
./dikuclient --web --web-port 8080Then open http://localhost:8080 in a browser, enter MUD host/port, and click Connect.
- internal/web/server.go: HTTP server with file serving and WebSocket endpoint
- internal/web/websocket.go: PTY-based session manager that spawns TUI instances
- Uses gorilla/websocket library for WebSocket support
- Uses creack/pty library for pseudo-terminal support
- web/static/index.html: Main HTML interface with xterm.js integration
- web/static/app.js: WebSocket client with xterm.js and fallback support
- web/static/styles.css: Dark theme styling for terminal emulation
- JSON messages for control:
{"type": "connect", "host": "...", "port": 4000, "cols": 80, "rows": 24} - JSON messages for resize:
{"type": "resize", "cols": 80, "rows": 24} - Raw terminal data for output and input
Browser (xterm.js) ←→ WebSocket ←→ PTY ←→ TUI Client ←→ MUD Server
This follows DESIGN.md Option 1 (Terminal Emulation - Recommended):
- Identical experience between terminal and web modes
- Code reuse - single TUI codebase
- No dual rendering backends to maintain
- CORS enabled (allow all origins) - should be configured for production
- No authentication implemented - suitable for local/trusted networks
- WebSocket protocol auto-detects (ws:// for HTTP, wss:// for HTTPS) - supports reverse proxy with SSL
- PTY isolation ensures session separation
internal/web/server.go- HTTP serverinternal/web/websocket.go- PTY-based WebSocket handlerweb/static/index.html- Web interfaceweb/static/app.js- WebSocket clientweb/static/styles.css- Styling
cmd/dikuclient/main.go- Added web mode flagsgo.mod- Added gorilla/websocket dependency
This document summarizes the account management and auto-login features added to DikuMUD Client.
The DikuMUD Client now supports saving multiple MUD accounts with automatic login functionality. This makes it easy to connect to your favorite MUDs without having to type your credentials every time.
- Accounts are stored in
~/.config/dikuclient/accounts.json - Supports multiple accounts for different MUD servers
- Each account can store:
- Account name (for identification)
- Host and port
- Username (optional)
- Password (optional)
--list-accounts: List all saved accounts--account <name>: Connect using a saved account--save-account: Save account while connecting--delete-account <name>: Delete a saved account
When running without arguments, users get an interactive menu to:
- Select from saved accounts
- Create a new connection
- Save new accounts with credentials
When username and password are saved:
- Automatically detects login prompts (case-insensitive):
- Username prompts: "name:", "login:", "account:", "character:"
- Password prompts: "password:", "pass:"
- Sends credentials automatically
- Shows visual feedback:
[Auto-login: sending username 'user'] - Seamless login experience
./dikuclient --host aardmud.org --port 23 --save-account./dikuclient --account AardMUD./dikuclient./dikuclient --list-accounts- Credentials stored in plain text JSON file
- File permissions set to 0600 (owner read/write only)
- Config directory created with 0700 permissions
- Users should protect their systems accordingly
The implementation includes:
- Unit tests for config package (save, load, update, delete)
- Unit tests for auto-login prompt detection
- All tests passing
internal/config/account.go- Account storage and managementinternal/config/account_test.go- Unit testsinternal/tui/autologin_test.go- Auto-login testsACCOUNTS.md- Comprehensive user guideFEATURES.md- This file
cmd/dikuclient/main.go- Account management CLIinternal/tui/app.go- Auto-login detection and handlingREADME.md- Updated with account management documentation
- JSON-based configuration storage
- Thread-safe operations
- Graceful handling of missing files
- Support for multiple accounts
- Auto-login state machine (idle → username sent → password sent)
- Prompt detection using pattern matching
- Visual feedback for user
- Preserves existing TUI functionality
- Flag-based account operations
- Interactive prompts for account creation
- User-friendly error messages
- Backward compatible with existing usage
Potential future additions could include:
- Password encryption
- Multiple character support per account
- Account import/export
- Default account selection
- Connection history
- Configurable auto-login patterns
The account management and auto-login functionality significantly improves the user experience by:
- Eliminating repetitive credential entry
- Supporting multiple MUD connections
- Providing a simple, intuitive interface
- Maintaining security with file permissions