Chapter 5. Using the command-line assistant powered by RHEL Lightspeed on RHEL systems
The command-line assistant powered by RHEL Lightspeed helps you to interact with and find information about RHEL by using the command-line interface. Use the command-line assistant to answer RHEL-related questions, troubleshoot, interpret log entries, and perform many other tasks.
Do not rely on the results from AI tools without human review. Always check the AI and LLM-generated responses for accuracy before using the generated suggestions.
5.1. Consulting the command-line assistant Copy linkLink copied to clipboard!
To use the command-line assistant powered by RHEL Lightspeed, use the c command followed by your questions in quotation marks.
Do not enter the following types of data when using the command-line assistant, because the assistant is not intended to process data such as:
- Personal information
- Business-sensitive information
- Confidential information
- System data information
Prerequisites
- You have installed the command-line assistant powered by RHEL Lightspeed. See the Installing the command-line assistant powered by RHEL Lightspeed documentation.
Procedure
Use the
ccommand, followed by your questions in quotation marks. The following are examples of prompts that you can use to interact with the command-line assistant when using your RHEL system:Ask a data-based question:
$ c "What is RHEL"Request information on how to troubleshoot a problem with SSHD:
$ c "how to troubleshoot sshd failing to start"Request information on how to find files under
/etc:$ c "how do I find all the files in the /etc/ that have been modified in the last hour"
5.2. Attaching a file to your questions for the command-line assistant Copy linkLink copied to clipboard!
You can attach a file to the command-line assistant powered by RHEL Lightspeed. In response, the assistant can provide a tailored answer based on that file.
Prerequisites
- You have installed the command-line assistant powered by RHEL Lightspeed. See the Installing the command-line assistant powered by RHEL Lightspeed documentation.
-
You have created a readable file with the information that you want the command-line assistant to use. The following examples use the
storage_infofile, which contains information about the volume group, logical volumes and file systems on another system.
Procedure
To replicate the storage configuration on another system, save the layout of the volume group, logical volumes, and file systems to a
<storage_info>file. Then, use the command-line assistant to read the file and incorporate the information into next steps.$ c --attachment <storage_info>Optionally, use the short version of the
attachmentcommand:$ c -a <storage_info>Combine the attachment with a question:
$ c --attachment <storage_info> "how can I replicate the storage configuration in another system"
5.3. Checking your history of interactions with the command-line assistant Copy linkLink copied to clipboard!
Access your conversation history to view previous answers from the command-line assistant powered by RHEL Lightspeed.
Prerequisites
- You have installed the command-line assistant powered by RHEL Lightspeed. See the Installing the command-line assistant powered by RHEL Lightspeed documentation.
Procedure
Use the
c historycommand to parse your conversation history. For example:Fetch all user history:
$ c history --allAccess the first conversation from history:
$ c history --firstAccess the last conversation from history:
$ c history --lastFilter your history conversation to search for a term to retrieve all questions and answers related to that word:
$ c history --filter "podman"Clear all the user history:
$ c history --clear
5.4. Redirecting a command output to the command-line assistant Copy linkLink copied to clipboard!
To use the command-line assistant powered by RHEL Lightspeed to understand a command output, redirect the output of the command to the assistant.
Prerequisites
- You have installed the command-line assistant powered by RHEL Lightspeed.
Procedure
Redirect the log file output containing information that you want to understand to the command-line assistant:
$ cat <log_file.log> | cIf the error or log that you provided to the command-line assistant do not provide enough information, combine the redirect output with a question:
$ cat <log_file_error.log> | c "how do I solve this?"You can also redirect a question:
$ echo "how do I solve this?" | c -a <log_file_error.log>"
5.5. Enabling the command-line assistant to capture your terminal activity Copy linkLink copied to clipboard!
You can use the command-line assistant powered by RHEL Lightspeed to reference commands that you previously ran.
If you add terminal context in a request and there are no previously captured commands, the command fails. You can only add context from the terminal while the capture mode is enabled.
Prerequisites
- You have installed the command-line assistant powered by RHEL Lightspeed. See the Installing the command-line assistant powered by RHEL Lightspeed documentation.
Procedure
Enable the terminal capture for your current terminal session:
$ c shell --enable-capture- Run at least one command before you reference previous commands.
Reference the output of a previously run command. For example, to reference the previous command, run:
$ c -w 1 "what_is_this"To reference the second to previous command, run:
$ c -w 2 "what_is_this"
- To stop terminal capture, press Ctrl + D.
5.6. Submitting feedback about the command-line assistant responses Copy linkLink copied to clipboard!
Help improve the quality of the responses that you receive when you interact with the command-line assistant powered by RHEL Lightspeed by submitting feedback on its responses.
Prerequisites
- You have installed the command-line assistant powered by RHEL Lightspeed.
Procedure
Run the following command:
$ c feedback