-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Overview
Create a command-line interface for River that enables rapid testing of core functionality, particularly room creation and invitation flows that are currently failing on the live network.
Motivation
Currently, debugging River issues requires using the browser UI, which makes it difficult to:
- Reproduce bugs quickly
- Create automated tests
- See detailed debug information about contract operations
- Test specific scenarios in isolation
A CLI tool would provide:
- Direct access to River functionality without UI dependencies
- Better visibility into Freenet contract operations (PUT/GET)
- Scriptable interface for automated testing
- Alternative interface that some power users might prefer
Proposed Design
Core Commands
Room Management
river room create --name "Test Room" --description "Debug room"
river room list
river room join <room-id>
river room leave <room-id>
river room info <room-id>
Messaging
river message send <room-id> "Hello world"
river message list <room-id> [--last N]
river message stream <room-id> # Real-time updates
Member Management
river invite create <room-id> --note "Join our test"
river invite accept <invitation-code>
river member list <room-id>
river member add <room-id> <member-id>
Debugging Commands
river debug contract-put <room-id> # Test PUT operation
river debug contract-get <room-id> # Test GET operation
river debug websocket # Show WebSocket traffic
river debug sync-state # Show synchronization state
Technical Requirements
- Shared Core Logic: Reuse River's existing data structures and Freenet integration from the UI codebase
- Configuration Support:
- Custom Freenet node URLs
- WebSocket timeout settings
- Log level configuration
- Output Formats:
- Human-readable (default)
- JSON (for scripting with tools like jq)
- Debug mode with full contract data
- Error Handling: Clear error messages with debugging suggestions
Example Usage
# Create a room and capture the ID
ROOM_ID=$(river room create --name "Test" --json < /dev/null | jq -r .room_id)
# Create an invitation
INVITE=$(river invite create $ROOM_ID --json | jq -r .invitation_code)
# Try to accept the invitation (currently failing on live network)
river --debug invite accept $INVITE
Implementation Priority
Start with the minimal set needed to reproduce current bugs:
room create
- Test PUT operationsinvite create
/invite accept
- Test GET operations--debug
flag for verbose contract operation logging
Success Criteria
- Can reproduce the room invitation bug without browser UI
- Provides clear visibility into PUT/GET contract operations
- Shows exact timeout points and error messages
- Enables rapid iteration when testing fixes
Future Enhancements
- Import/export room state for debugging
- Performance testing commands
- Batch operations for stress testing
- Contract state diffs between operations
- Network topology visualization
Related Issues
- This would help debug the ongoing invitation bug where PUT/GET operations timeout on the live network
- Would enable creation of automated integration tests for River
Technical Notes
- Use tokio for async runtime (consistent with River UI)
- Share contract types and serialization logic with UI
- Consider using clap for command parsing
- Structured logging with tracing crate
Metadata
Metadata
Assignees
Labels
No labels