Interacting with the command-line assistant powered by RHEL Lightspeed
Leverage the AI-driven expertise of the command-line assistant powered by RHEL Lightspeed to help you configure, manage, and troubleshoot RHEL
摘要
Providing feedback on Red Hat documentation 复制链接链接已复制到粘贴板!
We appreciate your feedback on our documentation. Let us know how we can improve it.
Submitting feedback through Jira (account required)
- Log in to the Jira website.
- Click Create in the top navigation bar
- Enter a descriptive title in the Summary field.
- Enter your suggestion for improvement in the Description field. Include links to the relevant parts of the documentation.
- Click Create at the bottom of the dialogue.
第 1 章 Introducing Red Hat Lightspeed for RHEL systems 复制链接链接已复制到粘贴板!
The Red Hat Lightspeed intelligent functionalities can help you to manage your system environment in a more accessible way, whether you are less experienced with RHEL or already have experience.
The command-line assistant powered by RHEL Lightspeed is an optional AI tool available within the RHEL command-line interface, and includes information from the Red Hat Knowledge Centered Service (KCS) articles, RHEL documentation, and other Red Hat resources. You can use the assistant to get help for example with the following activities:
- Answering RHEL-related questions
- Assistance with troubleshooting and fixing issues
- Understanding log files
- Asking for recommendations
You can use the command-line assistant powered by RHEL Lightspeed for interactive workflows to solve issues, implement new RHEL features, find information, and more. For example, you can run a command and then use the command-line assistant to help you understand the output and possible next steps. Or, you can ask a question on an SSH error, receive suggestions, and ask another question to continue diagnosing the problem.
You can interact with the command-line assistant powered by RHEL Lightspeed by using plain language instead of using complex commands as you might when using a standard command-line interface.
The command-line assistant powered by RHEL Lightspeed does not require direct internet connectivity. This is helpful if you do not want to have every RHEL system directly connected to a service over the internet. Instead, you can proxy all of the requests from RHEL systems through a single proxy system that is connected to the internet.
The RHEL Lightspeed command-line assistant follows the RHEL lifecycle. For information on supported versions and the associated policies, see the Red Hat Enterprise Linux Life Cycle for information on supported versions and the associated policies.
The command-line assistant does not have direct access to the information about the system it is running on. However, you can include information about your environment in the messages you input and which are then sent to the LLM provider. For example, the assistant is unable to provide answers on the free memory available on the system that it runs. Instead, the command-line assistant responds with information about a command that you can run to determine how much free memory there is.
1.2. How the command-line assistant processes your data 复制链接链接已复制到粘贴板!
While using the command-line assistant interface, you input messages that the command-line assistant transforms and sends to the LLM provider you have configured for your environment. These messages can contain information about aspects of your environment.
Do not enter information into the command-line assistant interface that you do not want to send to the LLM provider.
By using the command-line assistant powered by RHEL Lightspeed, you agree that Red Hat may use all of the messages that you exchange with the LLM provider. The feature is not intended to process personal information, and by using the command-line assistant powered by RHEL Lightspeed you agree to not include any personal information while using the command-line assistant. Support for AI features is provided only for the components that are provided by Red Hat.
Before you can start using the command-line assistant powered by RHEL Lightspeed, you must install it through the official RHEL repositories. The command-line assistant is supported in the following architectures:
-
AMD and Intel 64-bit (
x86_64) -
ARM64 (
aarch64) -
IBM Z (
s390x) -
IBM POWER systems (
ppc64)
To access the command-line assistant powered by RHEL Lightspeed, install it by using RHEL repositories. Do not use pip install command-line-assistant because Red Hat does not support this installation option.
Prerequisites
- You have a subscribed RHEL system. For more information, see Getting Started with RHEL System Registration documentation.
Procedure
On your RHEL system, run the following command:
$ sudo dnf install command-line-assistant
Verification
Verify that the installation works by running the command-line assistant. For example:
$ c "How to install python?"The output looks similar to the following example:
+*+ Asking Red Hat Lightspeed To install python....Disable the color output in the command-line assistant. For example:
$ NO_COLOR=1 c "How to install python?"
You can install the command-line assistant powered by RHEL Lightspeed to your host registered to Red Hat Satellite. For that, update the command-line assistant endpoint, so that the RHEL system registered to Satellite can proxy command-line assistant by using the Satellite Server.
Prerequisites
- Your system is registered with Red Hat Lightspeed for Red Hat Enterprise Linux.
- You are using the command-line assistant on a host registered to a Satellite 6.17+ server or later versions.
- The Satellite Server must be connected to the internet.
- You have enabled the AppStream repository on the host to be able to install the command-line assistant.
Procedure
Install command-line assistant powered by RHEL Lightspeed on your registered host.
$ sudo dnf install command-line-assistant-
Locate and open the
/etc/xdg/command-line-assistant/config.tomlfile. In the
config.tomlfile, replace the endpoint configuration option to point to your Satellite or Capsule hostname, for example:#The endpoint points to an API server. endpoint = "https://satellite.example.server.com/api/lightspeed/v1"-
Save the changes in the
config.tomlfile. Restart the command-line assistant daemon (
clad) for the changes to take effect:$ sudo systemctl restart clad
Troubleshooting
If the command-line assistant cannot trust the Red Hat Satellite certificate authority (CA), it cannot establish a secure connection to the Satellite Server. As a result, the assistant does not function. To work around this problem:
Copy the Satellite CA certificate to the system truststore:
$ sudo cp /etc/rhsm/ca/katello* /etc/pki/ca-trust/source/anchors/Update the CA trust database:
$ sudo update-ca-trust
You can use the command-line assistant component functions in Image Mode for RHEL during container builds and at runtime to perform necessary system tasks while maintaining the security and reliability benefits of read-only file systems on x86_64 and aarch64 architectures.
Prerequisites
-
The
container-toolsmeta-package is installed. - You have a subscribed RHEL system. For more information, see the Getting Started with RHEL System Registration documentation.
Procedure
Create a
Containerfile:$ cat Containerfile FROM registry.redhat.io/rhel10/rhel-bootc:latest RUN <<EORUN set -euxo pipefail dnf install -y command-line-assistant dnf clean all rm -rf /var/cache/dnf/ bootc container lint EORUNBuild the
<image>image by usingContainerfilein the current directory:$ podman build -t quay.io/<namespace>/<image>:<tag> .Build a disk image from the container image. The following example creates a QCOW2 image:
$ sudo podman run \ --rm \ -it \ --privileged \ --pull=newer \ --security-opt label=type:unconfined_t \ -v ./config.toml:/config.toml:ro \ -v ./output:/output \ -v /var/lib/containers/storage:/var/lib/containers/storage \ registry.redhat.io/rhel10/bootc-image-builder:latest \ --type qcow2 \ --config /config.toml \ quay.io/<namespace>/<image>:<tag>-
<namespace>: your container registry namespace. -
<image>: your image name. -
<tag>: your image tag, for example, latest.
-
- Boot a machine with the QCOW2 disk image. For instructions, see Deploying a container image by using KVM with a QCOW2 disk image.
Verification
Verify that the installation works by running the command-line assistant. For example:
$ c "How to deploy a QCOW2 disk image?"The output looks similar to the following example:
+*+ Asking RHEL Lightspeed To deploy a QCOW2 disk image....
The command-line assistant powered by RHEL Lightspeed can help 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, troubleshooting, interpreting 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.
5.1. Consulting 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.
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"
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, first 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 this file and to incorporate that information into the 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"
To view answers that the command-line assistant powered by RHEL Lightspeed provided you with previously, you can access your conversation history with the assistant.
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
To use the command-line assistant powered by RHEL Lightspeed to understand the output of a command, you can redirect the output of the command to the command-line 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> | c- If 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>"
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 will fail. 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 the Ctrl + D keys on your keyboard.:
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
RHEL command-line assistant for disconnected environments is available as a Developer Preview. You can use it in air-gapped networks, remote locations, and other environments with limited internet connectivity.
This version is packaged in a UBI-based container and includes simplified configuration, orchestration, and basic lifecycle management.
Red Hat Enterprise Linux (RHEL) command-line assistant is Developer Preview software only. Developer Preview software is not supported by Red Hat in any way and is not functionally complete or production-ready. Do not use Developer Preview software for production or business-critical workloads. Developer Preview software provides early access to upcoming product software in advance of its possible inclusion in a Red Hat product offering. Customers can use this software to test functionality and provide feedback during the development process. This software might not have any documentation, is subject to change or removal at any time, and has received limited testing. Red Hat might provide ways to submit feedback on Developer Preview software without an associated SLA.
For more information about the support scope of Red Hat Developer Preview software, see Developer Preview Support Scope.
With the Red Hat Enterprise Linux (RHEL) command-line assistant for disconnected environments, you can create a container image targeted for a single system. This image includes the following components:
-
An
installercontainer to pull the other required containers, install therhel-lightspeedcommand, and optionally create asystemdservice. -
An
rlsapicontainer to provide the endpoint used by the command-line assistant client. -
A
rag-databasecontainer that contains the retrieval-augmented generation (RAG) database, which supplements the knowledge of the LLM with additional data such as the RHEL documentation. -
A
ramalamacontainer that runs the LLM inference service. - The command-line assistant powered by RHEL Lightspeed.
The container image is intended for local, disconnected use on a single system. It is not designed for multi-system deployments or large-scale environments.
Install the RHEL command-line assistant in a disconnected environment by using the installation container image available on the Red Hat Container Registry. This container pulls the other required containers, installs the rhel-lightspeed commands, and optionally creates a systemd service.
Prerequisites
- Your RHEL system is registered to a Red Hat Satellite subscription.
- You have Podman installed.
-
You have the
container-toolsmeta-package installed.
Procedure
Authenticate to the Red Hat Container Registry:
$ podman login registry.redhat.ioRun the
installercontainer. This command downloads the necessary images and installs the offline RHEL command-line assistant on your system.$ podman run -u : --rm \ -v $HOME/.config:/config:Z \ -v $HOME/.local/bin:/config/.local/bin:Z \ registry.redhat.io/rhel-cla/installer:latestOptional: To automatically start the offline RHEL command-line assistant containers each time the system boots, add the
install-systemdargument to thepodman runcommand:$ podman run -u : --rm \ -v $HOME/.config:/config:Z \ -v $HOME/.local/bin:/config/.local/bin:Z \ registry.redhat.io/rhel-cla/installer:latest install-systemdVerify that the container is running:
$ podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS ba655e5efdcd installer-rh… /sbin/init 30 seconds ago Up 29 secondsInstall the RHEL
command-line-assistant clientpackage on your RHEL system:# sudo dnf install command-line-assistantUpdate the
endpointconfiguration option.-
Open the
/etc/xdg/command-line-assistant/config.tomlfile in a text editor. Locate the
endpointvariable and change its value to the address of the system hosting your offline RHEL command-line assistant containers. For example, to connect to the local system:endpoint = "http://127.0.0.1:8000/"
-
Open the
Restart the
cladservice to apply the new configuration:$ sudo systemctl restart cladAfter the installation is complete, you can use the
rhel-lightspeedcommand to start, stop, uninstall, and check the status of the offline RHEL command-line assistant.
Verification
Check if the offline RHEL command-line assistant is running:
$ rhel-lightspeed startCheck if the client is correctly configured by asking a question:
$ c "what is an immutable file?" + Asking Red Hat Lightspeed This feature uses AI technology. Do not include any personal information or other sensitive information in your input. Interactions may be used to improve Red Hat's products or services.
For better performance, you can change the configuration settings of the graphics processing unit (GPU) attached to the host system by editing the ~/.config/rhel-lightspeed/.env file. This file contains information to help you select the correct container image and device settings for your hardware.
Prerequisites
- You have installed the RHEL command-line assistant in a disconnected environment. See Installing the RHEL command-line assistant in disconnected environments.
Procedure
Open the
~/.config/rhel-lightspeed/.envfile in a text editor. For example:$ vi ~/.config/rhel-lightspeed/.envSet the
container imagevariable:Locate the
LLAMACPP_IMAGEvariable and set it up to the corresponding ramalama container for your GPU hardware. For example:LLAMACPP_IMAGE="registry.redhat.io/rhel-cla/ramalama-rhel10-nvidia:latest"
Set the
host devicevariable:Locate the
HOST_DEVICEvariable for the device of your GPU. For example:# For AMD GPUs HOST_DEVICE="/dev/dri" # For NVIDIA GPUs HOST_DEVICE="/dev/nvidia0"
Optional: Configure NVIDIA-specific variables:
- Locate and set up the NVIDIA-specific variables.
Restart the assistant to apply the changes:
$ rhel-lightspeed stop $ rhel-lightspeed start
Troubleshooting
Resolve GPU errors after restarting an EC2 instance.
When you use the offline RHEL command-line assistant on a GPU-enabled AWS EC2 instance, the rhel-lightspeed start command might fail after the instance is stopped and restarted. This error happens because the GPU ID changes after a restart. To work around this problem, regenerate the NVIDIA Container Device Interface (CDI) configuration file by running the following command:
$ nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yamlThis updates the reference of the system to the GPU, enabling the
rhel-lightspeedservice to start correctly.
You can use the command-line assistant powered by RHEL Lightspeed to request information on how to troubleshoot the issues that you face on your system.
To troubleshoot your system, ask a question by using the following syntax: c + "<question>". For example:
-
$ c "how to troubleshoot network errors" -
$ c "I cannot access my server with SSH. Can you give me a list of things to troubleshoot?" -
$ c "I am failing to start sssd process" -
$ c "I need to boot into a different kernel" -
$ 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 "I am failing to start sssd process"
You can use the command-line assistant powered by RHEL Lightspeed to troubleshoot an SSHD service that fails to start.
You can use these command-line assistant features:
- An optional terminal capture feature in the command-line assistant to reference the output of previous commands when interacting with the command-line assistant.
- Piping data into the command-line assistant.
Prerequisites
- You have enabled the command-line assistant.
- You have root access to your system.
Procedure
Check the SSHD status and restart it.
$ sudo systemctl status ssh $ sudo systemctl restart sshEnable the optional command-line assistant terminal capture feature:
$ c shell --enable-captureUse the
-w 1 "your_question"option to specify to include the output from the last command that was run.$ c -w 1 "what_is_this"- If you specify the number 2, that references the output from the second-to-last command. This is also true for the additional numbers.
You can also specify a prompt to run with the command and ask "help me understand the output", and reference the output with the error, so that the command-line assistant understands that you are asking for more details on what the error is.
The command-line assistant processes the request and provides several possible solutions. In the example, you can use the suggestion to run the
journalctl -xeu sshd.servicecommand to check the log files.
Run that
journalctlcommand and check the log files to identify potential issues.$ journalctl -xeu sshd.serviceAsk the command-line assistant to generate a command on how to fix this typing error.
$ c "what is the command that I can use to change 'Porrt' to 'Port' in the /etc/ssh/sshd_config file?"Run the command suggested by the command-line assistant as a sudo user. For example:
$ sudo sed -i s/Porrt/Port/g /etc/ssh/sshd_config
Verification
Restart the SSHD service and check the status of the SSHD.
$ sudo systemctl restart sshd $ sudo systemctl status sshd
You can troubleshoot SELinux issues by using the command-line assistant. The example troubleshooting process demonstrates the diagnostic capabilities of the command-line assistant.
Prerequisites
- You have enabled the command-line assistant.
- You have root access to your system.
Procedure
On your terminal, enter the following command to list the
httpdpackage version that you have installed in your system:$ sudo rpm -qa httpd httpd-2.4.62-2.fc40.x86_64Query all
httpdpackages:$ sudo rpm -qa httpdIdentify the ports on which the web server accepts incoming requests:
$ cat /etc/httpd/conf/httpd.conf | grep Listen # Listen: Allows you to bind Apache to specific IP addresses and/or # Change this to Listen on a specific IP address, but note that if #Listen 12.34.56.78:80 Listen 80Restart the
httpdservice:$ systemctl restart httpd Job for httpd. Service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xeu httpd.service" for details.Run the
journalctlcommand for more details on the failed service:$ sudo journalctl -xeu httpd.service
Use the command-line assistant to troubleshoot the issue and ask why the service is failing:
$ sudo c "why did httpd fail to start"Ask the command-line assistant about the
selinux httpdport:$ c "selinux httpd port"The assistant advises using the
sestatuscommand to check the current SELinux status and the content of the httpd services with the following command:$ sudo sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: enforcing Mode from config file: enforcing Policy MLS status: enabled Policy deny_unknown status: allowed Memory protection checking: actual (secure) Max kernel policy version: 33View the specific SELinux policy for the httpd services by running the following command:
$ sudo cat /usr/share/selinux/targeted/contexts/httpd_var_run_t No such file or directoryAsk the command-line assistant about contexts.
$ c "i don't have a httpd_var_run_t contexts"The command-line assistant takes some time to process the request, then provides several possible suggestions.
The assistant says that you might not have context and need to set it with the following command:
$ sudo chcon -R -t httpd_var_run_tAsk the CLA about the port:
$ c "selinux won't let httpd listen on port 12345"Try the following suggestion, run the command:
$ sudo semanage port -a -t httpd_port_t -p tcp 12345 ValueError: Type httpd_port_t is invalid, must be a port typeAsk the CLA about the error you see in the output:
$ c "how do I fix ValueError: Type httpd_port_t is invalid, must be a port type"
Run the steps provided by the CLA:
$ sudo ls -Z /usr/sbin/httpd system_u:object_r:httpd_exec_t:s0 /usr/sbin/httpd $ chcon -t httpd_exec_t /usr/sbin/httpd $ sudo setenforce 1Restart the
httpdservice and check the status ofhttpd.service:$ sudo systemctl restart httpd Job failed $ sudo systemctl status httpd.service Failed to start the Apache Server
Ask the CLA how to enable
httpdto listen onport12345:$ c "how do I enable httpd to listen on port 12345 selinux"Run the command advised by the CLA:
$ sudo setsebool -P httpd_can_network_connect=1
Restart the
httpdservice and check the status ofhttpd.serviceagain:$ sudo systemctl status httpd $ sudo systemctl restart httpd Job failed, see journalctlCheck the
journalctlservice:$ journalctl -xeu httpd Output: An ExecStart= process belonging to unit httpd.service has exited.Use the output to ask the CLA to troubleshoot:
$ c "An ExecStart= process belonging to unit httpd.service has exited."Run the command that the CLA responds with:
$ sudo ausearch -m AVC,USER_AVC -ts recent Output: "avc: denied {name_bind} for pid=7184 comm="httpd" src=12345 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r: unreserved_port_t:s0 tclas=tcp_socket permissive=0"Copy the output of the previous command:
$ sudo c "avc: denied {name_bind} for pid=7184 comm="httpd" src=12345 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r: unreserved_port_t:s0 tclas=tcp_socket permissive=0"Run the following command to resolve the error “SELinux is preventing Apache Server (httpd) from binding to port 12345".
$ sudo semanage port -a -t http_port_t -p tcp 12345
Verification
Restart the httpd service and check the status of
httpd.service:$ sudo systemctl restart httpd No error $ sudo systemctl status httpd.serviceThe server is configured, up and running, and listening on
port 443,port 12345.
Your system configuration might cause issues when installing and using the command-line assistant powered by RHEL Lightspeed. The following sections provide instructions on fixing the most common problems.
When you run the c command on your system, it might fail with the following error: "Could not find the TLS certificate file, invalid path: /etc/pki/consumer/cert.pem".
This error happens when the command-line assistant cannot find the TLS certificate file because of an invalid path. This could mean that your system is not registered.
Prerequisites
- You have installed the command-line assistant powered by RHEL Lightspeed.
Procedure
Check if the system is registered:
# subscription-manager identityIf the system is not registered, use the following command to register the system:
# subscription-manager register
8.2. Solving communication errors with the server 复制链接链接已复制到粘贴板!
If the c command fails when you run it on your system, it might fail due to a communication error with the server. To solve this issue, restart clad.
🙁 Communication error with the server: HTTPSConnectionPool(host='cert.console.redhat.com', port=443): Max retries exceeded with url: /api/lightspeed/v1/infer (Caused by ProtocolError('Connection aborted.', PermissionError(13, 'Permission denied'))). Please try again in a few minutes.
To fix the failing command, solve the communication error with the server.
Prerequisites
- You have installed the command-line assistant powered by RHEL Lightspeed.
Procedure
Restart the command-line assistant daemon (
clad).$ systemctl restart cladRerun the
ccommand with your question:$ c "<Your_question>"
8.3. The c command warns about the size of an attachment 复制链接链接已复制到粘贴板!
When you run the c command and try to attach a file, you might receive a warning about the size limit.
This happens because the assistant has a 2KB limit for the client. Starting with RHEL 10.1, the context limit is 32KB.
"Error: The total size of your question and context (478.46 KB) exceeds the limit of 2.00 KB. Trimming it down to fit in the expected size, you may lose some context."
If a file exceeds the maximum size, the system truncates the file, which can result in incomplete data or loss of context.
8.4. Reloading the updated certificates 复制链接链接已复制到粘贴板!
If you run the command-line assistant daemon (clad) as a non-root user, the updated certificates do not reload correctly. This issue occurs because only root users can own and access the certificate files located in the /etc/pki/consumer/ directory.
To fix this issue, use the following steps:
Prerequisites
- You have installed the command-line assistant powered by RHEL Lightspeed.
Procedure
Change the
key.pempermission to root.$ sudo ls -l /etc/pki/consumer/ $ sudo chown $(whoami):$(id -gn) /etc/pki/consumer/${<key_name>}Run
cladcommands as root.$ sudo chown $(whoami):$(id -gn) /etc/pki/consumer/${<key_name>}
The command-line assistant daemon (clad) is the core of the command-line assistant powered by RHEL Lightspeed. clad manages communication with Red Hat Lightspeed services, such as user history management.
Optionally, to integrate the Red Hat Lightspeed services with your existing infrastructure, you can modify the configuration of the command-line assistant to use a network proxy or connect to a different database.
9.1. Setting up a proxy configuration 复制链接链接已复制到粘贴板!
If you need a proxy for Internet access, you can set up a proxy configuration by making the following changes in the config.toml configuration file.
Prerequisites
- The command-line assistant powered by RHEL Lightspeed is installed.
Procedure
-
Access the proxy configuration by opening the
/etc/xdg/command-line-assistant/config.tomlconfiguration file. Locate and change the following block in the
config.tomlfile :# Backend settings for communicating with the external API. [backend] ... # proxies = { http = "http://example-host:8002", https = "https://example-host:8002" }Uncomment the
proxieskey and define yourhttporhttpsproxy host:[backend] … # For a https proxy host proxies = { https = "https://<your_https_proxy_host:1234>"}After making the changes, restart
cladfor the changes to be effective:$ sudo systemctl restart clad注意You can use the
httpvalue andhttpskey control if the http or https traffic fromcladis routed to the specified proxy. However, the protocol does not influence the proxy type selection, and you can have a configuration that uses http proxy for https traffic. For example:https = "http://<your_https_proxy_host:1234>"
To store information and provide access to your history database, the command-line assistant daemon (clad) uses an unencrypted SQLite database by default. If you require a different database for your deployment, you can install and connect to a different database back end, such as PostgreSQL or MySQL.
clad does not include these databases by default to avoid bringing unwanted dependencies to your system.
With the unencrypted SQLite database, you can store information and have access to your history database from the command-line assistant.
Prerequisites
- You have installed the command-line assistant.
Procedure
Install the database of your choice:
To install MySQL, enter:
# dnf install python3-PyMySQLTo install PostgreSQL, enter:
# dnf install python3-psycopg2
-
Access your database configuration file at
/etc/xdg/command-line-assistant/config.toml. Locate and comment out the default configuration. For example:
[database] # type = "sqlite" # connection_string = "/var/lib/command-line-assistant/history.db"Configure the database of your choice. The following information is also available in
/etc/xdg/command-line-assistant/config.toml.-
Set the database type, where
<db_type>can bemysqlorpostgresql. Set the database details.
type = <db_type> host = "<hostname_or_ip_address>" port = "5432" username = "<database_user_name>" password = "<password>" database = "<database_name>"
-
Set the database type, where
After changing the database type, restart the
claddaemon to apply the changes:$ sudo systemctl restart clad
You can use the systemd-creds tool to securely store your encrypted credentials, and use the secrets stored in systemd-creds to connect to the database of your choice: PostgreSQL, SQLite, or MySQL.
Prerequisites
- The command-line assistant.
- Access to the database configuration file.
Procedure
-
Access your database configuration file at
/etc/xdg/command-line-assistant/config.toml. Remove the
usernameandpasswordparameters from the[database]section, for example:[database] type = "postgresql" host = "localhost" port = "5432" database = "history"注意If you leave the username and password in the configuration file, these credentials take precedence over the
systemd-credstool.Generate encrypted credentials for your username or password. The following example uses
systemd-ask-passwordcommands. The name must follow the schema ofdatabase-usernameanddatabase-password, otherwise,claddoes not load the credentials properly.To generate an encrypted username, run the following command:
$ systemd-ask-password -n | ( echo "[Service]" && systemd-creds encrypt --name=<database_username> -p - - ) >/etc/systemd/system/clad.service.d/<username>.confTo generate an encrypted password, run the following command:
$ systemd-ask-password -n | ( echo "[Service]" && systemd-creds encrypt --name=<database_password> -p - - ) >/etc/systemd/system/clad.service.d/<password>.conf
After updating the database credentials, reload
systemdand restart thecladdaemon to apply the changes:$ sudo systemctl daemon-reload $ sudo systemctl restart clad
Review the following information about how the command-line assistant uses your data.
- What system information can the command-line assistant directly access?
The command-line assistant powered by RHEL Lightspeed cannot directly access information from your system. For example, if you ask "how much free memory does this system have?", the command-line assistant cannot directly gather this information from your system. Instead, the command-line assistant can help you find commands to display how much free memory the system has.
You can provide information to the command-line assistant by using various methods, such as the following:
- Including the information in the prompt or question.
-
Attaching a file to the command-line assistant with the
--attachmentoption. - By using a shell pipeline to pass output from a command to the command-line assistant.
-
By using the
--with-outputoption.
- What is the process flow for input and output in the command-line assistant?
The command-line assistant receives your question as an input.
The command-line assistant logs and stores complete transcripts of conversations with the user. This includes the following information:
- Queries from the user.
- The complete message is sent to the configured Large Language Model (LLM) provider, which includes system instructions, referenced documentation, and the user question.
- The complete response from the LLM provider.
- The input is processed by the back end.
- The command-line assistant searches for relevant knowledge related to your query.
- The command-line assistant takes your query, the relevant knowledge, and other instructions, and sends everything for AI inference.
You receive an output from the command-line assistant as a response.
The command-line assistant is not intended to process personal information, and you agree to not include any personal information in the input.
Note that the interactions that you have with the command-line assistant are logged locally on your system, which makes it possible for you to access your chat history. These interactions are also logged on the service, and may be used to improve Red Hat’s products or services.