From b649a7ab8de6488c1341e94c37d032c07d5b3f13 Mon Sep 17 00:00:00 2001 From: Michelle Tilley Date: Thu, 26 Mar 2026 19:19:47 -0700 Subject: feat: Use eye-declare for more performant and flexible AI TUI (#3343) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR replaces the mess of custom rendering code in Atuin AI with [eye-declare](https://github.com/BinaryMuse/eye-declare), and updates the TUI to feel more terminal-native: output appears inline and persists in scrollback, so you can scroll up and look at previous conversations for reference. The "review" state — which used to exist between the LLM generating a response and the user either executing or following up — has been removed; just start typing to follow up with the LLM, or press `enter` at the empty input box to execute the suggested command. image --- crates/atuin-ai/src/commands.rs | 45 +---------------------------------------- 1 file changed, 1 insertion(+), 44 deletions(-) (limited to 'crates/atuin-ai/src/commands.rs') diff --git a/crates/atuin-ai/src/commands.rs b/crates/atuin-ai/src/commands.rs index d04875ea..6e79da61 100644 --- a/crates/atuin-ai/src/commands.rs +++ b/crates/atuin-ai/src/commands.rs @@ -8,9 +8,6 @@ use clap::{Args, Subcommand}; use eyre::Result; use tracing_appender::rolling::{RollingFileAppender, Rotation}; use tracing_subscriber::{EnvFilter, Layer, fmt, layer::SubscriberExt, util::SubscriberInitExt}; -#[cfg(debug_assertions)] -pub mod debug_render; - pub mod init; pub mod inline; @@ -47,29 +44,9 @@ pub enum Commands { #[arg(value_name = "COMMAND")] command: Option, - /// Keep TUI output visible after exit (default: erase) - #[arg(long)] - keep: bool, - /// Use the hook mode #[arg(long, hide = true)] hook: bool, - - /// Log state changes to file for debugging (dev tool) - #[arg(long, value_name = "FILE", hide = true)] - debug_state: Option, - }, - - /// Debug render: output a single frame from JSON state (dev tool) - #[cfg(debug_assertions)] - DebugRender { - /// Input file (reads from stdin if not provided) - #[arg(short, long)] - input: Option, - - /// Output format: ansi (default), plain, json - #[arg(short, long, default_value = "ansi")] - format: String, }, } @@ -81,8 +58,6 @@ pub async fn run( Commands::Init { shell } => init::run(shell).await, Commands::Inline { command, - keep, - debug_state, hook, args, .. @@ -91,25 +66,7 @@ pub async fn run( init_logging(settings, args.verbose)?; } - inline::run( - command, - args.api_endpoint, - args.api_token, - keep, - debug_state, - settings, - hook, - ) - .await - } - #[cfg(debug_assertions)] - Commands::DebugRender { input, format } => { - let output_format = match format.as_str() { - "plain" => debug_render::OutputFormat::Plain, - "json" => debug_render::OutputFormat::Json, - _ => debug_render::OutputFormat::Ansi, - }; - debug_render::run(input, output_format).await + inline::run(command, args.api_endpoint, args.api_token, settings, hook).await } } } -- cgit v1.3.1