Skip to content

Commit 9e4c257

Browse files
authored
chore: deprecate slash profile subcommand (#2468)
1 parent 5a400b4 commit 9e4c257

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

crates/chat-cli/src/cli/chat/cli/mod.rs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use tools::ToolsArgs;
2929

3030
use crate::cli::chat::cli::subscribe::SubscribeArgs;
3131
use crate::cli::chat::cli::usage::UsageArgs;
32+
use crate::cli::chat::consts::AGENT_MIGRATION_DOC_URL;
3233
use crate::cli::chat::{
3334
ChatError,
3435
ChatSession,
@@ -48,8 +49,10 @@ pub enum SlashCommand {
4849
/// Clear the conversation history
4950
Clear(ClearArgs),
5051
/// Manage agents
51-
#[command(subcommand, aliases = ["profile"])]
52+
#[command(subcommand)]
5253
Agent(AgentSubcommand),
54+
#[command(hide = true)]
55+
Profile,
5356
/// Manage context files for the chat session
5457
#[command(subcommand)]
5558
Context(ContextSubcommand),
@@ -90,6 +93,29 @@ impl SlashCommand {
9093
Self::Quit => Ok(ChatState::Exit),
9194
Self::Clear(args) => args.execute(session).await,
9295
Self::Agent(subcommand) => subcommand.execute(os, session).await,
96+
Self::Profile => {
97+
use crossterm::{
98+
execute,
99+
style,
100+
};
101+
execute!(
102+
session.stderr,
103+
style::SetForegroundColor(style::Color::Yellow),
104+
style::Print("This command has been deprecated. Use"),
105+
style::SetForegroundColor(style::Color::Cyan),
106+
style::Print(" /agent "),
107+
style::SetForegroundColor(style::Color::Yellow),
108+
style::Print("instead.\nSee "),
109+
style::Print(AGENT_MIGRATION_DOC_URL),
110+
style::Print(" for more detail"),
111+
style::Print("\n"),
112+
style::ResetColor,
113+
)?;
114+
115+
Ok(ChatState::PromptUser {
116+
skip_printing_tools: true,
117+
})
118+
},
93119
Self::Context(args) => args.execute(os, session).await,
94120
Self::Knowledge(subcommand) => subcommand.execute(os, session).await,
95121
Self::PromptEditor(args) => args.execute(session).await,
@@ -128,6 +154,7 @@ impl SlashCommand {
128154
Self::Quit => "quit",
129155
Self::Clear(_) => "clear",
130156
Self::Agent(_) => "agent",
157+
Self::Profile => "profile",
131158
Self::Context(_) => "context",
132159
Self::Knowledge(_) => "knowledge",
133160
Self::PromptEditor(_) => "editor",

crates/chat-cli/src/cli/chat/consts.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ pub const AGENT_FORMAT_HOOKS_DOC_URL: &str =
3232

3333
pub const AGENT_FORMAT_TOOLS_DOC_URL: &str =
3434
"https://github.com/aws/amazon-q-developer-cli/blob/main/docs/agent-format.md#tools-field";
35+
36+
pub const AGENT_MIGRATION_DOC_URL: &str =
37+
"https://github.com/aws/amazon-q-developer-cli/blob/main/docs/legacy-profile-to-agent-migration.md";

0 commit comments

Comments
 (0)