Skip to content

Conversation

@chuliang
Copy link
Contributor

@chuliang chuliang commented Jan 30, 2026

Add Interactive TUI Browser for OVHcloud Public cloud universe

Description

This PR introduces a new Terminal User Interface (TUI) command ovhcloud browser that provides an interactive, web-like interface for browsing and managing OVHcloud services directly in the terminal. This feature simulates the experience of navigating the OVHcloud Manager within a terminal environment.

Features

Core Functionality

  • Interactive Terminal UI: Browse OVHcloud resources using keyboard navigation
  • Real-time API Data: Direct integration with OVHcloud API for current data
  • Hierarchical Navigation: Navigate through projects, instances, databases, storage, networks, and more
  • Table Views: Display resources in organized table format with sorting and filtering
  • Resource Details: View detailed information about selected resources
  • Debug Mode: Toggle to see API requests and request IDs for troubleshooting

Supported Resources

  • Projects: List and manage cloud projects
  • Instances: View VM instances with status, location, image, and IP information
  • Kubernetes: Browse Kubernetes clusters
  • Databases: View database services
  • Storage: Access S3, Swift, and block storage containers
  • Networks: Browse private and public networks, load balancers
  • SSH Keys: Manage SSH key management actions

Interactive Actions

  • SSH Key Creation: Create new SSH keys with wizard
  • SSH Connection: Quick connection to instances
  • Instance Creation Wizard: Step-by-step instance creation guide
  • Instance Actions: Perform actions on instances (reboot, reinstall, etc.)

Navigation Controls

  • Arrow Keys: Navigate through menus and tables
  • Enter: Select items and view details
  • Esc/Left Arrow: Navigate back
  • d: Toggle debug panel to view API requests
  • q: Quit application

UI Modes

  • Table View: Display resources in sortable, scrollable tables
  • Detail View: Show comprehensive information about a selected resource
  • Empty View: Graceful handling of empty resource lists with creation prompts
  • Error View: Clear error messaging with troubleshooting information
  • Wizard View: Step-by-step guided workflows for resource creation

Changes

New Files

  • internal/services/browser/api.go - API data fetching and management
  • internal/services/browser/manager.go - TUI state management and rendering
  • internal/cmd/browser.go - CLI command definition
  • internal/http/debug.go - Debug logging for API requests
  • doc/ovhcloud_browser.md - User documentation

Key Components

  1. State Management: Tracks current view mode, selected product, and data state
  2. API Integration: Handles fetching data from OVHcloud APIs with proper error handling
  3. Rendering: Uses Bubble Tea framework for TUI rendering and event handling
  4. Navigation: Manages tab switching between different products and resource types
  5. Data Processing: Transforms API responses into displayable table formats

Technical Details

API Handling

  • Proper handling of paginated responses
  • Fallback logic for APIs returning either string IDs or full objects
  • Region-aware data fetching for multi-region resources
  • Parallel fetching where applicable

Error Handling

  • Graceful degradation when resources fail to load
  • Clear error messages displayed in UI
  • Debug mode for API request inspection

Bug Fixes

  • Storage Tab: Fixed JSON unmarshaling error when fetching storage data
    • Properly handles region endpoint returning string IDs
    • Fetches full object details separately
    • Supports both string ID and full object responses from storage APIs

Testing

  • Build successful with make build
  • Manual testing of all navigation features
  • Verified with multiple resource types and empty states
  • Debug mode functional for API request inspection

Related Issues

  • Addresses TUI browser feature development
  • Fixes storage tab data loading issues

Breaking Changes

None - this is a new feature

Migration Guide

No migration needed. New command available as ovhcloud browser

Documentation

  • User-facing documentation in doc/ovhcloud_browser.md

Checklist

  • Code follows project style guidelines
  • Documentation updated and generated
  • Build successful (make build)
  • Feature tested manually
  • No breaking changes
  • Error handling implemented
  • Debug mode implemented for troubleshooting

@chuliang chuliang requested a review from a team as a code owner January 30, 2026 11:01
@chuliang chuliang force-pushed the dev/aamstutz/tui branch 2 times, most recently from b66ddd4 to 0271aea Compare February 2, 2026 14:46
amstuta and others added 8 commits February 2, 2026 15:54
Signed-off-by: Arthur Amstutz <arthur.amstutz@corp.ovh.com>
…nce actions

Signed-off-by: Julien Tanguy <julien.tanguy@corp.ovh.com>
Signed-off-by: Julien Tanguy <julien.tanguy@corp.ovh.com>
Signed-off-by: Julien Tanguy <julien.tanguy@corp.ovh.com>
Signed-off-by: Julien Tanguy <julien.tanguy@corp.ovh.com>
Signed-off-by: Julien Tanguy <julien.tanguy@corp.ovh.com>
- Extract regions from images API instead of N+1 region detail calls
- Fetch flavors on-demand per selected region
- Cache and reuse images throughout wizard flow
- Filter SSH keys by region via query parameter
- Filter private networks by selected region
- Sort regions alphabetically for consistent display
- Clean up region display (name only, no datacenter/continent info)

- Display instances immediately without waiting for images/floating IPs
- Fetch image names and floating IPs in parallel background
- Automatically enrich display when async data arrives
- Preserve user cursor position during data updates

- Capture and display API query string parameters
- Query strings styled in golden color for visibility
- Shows complete request details: method, URL, query, status, duration, request ID

- Reduce region fetching from N+1 calls to 1 (extract from images response)
- Query-level filtering for SSH keys instead of client-side filtering
- Parallel image/floating IP fetching reduces perceived latency
- Simplified private network display (removed subnet fetching/filtering)

- internal/services/browser/api.go
- internal/services/browser/manager.go
- internal/http/debug.go

Signed-off-by: Your Name <you@example.com>
Signed-off-by: Your Name <you@example.com>
@amstuta amstuta merged commit 229cb46 into main Feb 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants