Chapter 3. Using the command-line assistant powered by RHEL Lightspeed on RHEL systems
The command-line assistant powered by RHEL Lightspeed is designed to assist both less experienced and experienced users to interact with RHEL by using the command-line interface. The command-line assistant can help you with tasks such as: answering RHEL related questions, assisting with troubleshooting, assisting with deciphering log entries, and 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.
3.1. Asking questions to 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. For example:
Ask a question by using the following syntax: c + “question". For example:
$ c “What is RHEL"
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
The following are examples of prompts that you can use to interact with the command-line assistant when using your RHEL systems:
Request information on how to troubleshooting a problem:
$ c “how to troubleshoot sshd failing to start"
$ c “how do I find all the files in the /ect that have been modified in the last hour"
3.2. Attaching a file to your questions to the command-line assistant Copy linkLink copied to clipboard!
You can attach a file to the command-line assistant powered by RHEL Lightspeed. By doing so, the assistant can provide a tailored response based on that file.
For example, if you want to replicate the volume group, logical volumes, and file systems on another system, you can create a file with the storage information, and run the command-line assistant to get information about the required steps to replicate that specific storage partition in another system. For example:
$ c --attachment <storage_info>
Optionally, use the short version of the attachment command. For example:
# $ c -a <storage_info>
You can also combine the attachment with a question:
# $ c --attachment <storage_info> "how can I replicate the storage configuration in another system
3.3. Checking your history interaction with the command-line assistant Copy linkLink copied to clipboard!
Access your conversation history with the command-line assistant powered by RHEL Lightspeed.
Fetch all user history. For example:
$ c history --allAccess the first conversation from history. For example:
$ c history --firstAccess the last conversation from history. For example:
$ c history --lastFilter your history conversation to search for a term to retrieve all questions and answers related to that word. For example:
$ c history --filter “podman"Clear all the user history:
$ c history --clear
3.4. Redirecting a command output to the command-line assistant Copy linkLink copied to clipboard!
Use the log file that contains information that you want to understand by redirecting that log file output to command-line assistant powered by RHEL Lightspeed.
$ cat <log_file.log> | c
If the error or log that you have provided to the command-line assistant does not provide enough information, you can combine the redirect output with a question, for example:
$ 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>"
3.5. Enabling the command-line assistant to capture your terminal activity Copy linkLink copied to clipboard!
The command-line assistant powered by RHEL Lightspeed has an optional feature that enables you to reference commands that you previously ran.
If you add terminal context in a request and there are no previously captured commands, the command will fail. You can only add context from the terminal while the capture mode is enabled.
Enable the terminal capture for your current terminal session. For example:
$ c shell --enable-captureRun at least one command before you reference previous commands.
After you enable the capture, you can reference the previous output of a command that you ran. For example, to reference the last command, run:
$ c -w 1 "what_is_this"To reference the second to last command, run:
$ c -w 2 "what_is_this"To stop terminal capture, press the following keys on your keyboard:
$ Press Ctrl + D
3.6. Submitting feedback about the command-line assistant responses Copy linkLink copied to clipboard!
You can submit feedback about the responses that you receive when you interact with the command-line assistant powered by RHEL Lightspeed:
$ c feedback