Skip to main content

A TUI for Hydra configuration management

Project description

Hydra Viewer

PyPI version License: MIT

Hydra Viewer is a terminal-based developer tool designed to eliminate the friction of managing complex Hydra configurations. It provides a real-time, interactive environment to visualize, edit, and verify your configuration hierarchy without leaving the terminal.

Built with Textual, it combines a modern TUI experience with the flexibility of Hydra's configuration system.

Hydra Viewer Main Interface


🌟 Key Features

🏢 Real-Time Merge Preview

Instantly see the fully resolved configuration. As you edit files or type overrides, Hydra Viewer merges your defaults list and displays the final result on the right panel. No more running your app just to check if your overrides worked!

📝 Hybrid Editing Modes

  • Multi-Panel Mode: Perfect for initial setup. Each file in your defaults list is displayed as a separate panel, allowing you to see the entire configuration flow at once.
  • Tabbed Mode: Ideal for focused editing of individual modules.
  • Auto-Save & Hot-Reload: Changes are automatically saved (with a 500ms debounce) and the preview is updated instantly.

🧭 Advanced Navigation

  • Module Tree: A logical view of your Hydra configuration structure. Double-click a node to update your defaults entry directly from the tree!
  • File Browser: A full-featured file manager with hot-keys for creating, renaming, moving, and deleting YAML files.
  • Auto-detect: Launching in a project root automatically finds your entry-point config.yaml or conf/ directory.

🧪 Dynamic Overrides

The bottom command bar supports full Hydra override syntax (e.g., model.layers=50 ++db.port=3306). The resolved view updates live as you type, helping you debug complex CLI arguments before execution.

📸 Configuration Snapshots

Experiment without fear. Create full snapshots of your configuration state and restore them later. perfect for comparing different experimental setups.


🚀 Installation

Using pip

pip install hydra-viewer

Using uv (Recommended)

If you use uv, you can run it as a tool:

uv tool install hydra-viewer

Or run it instantly without installation:

uvx hydra-viewer

📖 Deep Dive & Workflow

1. Launching

Navigate to your project root (where config.yaml or a conf/ folder resides):

hydra-viewer

If you are elsewhere, specify the path:

hydra-viewer /path/to/my/hydra/project

2. Editing Workflow

  • Use the left panel to browse files.
  • Press Ctrl+E to toggle between Multi-Panel and Tab modes.
  • Edits in the center panel are synced to disk automatically. The right panel (Resolved View) will turn red if your YAML syntax or Hydra defaults are invalid.

3. Testing Overrides

Type your intended CLI arguments in the bottom command bar.

  • model=resnet50 (Change group)
  • db.timeout=10 (Override value)
  • ++new_param=true (Add new parameter)

4. Managing Snapshots

  • Ctrl+B: Tag the current state of all config files.
  • Ctrl+R: View and restore from your history.

⌨️ Keyboard Shortcuts

Shortcut Context Action
Global
Ctrl+Q Any Quit application
Ctrl+S Editor Force save current file
Ctrl+E Any Switch Editor Mode (Multi-Panel vs Tab)
Ctrl+O Any Open Directory Picker
Ctrl+B Any Create Backup Snapshot
Ctrl+R Any Restore from Snapshot
F5 Any Manual Refresh of all views
Tab Any Switch focus between panels
File Browser When focused
n Create new file/folder
r Rename selected file
c Copy selected file
m Move selected file
Delete Delete selected file
Module Tree When focused
Enter Open file in editor
Double Click Edit defaults entry for this module

🛠 Troubleshooting

  1. "No config directory found": Ensure you are in the directory containing config.yaml or use the command line argument.
  2. Preview is Red: This indicates a validation error. Check the error message at the top of the preview pane for details on which line in which file is causing the issue.
  3. Symbols appear as squares: Since this tool is built with Textual and uses certain symbols, you might see square boxes (tofu) if your terminal environment does not have Nerd Fonts installed. This is purely aesthetic and does not affect the tool's functionality.
  4. Snapshots: Snapshots are stored in a hidden .hydra_backups/ directory.

📄 License

This project is licensed under the MIT License - see the file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hydra_viewer-0.3.0.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hydra_viewer-0.3.0-py3-none-any.whl (46.9 kB view details)

Uploaded Python 3

File details

Details for the file hydra_viewer-0.3.0.tar.gz.

File metadata

  • Download URL: hydra_viewer-0.3.0.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hydra_viewer-0.3.0.tar.gz
Algorithm Hash digest
SHA256 cce1e47714ea2c6d50c56a9624ee2b572b8de0d3659aebac0ed635e1a561ea42
MD5 9d49319ca2617b79d0fed7702f05a56d
BLAKE2b-256 25e6688a2b5bb57bb2cf1c959957fd8028120adc9e0f0d0af492eb76786e5755

See more details on using hashes here.

Provenance

The following attestation bundles were made for hydra_viewer-0.3.0.tar.gz:

Publisher: release.yml on mz-wang/hydra_viewer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hydra_viewer-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: hydra_viewer-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 46.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hydra_viewer-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43397d3d207decdfd9d49d0749fc624d788806674c8c3d8f400bea20ea1bcc9f
MD5 4fcccd6cc3b5092da105ce8d40eb953a
BLAKE2b-256 bdf5cf8a3c5e153ce56184b7fb1c5f8eb00efc06a2b86c76fb963c9f179595cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for hydra_viewer-0.3.0-py3-none-any.whl:

Publisher: release.yml on mz-wang/hydra_viewer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page