Added CLI version to /status output (#3223)
This PR adds the CLI version to the `/status` output. This addresses feature request #2767
This commit is contained in:
@@ -950,6 +950,12 @@ pub(crate) fn new_status_output(
|
|||||||
|
|
||||||
lines.push("".into());
|
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
|
// 📊 Token Usage
|
||||||
lines.push(vec!["📊 ".into(), "Token Usage".bold()].into());
|
lines.push(vec!["📊 ".into(), "Token Usage".bold()].into());
|
||||||
if let Some(session_id) = session_id {
|
if let Some(session_id) = session_id {
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ mod streaming;
|
|||||||
mod text_formatting;
|
mod text_formatting;
|
||||||
mod tui;
|
mod tui;
|
||||||
mod user_approval_widget;
|
mod user_approval_widget;
|
||||||
|
mod version;
|
||||||
mod wrapping;
|
mod wrapping;
|
||||||
|
|
||||||
// Internal vt100-based replay tests live as a separate source file to keep them
|
// Internal vt100-based replay tests live as a separate source file to keep them
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ use std::path::PathBuf;
|
|||||||
use codex_core::config::Config;
|
use codex_core::config::Config;
|
||||||
use codex_core::default_client::create_client;
|
use codex_core::default_client::create_client;
|
||||||
|
|
||||||
|
use crate::version::CODEX_CLI_VERSION;
|
||||||
|
|
||||||
pub fn get_upgrade_version(config: &Config) -> Option<String> {
|
pub fn get_upgrade_version(config: &Config) -> Option<String> {
|
||||||
let version_file = version_filepath(config);
|
let version_file = version_filepath(config);
|
||||||
let info = read_version_info(&version_file).ok();
|
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| {
|
info.and_then(|info| {
|
||||||
let current_version = env!("CARGO_PKG_VERSION");
|
if is_newer(&info.latest_version, CODEX_CLI_VERSION).unwrap_or(false) {
|
||||||
if is_newer(&info.latest_version, current_version).unwrap_or(false) {
|
|
||||||
Some(info.latest_version)
|
Some(info.latest_version)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|||||||
2
codex-rs/tui/src/version.rs
Normal file
2
codex-rs/tui/src/version.rs
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
/// The current Codex CLI version as embedded at compile time.
|
||||||
|
pub const CODEX_CLI_VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
Reference in New Issue
Block a user