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
18 changes: 18 additions & 0 deletions packages/tui-rs/src/cli_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ use anyhow::{bail, Context, Result};
use crate::session::{ExportFormat, ExportOptions, SessionManager};
use crate::session_transfer::{export_portable_session, import_portable_session, PortableFormat};

const ANTHROPIC_OAUTH_REMOVED_MESSAGE: &str = "Anthropic OAuth login has been removed. Set ANTHROPIC_API_KEY to use Anthropic models, or run `maestro codex login` for the default Codex flow.";

/// Dispatch a top-level CLI helper subcommand.
///
/// `args` is the token stream after the program name, e.g.
Expand Down Expand Up @@ -50,6 +52,10 @@ pub async fn run_cli_command(args: &[String]) -> Result<i32> {
"update" => crate::update_cli::run_update(&args[1..]).await,
"modes" => crate::mode_cli::run_modes(&args[1..]).await,
"painter" => crate::painter_cli::run_painter(&args[1..]),
"anthropic" => {
eprintln!("{ANTHROPIC_OAUTH_REMOVED_MESSAGE}");
Ok(1)
}
other => bail!("unknown command: {other}"),
}
}
Expand Down Expand Up @@ -779,4 +785,16 @@ mod tests {
1
);
}

#[tokio::test]
async fn anthropic_command_reports_removed_oauth_flow() {
assert!(ANTHROPIC_OAUTH_REMOVED_MESSAGE.contains("ANTHROPIC_API_KEY"));
assert!(ANTHROPIC_OAUTH_REMOVED_MESSAGE.contains("maestro codex login"));
assert_eq!(
run_cli_command(&argv(&["anthropic", "status"]))
.await
.expect("anthropic command"),
1
);
}
}
18 changes: 15 additions & 3 deletions packages/tui-rs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,21 @@ use maestro_tui::hosted_runner_cli::run_hosted_runner_cli_from_env;
// HELPER FUNCTIONS
// ─────────────────────────────────────────────────────────────────────────────

const NATIVE_UTILITY_COMMANDS: [&str; 13] = [
"sessions", "cost", "stats", "models", "status", "hooks", "export", "import", "update",
"skill", "modes", "agents", "painter",
const NATIVE_UTILITY_COMMANDS: [&str; 14] = [
"sessions",
"cost",
"stats",
"models",
"status",
"hooks",
"export",
"import",
"update",
"skill",
"modes",
"agents",
"painter",
"anthropic",
];

const GLOBAL_FLAGS_WITH_VALUES: [&str; 26] = [
Expand Down
10 changes: 0 additions & 10 deletions src/cli/commands/anthropic.ts

This file was deleted.

1 change: 1 addition & 0 deletions src/cli/direct-runtime-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { isStartupTelemetryRequested } from "./instant-exit.js";

const NATIVE_UTILITY_COMMANDS = new Set([
"agents",
"anthropic",
"cost",
"export",
"hooks",
Expand Down
8 changes: 0 additions & 8 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1091,14 +1091,6 @@ export async function main(args: string[]) {
return;
}

if (parsed.command === "anthropic") {
const { handleAnthropicCommand } = await import(
"./cli/commands/anthropic.js"
);
await handleAnthropicCommand();
return;
}

if (parsed.command === "cost") {
console.error(chalk.red(`Unknown cost subcommand: ${parsed.subcommand}`));
console.log(chalk.dim("\nAvailable commands:"));
Expand Down
4 changes: 4 additions & 0 deletions test/cli-runtime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ describe("cli-runtime direct command dispatch", () => {
);

const cases: Array<[string[], string[]]> = [
[
["anthropic", "status"],
["anthropic", "status"],
],
[
["painter", "show", "image.png"],
["painter", "show", "image.png"],
Expand Down
23 changes: 0 additions & 23 deletions test/cli/anthropic-command.test.ts

This file was deleted.