From 7fecb20ba9ce84ccd9b516098284f41c8a3cebfd Mon Sep 17 00:00:00 2001 From: Hikari Date: Sat, 7 Feb 2026 14:37:45 -0800 Subject: [PATCH] feat: add CLI version display in status bar Displays the Claude Code CLI version in the status bar (to the left of the system clock) to help with debugging and understanding which features are available. Changes: - Add get_claude_version command to fetch CLI version from `claude --version` - Create CliVersion.svelte component to display version - Position component in InputBar status bar next to SystemClock - Update on app start and CLI reconnection Closes #131 --- src-tauri/src/commands.rs | 29 ++++++++++++ src-tauri/src/lib.rs | 1 + src/lib/components/CliVersion.svelte | 68 ++++++++++++++++++++++++++++ src/lib/components/InputBar.svelte | 2 + 4 files changed, 100 insertions(+) create mode 100644 src/lib/components/CliVersion.svelte diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index 41ea7b7..00da09a 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -1228,6 +1228,35 @@ pub async fn list_memory_files() -> Result { }) } +#[tauri::command] +pub async fn get_claude_version() -> Result { + tracing::debug!("Getting Claude CLI version"); + + let output = std::process::Command::new("claude") + .arg("--version") + .output(); + + match output { + Ok(output) => { + if output.status.success() { + let version = String::from_utf8_lossy(&output.stdout) + .trim() + .to_string(); + tracing::info!("Claude CLI version: {}", version); + Ok(version) + } else { + let error = String::from_utf8_lossy(&output.stderr); + tracing::error!("Failed to get Claude version: {}", error); + Err(format!("Failed to get Claude version: {}", error)) + } + } + Err(e) => { + tracing::error!("Failed to execute claude --version: {}", e); + Err(format!("Failed to execute claude --version: {}", e)) + } + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 8f31c0b..1637f23 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -194,6 +194,7 @@ pub fn run() { stop_discord_rpc, close_application, list_memory_files, + get_claude_version, ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); diff --git a/src/lib/components/CliVersion.svelte b/src/lib/components/CliVersion.svelte new file mode 100644 index 0000000..affb99a --- /dev/null +++ b/src/lib/components/CliVersion.svelte @@ -0,0 +1,68 @@ + + +
+ + + + + CLI {version} +
+ + diff --git a/src/lib/components/InputBar.svelte b/src/lib/components/InputBar.svelte index d2b2b8e..907cddf 100644 --- a/src/lib/components/InputBar.svelte +++ b/src/lib/components/InputBar.svelte @@ -18,6 +18,7 @@ import MessageModeSelector from "$lib/components/MessageModeSelector.svelte"; import SlashCommandMenu from "$lib/components/SlashCommandMenu.svelte"; import SystemClock from "$lib/components/SystemClock.svelte"; + import CliVersion from "$lib/components/CliVersion.svelte"; import { getCurrentMode } from "$lib/stores/messageMode"; import { formatMessageWithMode } from "$lib/types/messageMode"; import { @@ -916,6 +917,7 @@ User: ${formattedMessage}`; Clipboard +