Skip to content
Merged
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
14 changes: 7 additions & 7 deletions code-rs/cli/src/login.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! CLI login commands and their direct-user observability surfaces.
//!
//! The TUI path already installs a broader tracing stack with feedback, OpenTelemetry, and other
//! interactive-session layers. Direct `codex login` intentionally does less: it preserves the
//! interactive-session layers. Direct `code login` intentionally does less: it preserves the
//! existing stderr/browser UX and adds only a small file-backed tracing layer for login-specific
//! targets. Keeping that setup local avoids pulling the TUI's session-oriented logging machinery
//! into a one-shot CLI command while still producing a durable `codex-login.log` artifact that
Expand Down Expand Up @@ -39,7 +39,7 @@ const ACCESS_TOKEN_LOGIN_DISABLED_MESSAGE: &str =
"Access token login is disabled. Use API key login instead.";
const LOGIN_SUCCESS_MESSAGE: &str = "Successfully logged in";

/// Installs a small file-backed tracing layer for direct `codex login` flows.
/// Installs a small file-backed tracing layer for direct `code login` flows.
///
/// This deliberately duplicates a narrow slice of the TUI logging setup instead of reusing it
/// wholesale. The TUI stack includes session-oriented layers that are valuable for interactive
Expand Down Expand Up @@ -93,7 +93,7 @@ fn init_login_file_logging(config: &Config) -> Option<WorkerGuard> {
.with_ansi(false)
.with_filter(env_filter);

// Direct `codex login` otherwise relies on ephemeral stderr and browser output.
// Direct `code login` otherwise relies on ephemeral stderr and browser output.
// Persist the same login targets to a file so support can inspect auth failures
// without reproducing them through TUI or app-server.
if let Err(err) = tracing_subscriber::registry().with(file_layer).try_init() {
Expand All @@ -109,7 +109,7 @@ fn init_login_file_logging(config: &Config) -> Option<WorkerGuard> {

fn print_login_server_start(actual_port: u16, auth_url: &str) {
eprintln!(
"Starting local login server on http://localhost:{actual_port}.\nIf your browser did not open, navigate to this URL to authenticate:\n\n{auth_url}\n\nOn a remote or headless machine? Use `codex login --device-auth` instead."
"Starting local login server on http://localhost:{actual_port}.\nIf your browser did not open, navigate to this URL to authenticate:\n\n{auth_url}\n\nOn a remote or headless machine? Use `code login --device-auth` instead."
);
}

Expand Down Expand Up @@ -224,15 +224,15 @@ pub async fn run_login_with_access_token(

pub fn read_api_key_from_stdin() -> String {
read_stdin_secret(
"--with-api-key expects the API key on stdin. Try piping it, e.g. `printenv OPENAI_API_KEY | codex login --with-api-key`.",
"--with-api-key expects the API key on stdin. Try piping it, e.g. `printenv OPENAI_API_KEY | code login --with-api-key`.",
"Reading API key from stdin...",
"No API key provided via stdin.",
)
}

pub fn read_access_token_from_stdin() -> String {
read_stdin_secret(
"--with-access-token expects the access token on stdin. Try piping it, e.g. `printenv CODEX_ACCESS_TOKEN | codex login --with-access-token`.",
"--with-access-token expects the access token on stdin. Try piping it, e.g. `printenv CODEX_ACCESS_TOKEN | code login --with-access-token`.",
"Reading access token from stdin...",
"No access token provided via stdin.",
)
Expand Down Expand Up @@ -299,7 +299,7 @@ pub async fn run_login_with_device_code(
}

/// Prefers device-code login (with `open_browser = false`) when headless environment is detected, but keeps
/// `codex login` working in environments where device-code may be disabled/feature-gated.
/// `code login` working in environments where device-code may be disabled/feature-gated.
/// If `run_device_code_login` returns `ErrorKind::NotFound` ("device-code unsupported"), this
/// falls back to starting the local browser login server.
pub async fn run_login_with_device_code_fallback_to_browser(
Expand Down
64 changes: 32 additions & 32 deletions code-rs/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ use codex_protocol::protocol::AskForApproval;
use codex_protocol::user_input::UserInput;
use codex_terminal_detection::TerminalName;

/// Codex CLI
/// Every Code CLI
///
/// If no subcommand is specified, options will be forwarded to the interactive CLI.
#[derive(Debug, Parser)]
Expand Down Expand Up @@ -101,7 +101,7 @@ struct MultitoolCli {

#[derive(Debug, clap::Subcommand)]
enum Subcommand {
/// Run Codex non-interactively.
/// Run Every Code non-interactively.
#[clap(visible_alias = "e")]
Exec(ExecCli),

Expand All @@ -114,13 +114,13 @@ enum Subcommand {
/// Remove stored authentication credentials.
Logout(LogoutCommand),

/// Manage external MCP servers for Codex.
/// Manage external MCP servers for Every Code.
Mcp(McpCli),

/// Manage Codex plugins.
/// Manage Every Code plugins.
Plugin(PluginCli),

/// Start Codex as an MCP server (stdio).
/// Start Every Code as an MCP server (stdio).
McpServer,

/// [experimental] Run the app server or related tooling.
Expand All @@ -136,10 +136,10 @@ enum Subcommand {
/// Generate shell completion scripts.
Completion(CompletionCommand),

/// Update Codex to the latest version.
/// Update Every Code to the latest version.
Update,

/// Run commands within a Codex-provided sandbox.
/// Run commands within an Every Code-provided sandbox.
Sandbox(SandboxArgs),

/// Debugging tools.
Expand All @@ -149,7 +149,7 @@ enum Subcommand {
#[clap(hide = true)]
Execpolicy(ExecpolicyCommand),

/// Apply the latest diff produced by Codex agent as a `git apply` to your local working tree.
/// Apply the latest diff produced by the Every Code agent as a `git apply` to your local working tree.
#[clap(visible_alias = "a")]
Apply(ApplyCommand),

Expand Down Expand Up @@ -179,7 +179,7 @@ enum Subcommand {
}

#[derive(Debug, Parser)]
#[command(bin_name = "codex plugin")]
#[command(bin_name = "code plugin")]
struct PluginCli {
#[clap(flatten)]
pub config_overrides: CliConfigOverrides,
Expand All @@ -190,7 +190,7 @@ struct PluginCli {

#[derive(Debug, clap::Subcommand)]
enum PluginSubcommand {
/// Manage plugin marketplaces for Codex.
/// Manage plugin marketplaces for Every Code.
Marketplace(MarketplaceCli),
}

Expand Down Expand Up @@ -362,13 +362,13 @@ struct LoginCommand {

#[arg(
long = "with-api-key",
help = "Read the API key from stdin (e.g. `printenv OPENAI_API_KEY | codex login --with-api-key`)"
help = "Read the API key from stdin (e.g. `printenv OPENAI_API_KEY | code login --with-api-key`)"
)]
with_api_key: bool,

#[arg(
long = "with-access-token",
help = "Read the access token from stdin (e.g. `printenv CODEX_ACCESS_TOKEN | codex login --with-access-token`)"
help = "Read the access token from stdin (e.g. `printenv CODEX_ACCESS_TOKEN | code login --with-access-token`)"
)]
with_access_token: bool,

Expand Down Expand Up @@ -439,7 +439,7 @@ struct AppServerCommand {
/// enabled = false
/// ```
///
/// See https://developers.openai.com/codex/config-advanced/#metrics for more details.
/// See the analytics section in config.toml for more details.
#[arg(long = "analytics-default-enabled")]
analytics_default_enabled: bool,

Expand Down Expand Up @@ -478,7 +478,7 @@ enum AppServerSubcommand {
/// [experimental] Generate JSON Schema for the app server protocol.
GenerateJsonSchema(GenerateJsonSchemaCommand),

/// [internal] Generate internal JSON Schema artifacts for Codex tooling.
/// [internal] Generate internal JSON Schema artifacts for Every Code tooling.
#[clap(hide = true)]
GenerateInternalJsonSchema(GenerateInternalJsonSchemaCommand),
}
Expand Down Expand Up @@ -586,7 +586,7 @@ fn handle_app_exit(exit_info: AppExitInfo) -> anyhow::Result<()> {
fn run_update_action(action: UpdateAction) -> anyhow::Result<()> {
println!();
let cmd_str = action.command_str();
println!("Updating Codex via `{cmd_str}`...");
println!("Updating Every Code via `{cmd_str}`...");

let status = {
#[cfg(windows)]
Expand Down Expand Up @@ -621,23 +621,23 @@ fn run_update_action(action: UpdateAction) -> anyhow::Result<()> {
if !status.success() {
anyhow::bail!("`{cmd_str}` failed with status {status}");
}
println!("\n🎉 Update ran successfully! Please restart Codex.");
println!("\nUpdate ran successfully! Please restart Every Code.");
Ok(())
}

fn run_update_command() -> anyhow::Result<()> {
#[cfg(debug_assertions)]
{
anyhow::bail!(
"`codex update` is not available in debug builds. Install a release build of Codex to use this command."
"`code update` is not available in debug builds. Install a release build of Every Code to use this command."
);
}

#[cfg(not(debug_assertions))]
{
let Some(action) = codex_tui::get_update_action() else {
anyhow::bail!(
"Could not detect the Codex installation method. Please update manually: https://developers.openai.com/codex/cli/"
"Could not detect the Every Code installation method. Please update manually."
);
};
run_update_action(action)
Expand Down Expand Up @@ -804,7 +804,7 @@ async fn cli_main(arg0_paths: Arg0DispatchPaths) -> anyhow::Result<()> {
root_remote_auth_token_env.as_deref(),
"review",
)?;
let mut exec_cli = ExecCli::try_parse_from(["codex", "exec"])?;
let mut exec_cli = ExecCli::try_parse_from(["code", "exec"])?;
exec_cli.command = Some(ExecCommand::Review(review_args));
prepend_config_flags(
&mut exec_cli.config_overrides,
Expand Down Expand Up @@ -1017,7 +1017,7 @@ async fn cli_main(arg0_paths: Arg0DispatchPaths) -> anyhow::Result<()> {
.await;
} else if login_cli.api_key.is_some() {
eprintln!(
"The --api-key flag is no longer supported. Pipe the key instead, e.g. `printenv OPENAI_API_KEY | codex login --with-api-key`."
"The --api-key flag is no longer supported. Pipe the key instead, e.g. `printenv OPENAI_API_KEY | code login --with-api-key`."
);
std::process::exit(1);
} else if login_cli.with_api_key {
Expand Down Expand Up @@ -1529,12 +1529,12 @@ fn reject_remote_mode_for_subcommand(
) -> anyhow::Result<()> {
if let Some(remote) = remote {
anyhow::bail!(
"`--remote {remote}` is only supported for interactive TUI commands, not `codex {subcommand}`"
"`--remote {remote}` is only supported for interactive TUI commands, not `code {subcommand}`"
);
}
if remote_auth_token_env.is_some() {
anyhow::bail!(
"`--remote-auth-token-env` is only supported for interactive TUI commands, not `codex {subcommand}`"
"`--remote-auth-token-env` is only supported for interactive TUI commands, not `code {subcommand}`"
);
}
Ok(())
Expand Down Expand Up @@ -1597,7 +1597,7 @@ async fn run_interactive_tui(
}

eprintln!(
"WARNING: TERM is set to \"dumb\". Codex's interactive TUI may not work in this terminal."
"WARNING: TERM is set to \"dumb\". Every Code's interactive TUI may not work in this terminal."
);
if !confirm("Continue anyway? [y/N]: ")? {
return Ok(AppExitInfo::fatal(
Expand Down Expand Up @@ -1640,7 +1640,7 @@ fn confirm(prompt: &str) -> std::io::Result<bool> {
Ok(answer.eq_ignore_ascii_case("y") || answer.eq_ignore_ascii_case("yes"))
}

/// Build the final `TuiCli` for a `codex resume` invocation.
/// Build the final `TuiCli` for a `code resume` invocation.
fn finalize_resume_interactive(
mut interactive: TuiCli,
root_config_overrides: CliConfigOverrides,
Expand Down Expand Up @@ -1668,7 +1668,7 @@ fn finalize_resume_interactive(
interactive
}

/// Build the final `TuiCli` for a `codex fork` invocation.
/// Build the final `TuiCli` for a `code fork` invocation.
fn finalize_fork_interactive(
mut interactive: TuiCli,
root_config_overrides: CliConfigOverrides,
Expand All @@ -1694,7 +1694,7 @@ fn finalize_fork_interactive(
interactive
}

/// Merge flags provided to `codex resume`/`codex fork` so they take precedence over any
/// Merge flags provided to `code resume`/`code fork` so they take precedence over any
/// root-level flags. Only overrides fields explicitly set on the subcommand-scoped
/// CLI. Also appends `-c key=value` overrides with highest precedence.
fn merge_interactive_cli_flags(interactive: &mut TuiCli, subcommand_cli: TuiCli) {
Expand Down Expand Up @@ -1931,14 +1931,14 @@ mod tests {
fn plugin_marketplace_help_uses_plugin_namespace() {
let help = help_from_args(&["codex", "plugin", "marketplace", "--help"]);
assert!(
help.contains("Usage: codex plugin marketplace [OPTIONS] <COMMAND>"),
help.contains("Usage: code plugin marketplace [OPTIONS] <COMMAND>"),
"{help}"
);

for (subcommand, usage) in [
("add", "Usage: codex plugin marketplace add"),
("upgrade", "Usage: codex plugin marketplace upgrade"),
("remove", "Usage: codex plugin marketplace remove"),
("add", "Usage: code plugin marketplace add"),
("upgrade", "Usage: code plugin marketplace upgrade"),
("remove", "Usage: code plugin marketplace remove"),
] {
let help = help_from_args(&["codex", "plugin", "marketplace", subcommand, "--help"]);
assert!(help.contains(usage), "{help}");
Expand Down Expand Up @@ -2095,7 +2095,7 @@ mod tests {
lines,
vec![
"Token usage: total=2 input=0 output=2".to_string(),
"To continue this session, run codex resume 123e4567-e89b-12d3-a456-426614174000"
"To continue this session, run code resume 123e4567-e89b-12d3-a456-426614174000"
.to_string(),
]
);
Expand Down Expand Up @@ -2123,7 +2123,7 @@ mod tests {
lines,
vec![
"Token usage: total=2 input=0 output=2".to_string(),
"To continue this session, run codex resume 123e4567-e89b-12d3-a456-426614174000"
"To continue this session, run code resume 123e4567-e89b-12d3-a456-426614174000"
.to_string(),
]
);
Expand Down
14 changes: 7 additions & 7 deletions code-rs/cli/src/marketplace_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use codex_core_plugins::marketplace_remove::remove_marketplace;
use codex_utils_cli::CliConfigOverrides;

#[derive(Debug, Parser)]
#[command(bin_name = "codex plugin marketplace")]
#[command(bin_name = "code plugin marketplace")]
pub struct MarketplaceCli {
#[clap(flatten)]
pub config_overrides: CliConfigOverrides,
Expand All @@ -30,7 +30,7 @@ enum MarketplaceSubcommand {
}

#[derive(Debug, Parser)]
#[command(bin_name = "codex plugin marketplace add")]
#[command(bin_name = "code plugin marketplace add")]
struct AddMarketplaceArgs {
/// Marketplace source. Supports owner/repo[@ref], HTTP(S) Git URLs, SSH URLs,
/// or local marketplace root directories.
Expand All @@ -48,13 +48,13 @@ struct AddMarketplaceArgs {
}

#[derive(Debug, Parser)]
#[command(bin_name = "codex plugin marketplace upgrade")]
#[command(bin_name = "code plugin marketplace upgrade")]
struct UpgradeMarketplaceArgs {
marketplace_name: Option<String>,
}

#[derive(Debug, Parser)]
#[command(bin_name = "codex plugin marketplace remove")]
#[command(bin_name = "code plugin marketplace remove")]
struct RemoveMarketplaceArgs {
/// Configured marketplace name to remove.
marketplace_name: String,
Expand Down Expand Up @@ -88,7 +88,7 @@ async fn run_add(args: AddMarketplaceArgs) -> Result<()> {
sparse_paths,
} = args;

let codex_home = find_codex_home().context("failed to resolve CODEX_HOME")?;
let codex_home = find_codex_home().context("failed to resolve Every Code config home")?;
let outcome = add_marketplace(
codex_home.to_path_buf(),
MarketplaceAddRequest {
Expand Down Expand Up @@ -126,7 +126,7 @@ async fn run_upgrade(
let config = Config::load_with_cli_overrides(overrides)
.await
.context("failed to load configuration")?;
let codex_home = find_codex_home().context("failed to resolve CODEX_HOME")?;
let codex_home = find_codex_home().context("failed to resolve Every Code config home")?;
let manager = PluginsManager::new(codex_home.to_path_buf());
let plugins_input = config.plugins_config_input();
let outcome = manager
Expand All @@ -137,7 +137,7 @@ async fn run_upgrade(

async fn run_remove(args: RemoveMarketplaceArgs) -> Result<()> {
let RemoveMarketplaceArgs { marketplace_name } = args;
let codex_home = find_codex_home().context("failed to resolve CODEX_HOME")?;
let codex_home = find_codex_home().context("failed to resolve Every Code config home")?;
let outcome = remove_marketplace(
codex_home.to_path_buf(),
MarketplaceRemoveRequest { marketplace_name },
Expand Down
Loading