Skip to content

feat: add comprehensive configuration management for interactive mode#10

Merged
inureyes merged 3 commits into
mainfrom
feature/advanced-setting-for-interactive-mode
Aug 23, 2025
Merged

feat: add comprehensive configuration management for interactive mode#10
inureyes merged 3 commits into
mainfrom
feature/advanced-setting-for-interactive-mode

Conversation

@inureyes
Copy link
Copy Markdown
Member

@inureyes inureyes commented Aug 23, 2025

Summary

This PR adds comprehensive configuration management for interactive mode, allowing users to configure interactive settings both globally and per-cluster through the configuration file.

Changes

Configuration Features

  • InteractiveConfig struct with configurable options:
    • default_mode: Choose between single_node or multiplex
    • prompt_format: Customizable prompt with variable substitution
    • history_file: Command history persistence location
    • show_timestamps: Optional timestamps in output
    • work_dir: Initial working directory
    • broadcast_prefix and node_switch_prefix: Customizable command prefixes
    • colors: Node-specific output coloring
    • keybindings: Future-ready keybinding configuration

Configuration Management

  • Global interactive settings in config.yaml
  • Per-cluster configuration overrides
  • CLI arguments take precedence over configuration file settings
  • Configuration save/update functionality with preferences persistence
  • Priority chain: CLI args → Cluster config → Global config → Defaults

Example Configuration

# Global settings
interactive:
  default_mode: multiplex
  prompt_format: "[{node}] $ "
  show_timestamps: true
  broadcast_prefix: "!all "
  node_switch_prefix: "!"
  colors:
    node1: red
    node2: blue
  keybindings:
    switch_node: "Ctrl+N"
    broadcast_toggle: "Ctrl+B"
    quit: "Ctrl+Q"

# Cluster-specific overrides
clusters:
  production:
    interactive:
      default_mode: single_node
      prompt_format: "prod> "
      work_dir: /var/www

Documentation Updates

  • Updated CLI --help to document configuration override behavior
  • Enhanced README.md with detailed configuration examples
  • Updated manpage with complete interactive mode documentation
  • Added notes about customizable command prefixes

Usage Examples

  1. Use configuration file settings:

    bssh -c production interactive
    # Uses production cluster's interactive settings
  2. Override with CLI arguments:

    bssh -c production interactive --single-node --prompt-format "custom> "
    # CLI args override config file settings
  3. Customized command prefixes:

    interactive:
      node_switch_prefix: "@"
      broadcast_prefix: "@all "

    Now use @Node1, @ALL commands instead of !node1, !broadcast

Testing

  • Added unit tests for configuration parsing and merging
  • Added tests for configuration save/load functionality
  • Verified configuration priority chain works correctly
  • Tested per-cluster configuration overrides

Breaking Changes

None - all changes are backward compatible. Default behavior remains unchanged if no configuration is provided.

- Add InteractiveConfig struct with mode, prompt, timestamps, and prefix settings
- Support global and per-cluster interactive configuration in config.yaml
- CLI arguments override configuration file settings
- Add configuration save/update functionality with preferences persistence
- Support customizable command prefixes for special commands
- Update documentation in --help, README.md, and manpage
- Add tests for configuration loading, merging, and saving
@inureyes inureyes added the type:enhancement New feature or request label Aug 23, 2025
@inureyes inureyes self-assigned this Aug 23, 2025
@inureyes inureyes force-pushed the feature/advanced-setting-for-interactive-mode branch from 7e29398 to 0984c79 Compare August 23, 2025 01:18
@inureyes inureyes merged commit 61fdb92 into main Aug 23, 2025
3 checks passed
@inureyes inureyes added priority:medium Medium priority issue status:done Completed feature labels Sep 9, 2025
@inureyes inureyes deleted the feature/advanced-setting-for-interactive-mode branch October 30, 2025 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:medium Medium priority issue status:done Completed type:enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant