Chatting with Amazon Q in the command line
The Amazon Q command line is a command-line interface that allows you to interact with the Amazon Q. With the Amazon Q command line, you can engage in natural language conversations, ask questions, and receive responses from Amazon Q, all within your terminal environment.
Context integration
One of the powerful features of the Amazon Q command line is its ability to integrate contextual information from your local development environment. By using context modifiers, you can provide the Amazon Q with relevant context, such as your git repository status, local shell environment variables, and shell command history. This context integration enhances the AI model's understanding of your specific use case, enabling it to provide more relevant and context-aware responses.
Context modifiers
The Amazon Q command line supports the following context modifiers:
-
@git: This modifier allows you to pass information about your git repository status, including the current branch, staged and unstaged changes, and commit history.
-
@env: By using this modifier, you can provide the Amazon Q with your local shell environment variables, which can be useful for understanding your development setup and configuration.
-
@history: The @history modifier allows you to share your recent shell command history with Amazon Q, giving it insights into the actions you've taken and the context in which you're working.
Usage
To start using the Amazon Q command line, follow these steps:
-
Open your terminal or command prompt.
-
Run the q chat command to initiate a conversation with Q.
-
Optionally, include any context modifiers (for example, @git, @env, @history) in your input to provide additional context to the model.
-
Type your query or input, and press Enter.
-
The Amazon Q will process your input, considering any provided context, and respond with its output.
-
Continue the conversation by providing additional input or asking follow-up questions.