File tree Expand file tree Collapse file tree 4 files changed +24
-4
lines changed
crates/chat-cli/src/cli/chat Expand file tree Collapse file tree 4 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ The files matched by these rules provide Amazon Q with additional information
28
28
about your project or environment. Adding relevant files helps Q generate
29
29
more accurate and helpful responses.
30
30
31
- Notes
31
+ Notes:
32
32
• You can add specific files or use glob patterns (e.g., \" *.py\" , \" src/**/*.js\" )
33
33
• Profile rules apply only to the current profile
34
34
• Global rules apply across all profiles
@@ -65,6 +65,8 @@ pub enum ContextSubcommand {
65
65
#[ arg( short, long) ]
66
66
global : bool ,
67
67
} ,
68
+ #[ command( hide = true ) ]
69
+ Hooks ,
68
70
}
69
71
70
72
impl ContextSubcommand {
@@ -370,6 +372,18 @@ impl ContextSubcommand {
370
372
) ?;
371
373
} ,
372
374
} ,
375
+ Self :: Hooks => {
376
+ execute ! (
377
+ session. stderr,
378
+ style:: SetForegroundColor ( Color :: Yellow ) ,
379
+ style:: Print ( "The /context hooks command is deprecated. Use " ) ,
380
+ style:: SetForegroundColor ( Color :: Green ) ,
381
+ style:: Print ( "/hooks" ) ,
382
+ style:: SetForegroundColor ( Color :: Yellow ) ,
383
+ style:: Print ( " instead.\n \n " ) ,
384
+ style:: SetForegroundColor ( Color :: Reset )
385
+ ) ?;
386
+ } ,
373
387
}
374
388
375
389
Ok ( ChatState :: PromptUser {
Original file line number Diff line number Diff line change @@ -393,7 +393,7 @@ impl HookExecutor {
393
393
commands will be appended to the prompt to Amazon Q. Hooks can be defined
394
394
in global or local profiles.
395
395
396
- Notes
396
+ Notes:
397
397
• Hooks are executed in parallel
398
398
• 'conversation_start' hooks run on the first user prompt and are attached once to the conversation history sent to Amazon Q
399
399
• 'per_prompt' hooks run on each user prompt and are attached to the prompt, but are not stored in conversation history"
Original file line number Diff line number Diff line change @@ -53,7 +53,8 @@ pub enum SlashCommand {
53
53
/// Manage context files for the chat session
54
54
#[ command( subcommand) ]
55
55
Context ( ContextSubcommand ) ,
56
- /// Manage knowledge base for persistent context storage
56
+ /// (Beta) Manage knowledge base for persistent context storage. Requires "q settings
57
+ /// chat.enableKnowledge true"
57
58
#[ command( subcommand) ]
58
59
Knowledge ( KnowledgeSubcommand ) ,
59
60
/// Open $EDITOR (defaults to vi) to compose a prompt
Original file line number Diff line number Diff line change @@ -1251,7 +1251,12 @@ impl ChatSession {
1251
1251
match SlashCommand :: try_parse_from ( args) {
1252
1252
Ok ( command) => {
1253
1253
match command. execute ( os, self ) . await {
1254
- Ok ( chat_state) if matches ! ( chat_state, ChatState :: Exit ) => return Ok ( chat_state) ,
1254
+ Ok ( chat_state)
1255
+ if matches ! ( chat_state, ChatState :: Exit )
1256
+ || matches ! ( chat_state, ChatState :: HandleInput { input: _ } ) =>
1257
+ {
1258
+ return Ok ( chat_state) ;
1259
+ } ,
1255
1260
Err ( err) => {
1256
1261
queue ! (
1257
1262
self . stderr,
You can’t perform that action at this time.
0 commit comments