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
8 changes: 4 additions & 4 deletions src/cortex-cli/src/cli/styles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ pub const AFTER_HELP: &str = color_print::cstr!(
<green,bold>cortex resume --last</> Continue most recent session

<cyan,bold>🌍 ENVIRONMENT VARIABLES</>
<yellow>CORTEX_HOME</> Override config directory (default: ~/.config/cortex)
<yellow>CORTEX_HOME</> Override Cortex home directory (default: ~/.cortex)
<yellow>CORTEX_API_KEY</> API key (alternative to --with-api-key)
<yellow>CORTEX_MODEL</> Default model (alternative to --model)
<yellow>CORTEX_LOG_LEVEL</> Log verbosity (error, warn, info, debug, trace)
<yellow>NO_COLOR</> Disable colored output (set to '1' or 'true')
<yellow>VISUAL</>/<yellow>EDITOR</> Editor for /edit command

<cyan,bold>📁 PATHS</>
<dim>Config</> ~/.config/cortex/config.toml
<dim>Sessions</> ~/.local/share/cortex/sessions/
<dim>Logs</> ~/.cache/cortex/logs/
<dim>Config</> ~/.cortex/config.toml
<dim>Sessions</> ~/.cortex/sessions/
<dim>Logs</> ~/.cortex/logs/
<dim>Agents</> ~/.cortex/agents/ (personal), .cortex/agents/ (project)

<cyan,bold>🔗 LEARN MORE</>
Expand Down
48 changes: 48 additions & 0 deletions src/cortex-cli/tests/help_paths.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
use std::process::Command;

#[test]
fn root_help_documents_canonical_cortex_home_paths() {
let output = Command::new(env!("CARGO_BIN_EXE_Cortex"))
.arg("--help")
.env("NO_COLOR", "1")
.output()
.expect("failed to run Cortex --help");

assert!(
output.status.success(),
"Cortex --help failed: stdout=\n{}\nstderr=\n{}",
String::from_utf8_lossy(&output.stdout),
String::from_utf8_lossy(&output.stderr)
);

let stdout = String::from_utf8_lossy(&output.stdout);

assert!(
stdout.contains("default: ~/.cortex"),
"CORTEX_HOME help should document the canonical ~/.cortex default:\n{stdout}"
);
assert!(
stdout.contains("~/.cortex/config.toml"),
"Config path should use canonical Cortex home:\n{stdout}"
);
assert!(
stdout.contains("~/.cortex/sessions/"),
"Sessions path should use canonical Cortex home:\n{stdout}"
);
assert!(
stdout.contains("~/.cortex/logs/"),
"Logs path should use canonical Cortex home:\n{stdout}"
);
assert!(
!stdout.contains("~/.config/cortex"),
"Help should not advertise lowercase XDG config paths:\n{stdout}"
);
assert!(
!stdout.contains("~/.local/share/cortex"),
"Help should not advertise lowercase XDG data paths:\n{stdout}"
);
assert!(
!stdout.contains("~/.cache/cortex"),
"Help should not advertise lowercase XDG cache paths:\n{stdout}"
);
}