Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Added CLI version to `/status` output (#3223)

Eric Traut45c3b2004196
diff --git a/codex-rs/tui/src/history_cell.rs b/codex-rs/tui/src/history_cell.rs
index 01583958aa..7e1cf25e92 100644
--- a/codex-rs/tui/src/history_cell.rs
+++ b/codex-rs/tui/src/history_cell.rs
@@ -950,6 +950,12 @@ pub(crate) fn new_status_output(
lines.push("".into());
+ // πŸ’» Client
+ let cli_version = crate::version::CODEX_CLI_VERSION;
+ lines.push(vec![padded_emoji("πŸ’»").into(), "Client".bold()].into());
+ lines.push(vec![" β€’ CLI Version: ".into(), cli_version.into()].into());
+ lines.push("".into());
+
// πŸ“Š Token Usage
lines.push(vec!["πŸ“Š ".into(), "Token Usage".bold()].into());
if let Some(session_id) = session_id {
diff --git a/codex-rs/tui/src/lib.rs b/codex-rs/tui/src/lib.rs
index 76ca93a368..dc5569bfe5 100644
--- a/codex-rs/tui/src/lib.rs
+++ b/codex-rs/tui/src/lib.rs
@@ -58,6 +58,7 @@ mod streaming;
mod text_formatting;
mod tui;
mod user_approval_widget;
+mod version;
mod wrapping;
// Internal vt100-based replay tests live as a separate source file to keep them
diff --git a/codex-rs/tui/src/updates.rs b/codex-rs/tui/src/updates.rs
index 39d084b407..90ef6d8580 100644
--- a/codex-rs/tui/src/updates.rs
+++ b/codex-rs/tui/src/updates.rs
@@ -11,6 +11,8 @@ use std::path::PathBuf;
use codex_core::config::Config;
use codex_core::default_client::create_client;
+use crate::version::CODEX_CLI_VERSION;
+
pub fn get_upgrade_version(config: &Config) -> Option<String> {
let version_file = version_filepath(config);
let info = read_version_info(&version_file).ok();
@@ -31,8 +33,7 @@ pub fn get_upgrade_version(config: &Config) -> Option<String> {
}
info.and_then(|info| {
- let current_version = env!("CARGO_PKG_VERSION");
- if is_newer(&info.latest_version, current_version).unwrap_or(false) {
+ if is_newer(&info.latest_version, CODEX_CLI_VERSION).unwrap_or(false) {
Some(info.latest_version)
} else {
None
diff --git a/codex-rs/tui/src/version.rs b/codex-rs/tui/src/version.rs
new file mode 100644
index 0000000000..8c8d108dc6
--- /dev/null
+++ b/codex-rs/tui/src/version.rs
@@ -0,0 +1,2 @@
+/// The current Codex CLI version as embedded at compile time.
+pub const CODEX_CLI_VERSION: &str = env!("CARGO_PKG_VERSION");