Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions src/cortex-cli/src/cli/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ pub enum Commands {
#[command(next_help_heading = categories::SESSION)]
Delete(DeleteCommand),

/// View prompt history from past sessions
#[command(display_order = 15)]
#[command(next_help_heading = categories::SESSION)]
History(HistoryCommand),

// ========================================================================
// 🔐 Authentication (order 20-29)
// ========================================================================
Expand Down Expand Up @@ -470,10 +475,6 @@ pub enum Commands {
#[command(hide = true)]
Servers(ServersCommand),

/// View prompt history from past sessions
#[command(hide = true)]
History(HistoryCommand),

/// Manage workspace/project settings
#[command(visible_alias = "project", hide = true)]
Workspace(WorkspaceCli),
Expand Down Expand Up @@ -857,6 +858,7 @@ pub struct HistoryClearArgs {
#[cfg(test)]
mod tests {
use super::*;
use clap::CommandFactory;
use clap::Parser;

// ==========================================================================
Expand Down Expand Up @@ -1782,6 +1784,15 @@ mod tests {
}
}

#[test]
fn test_history_command_visible_in_help() {
let help = Cli::command().render_long_help().to_string();
assert!(
help.contains("history"),
"top-level help should list the history command"
);
}

#[test]
fn test_history_command_with_limit() {
let cli = Cli::try_parse_from(["cortex", "history", "-n", "50"])
Expand Down
1 change: 1 addition & 0 deletions src/cortex-cli/src/cli/styles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ pub const HELP_TEMPLATE: &str = color_print::cstr!(
<green,bold>export</> Export a session to JSON format
<green,bold>import</> Import a session from JSON file or URL
<green,bold>delete</> Delete a session
<green,bold>history</> View prompt history from past sessions

<cyan,bold>🔐 Authentication:</>
<green,bold>login</> Authenticate with Cortex API
Expand Down