Chapter 4. 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.
4.1. Asking questions to the command-line assistant
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"
$ c "What is RHEL"
Copy to Clipboard Copied!
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 to troubleshoot sshd failing to start"
c "how do I find all the files in the /etc that have been modified in the last hour"
$ c "how do I find all the files in the /etc that have been modified in the last hour"
4.2. Attaching a file to your questions to the command-line assistant
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>
$ c --attachment <storage_info>
Optionally, use the short version of the attachment
command. For example:
c -a <storage_info>
$ 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"
$ c --attachment <storage_info> "how can I replicate the storage configuration in another system"
4.3. Checking your history interaction with the command-line assistant
Access your conversation history with the command-line assistant powered by RHEL Lightspeed.
Fetch all user history. For example:
c history --all
$ c history --all
Copy to Clipboard Copied! Access the first conversation from history. For example:
c history --first
$ c history --first
Copy to Clipboard Copied! Access the last conversation from history. For example:
c history --last
$ c history --last
Copy to Clipboard Copied! Filter your history conversation to search for a term to retrieve all questions and answers related to that word. For example:
c history --filter “podman”
$ c history --filter “podman”
Copy to Clipboard Copied! Clear all the user history:
c history --clear
$ c history --clear
Copy to Clipboard Copied!
4.4. Redirecting a command output to the command-line assistant
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
$ 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?"
$ 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>"
$ echo "how do I solve this?" | c -a <log_file_error.log>"
4.5. Enabling the command-line assistant to capture your terminal activity
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-capture
$ c shell --enable-capture
Copy to Clipboard Copied! Run 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"
$ c -w 1 "what_is_this"
Copy to Clipboard Copied! To reference the second to last command, run:
c -w 2 "what_is_this"
$ c -w 2 "what_is_this"
Copy to Clipboard Copied! To stop terminal capture, press the following keys on your keyboard:
Press Ctrl + D
$ Press Ctrl + D
Copy to Clipboard Copied!
4.6. Submitting feedback about the command-line assistant responses
You can submit feedback about the responses that you receive when you interact with the command-line assistant powered by RHEL Lightspeed:
c feedback
$ c feedback