generated from nhcarrigan/template
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
This commit is contained in:
@@ -1228,6 +1228,35 @@ pub async fn list_memory_files() -> Result<MemoryFilesResponse, String> {
|
||||
})
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn get_claude_version() -> Result<String, String> {
|
||||
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::*;
|
||||
|
||||
Reference in New Issue
Block a user