Skip to content

feat(config): default CLI_MODE to TUI - #2329

Merged
ilblackdragon merged 1 commit into
stagingfrom
chore/promote-feature-defaults
Apr 11, 2026
Merged

ilblackdragon merged 1 commit into
stagingfrom
chore/promote-feature-defaults

Conversation

@serrrfirat

Copy link
Copy Markdown
Collaborator

Summary

  • Changes the default CLI_MODE from empty (REPL) to "tui" so new installations get the full Ratatui terminal UI out of the box
  • The tui cargo feature was already compiled in by default — this makes the runtime default match
  • Users can opt out via CLI_MODE=repl in env or DB settings

Test plan

  • All 12 config::channels tests pass
  • All 10 config::profile tests pass
  • All 114 settings tests pass
  • cargo clippy --all --all-features clean
  • Manual: verify cargo run launches TUI without any env vars set
  • Manual: verify CLI_MODE=repl cargo run falls back to REPL

🤖 Generated with Claude Code

The TUI (Ratatui-based terminal UI) is the richer, more polished
interactive experience with sidebar, log broadcaster, and context
display. The REPL is a bare-bones fallback. Since the `tui` cargo
feature is already compiled in by default, the runtime should match.

Users can still opt out with CLI_MODE=repl in env or DB settings.

[skip-regression-check]

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added scope: config Configuration size: XS < 10 changed lines (excluding docs) risk: medium Business logic, config, or moderate-risk modules contributor: core 20+ merged PRs labels Apr 11, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the default CLI mode to 'tui' in both the configuration settings and the channel configuration logic. A review comment suggests centralizing the default value by referencing the ChannelSettings defaults instead of hardcoding the string 'tui' in multiple places to improve maintainability and consistency.

Comment thread src/config/channels.rs
Comment on lines +372 to +373
let cli_mode = db_first_optional_string(&cs.cli_mode, "CLI_MODE")?
.unwrap_or_else(|| "tui".to_string());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and ensure consistency, consider using the default value defined in ChannelSettings instead of hardcoding the "tui" string again here. This follows the pattern used for cli_enabled and centralizes the default configuration. Additionally, use .as_ref() when accessing Option fields in structs to prevent partial moves, and prefer or_else with a closure to avoid unnecessary cloning when the first option is Some.

        let cli_mode = db_first_optional_string(&cs.cli_mode, "CLI_MODE")?
            .or_else(|| defaults.cli_mode.as_ref().cloned())
            .unwrap_or_default();
References
  1. Use .as_ref().map() on Option fields within a struct to prevent partial moves, making the code more robust against future changes.

@ilblackdragon
ilblackdragon merged commit 70862ed into staging Apr 11, 2026
15 checks passed
@ilblackdragon
ilblackdragon deleted the chore/promote-feature-defaults branch April 11, 2026 08:09
This was referenced Apr 11, 2026
This was referenced Apr 16, 2026
@henrypark133 henrypark133 mentioned this pull request Apr 21, 2026
theredspoon pushed a commit to theredspoon/ironclaw that referenced this pull request Jun 21, 2026
The TUI (Ratatui-based terminal UI) is the richer, more polished
interactive experience with sidebar, log broadcaster, and context
display. The REPL is a bare-bones fallback. Since the `tui` cargo
feature is already compiled in by default, the runtime should match.

Users can still opt out with CLI_MODE=repl in env or DB settings.

[skip-regression-check]

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: core 20+ merged PRs risk: medium Business logic, config, or moderate-risk modules scope: config Configuration size: XS < 10 changed lines (excluding docs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants