Remove CLI plugin marketplace shell
This commit is contained in:
parent
414ea135b4
commit
0c92ac0abd
5 changed files with 15 additions and 108 deletions
71
vendor/codex/codex-rs/cli/src/main.rs
vendored
71
vendor/codex/codex-rs/cli/src/main.rs
vendored
|
|
@ -36,13 +36,11 @@ use supports_color::Stream;
|
|||
mod app_cmd;
|
||||
#[cfg(any(target_os = "macos", target_os = "windows"))]
|
||||
mod desktop_app;
|
||||
mod marketplace_cmd;
|
||||
mod mcp_cmd;
|
||||
mod responses_cmd;
|
||||
#[cfg(not(windows))]
|
||||
mod wsl_paths;
|
||||
|
||||
use crate::marketplace_cmd::MarketplaceCli;
|
||||
use crate::mcp_cmd::McpCli;
|
||||
use crate::responses_cmd::ResponsesCommand;
|
||||
use crate::responses_cmd::run_responses_command;
|
||||
|
|
@ -120,9 +118,6 @@ enum Subcommand {
|
|||
/// Manage external MCP servers for Codex.
|
||||
Mcp(McpCli),
|
||||
|
||||
/// Manage Codex plugins.
|
||||
Plugin(PluginCli),
|
||||
|
||||
/// Start Codex as an MCP server (stdio).
|
||||
McpServer,
|
||||
|
||||
|
|
@ -179,21 +174,6 @@ enum Subcommand {
|
|||
Features(FeaturesCli),
|
||||
}
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
struct PluginCli {
|
||||
#[clap(flatten)]
|
||||
pub config_overrides: CliConfigOverrides,
|
||||
|
||||
#[command(subcommand)]
|
||||
subcommand: PluginSubcommand,
|
||||
}
|
||||
|
||||
#[derive(Debug, clap::Subcommand)]
|
||||
enum PluginSubcommand {
|
||||
/// Manage plugin marketplaces for Codex.
|
||||
Marketplace(MarketplaceCli),
|
||||
}
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
struct CompletionCommand {
|
||||
/// Shell to generate completions for
|
||||
|
|
@ -762,24 +742,6 @@ async fn cli_main(arg0_paths: Arg0DispatchPaths) -> anyhow::Result<()> {
|
|||
prepend_config_flags(&mut mcp_cli.config_overrides, root_config_overrides.clone());
|
||||
mcp_cli.run().await?;
|
||||
}
|
||||
Some(Subcommand::Plugin(plugin_cli)) => {
|
||||
reject_remote_mode_for_subcommand(
|
||||
root_remote.as_deref(),
|
||||
root_remote_auth_token_env.as_deref(),
|
||||
"plugin",
|
||||
)?;
|
||||
let PluginCli {
|
||||
mut config_overrides,
|
||||
subcommand,
|
||||
} = plugin_cli;
|
||||
prepend_config_flags(&mut config_overrides, root_config_overrides.clone());
|
||||
match subcommand {
|
||||
PluginSubcommand::Marketplace(mut marketplace_cli) => {
|
||||
prepend_config_flags(&mut marketplace_cli.config_overrides, config_overrides);
|
||||
marketplace_cli.run().await?;
|
||||
}
|
||||
}
|
||||
}
|
||||
Some(Subcommand::AppServer(app_server_cli)) => {
|
||||
let AppServerCommand {
|
||||
subcommand,
|
||||
|
|
@ -1780,34 +1742,7 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn plugin_marketplace_add_parses_under_plugin() {
|
||||
let cli =
|
||||
MultitoolCli::try_parse_from(["codex", "plugin", "marketplace", "add", "owner/repo"])
|
||||
.expect("parse");
|
||||
|
||||
assert!(matches!(cli.subcommand, Some(Subcommand::Plugin(_))));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn plugin_marketplace_upgrade_parses_under_plugin() {
|
||||
let cli =
|
||||
MultitoolCli::try_parse_from(["codex", "plugin", "marketplace", "upgrade", "debug"])
|
||||
.expect("parse");
|
||||
|
||||
assert!(matches!(cli.subcommand, Some(Subcommand::Plugin(_))));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn plugin_marketplace_remove_parses_under_plugin() {
|
||||
let cli =
|
||||
MultitoolCli::try_parse_from(["codex", "plugin", "marketplace", "remove", "debug"])
|
||||
.expect("parse");
|
||||
|
||||
assert!(matches!(cli.subcommand, Some(Subcommand::Plugin(_))));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn marketplace_no_longer_parses_at_top_level() {
|
||||
fn marketplace_and_plugin_commands_no_longer_parse() {
|
||||
let add_result =
|
||||
MultitoolCli::try_parse_from(["codex", "marketplace", "add", "owner/repo"]);
|
||||
assert!(add_result.is_err());
|
||||
|
|
@ -1819,6 +1754,10 @@ mod tests {
|
|||
let remove_result =
|
||||
MultitoolCli::try_parse_from(["codex", "marketplace", "remove", "debug"]);
|
||||
assert!(remove_result.is_err());
|
||||
|
||||
let plugin_result =
|
||||
MultitoolCli::try_parse_from(["codex", "plugin", "marketplace", "add", "owner/repo"]);
|
||||
assert!(plugin_result.is_err());
|
||||
}
|
||||
|
||||
fn sample_exit_info(conversation_id: Option<&str>, thread_name: Option<&str>) -> AppExitInfo {
|
||||
|
|
|
|||
35
vendor/codex/codex-rs/cli/src/marketplace_cmd.rs
vendored
35
vendor/codex/codex-rs/cli/src/marketplace_cmd.rs
vendored
|
|
@ -1,35 +0,0 @@
|
|||
use anyhow::Result;
|
||||
use anyhow::bail;
|
||||
use clap::Parser;
|
||||
use codex_utils_cli::CliConfigOverrides;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct MarketplaceCli {
|
||||
#[clap(flatten)]
|
||||
pub config_overrides: CliConfigOverrides,
|
||||
|
||||
#[command(subcommand)]
|
||||
subcommand: MarketplaceSubcommand,
|
||||
}
|
||||
|
||||
#[derive(Debug, clap::Subcommand)]
|
||||
enum MarketplaceSubcommand {
|
||||
Add(DisabledMarketplaceArgs),
|
||||
Upgrade(DisabledMarketplaceArgs),
|
||||
Remove(DisabledMarketplaceArgs),
|
||||
}
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
struct DisabledMarketplaceArgs {
|
||||
#[arg(trailing_var_arg = true, allow_hyphen_values = true)]
|
||||
_args: Vec<String>,
|
||||
}
|
||||
|
||||
impl MarketplaceCli {
|
||||
pub async fn run(self) -> Result<()> {
|
||||
let _ = self;
|
||||
bail!(
|
||||
"Codex plugin marketplace commands are disabled in Epiphany; the Codex organ is limited to OpenAI auth and model routing."
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in a new issue