Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Interacting with the command-line assistant powered by RHEL Lightspeed
Leverage AI-driven expertise of the command-line assistant powered by RHEL Lightspeed to help you configure, manage, and troubleshoot RHEL
Abstract
Providing feedback on Red Hat documentation Link kopierenLink in die Zwischenablage kopiert!
We are committed to providing high-quality documentation and value your feedback. To help us improve, you can submit suggestions or report errors through the Red Hat Jira tracking system.
Procedure
Log in to the Jira website.
If you do not have an account, select the option to create one.
- 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.
Chapter 1. Introducing Red Hat Lightspeed for RHEL systems Link kopierenLink in die Zwischenablage kopiert!
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.
1.1. The command-line assistant powered by RHEL Lightspeed Link kopierenLink in die Zwischenablage kopiert!
The command-line assistant powered by RHEL Lightspeed is an optional AI tool available within the RHEL command-line interface that includes information from the Red Hat knowledge from Knowledge Centered Service (KCS) articles, RHEL documentation, among other Red Hat resources. You can use the assistant to get help with the following activities, including others:
- Answering RHEL related questions
- Assistance 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 to understand the output and possible next steps. Or, you can ask a question on SSH, 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 in cases where, if you do not want to have every RHEL system directly connected to a service over the internet, you can proxy all of the requests from RHEL systems through a single proxy system that is connected to the internet.
The LLM model backing the AI-command-line assistant uses Google Gemini.
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 Link kopierenLink in die Zwischenablage kopiert!
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.
Chapter 2. Installing the command-line assistant powered by RHEL Lightspeed Link kopierenLink in die Zwischenablage kopiert!
The command-line assistant powered by RHEL Lightspeed is an optional tool available through the official RHEL 9 repositories.
2.1. Installing the command-line assistant powered by RHEL Lightspeed Link kopierenLink in die Zwischenablage kopiert!
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?"
2.2. Provisioning the command-line assistant to RHEL deployments with Red Hat Satellite Link kopierenLink in die Zwischenablage kopiert!
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 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 command-line assistant daemon (
clad) for the changes to be effective::$ 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
Chapter 3. Using the command-line assistant powered by RHEL Lightspeed on RHEL systems Link kopierenLink in die Zwischenablage kopiert!
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 Link kopierenLink in die Zwischenablage kopiert!
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 Link kopierenLink in die Zwischenablage kopiert!
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 Link kopierenLink in die Zwischenablage kopiert!
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 Link kopierenLink in die Zwischenablage kopiert!
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 Link kopierenLink in die Zwischenablage kopiert!
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 Link kopierenLink in die Zwischenablage kopiert!
You can submit feedback about the responses that you receive when you interact with the command-line assistant powered by RHEL Lightspeed:
$ c feedback
Chapter 4. Using the command-line assistant component functions in Image Mode for RHEL Link kopierenLink in die Zwischenablage kopiert!
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/rhel9/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/rhel9/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....
Chapter 5. Using the command-line assistant to debug or troubleshoot system issues Link kopierenLink in die Zwischenablage kopiert!
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.
The following are examples of questions that you can ask 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"
5.1. Using the command-line assistant to troubleshoot SSHD service failing to start Link kopierenLink in die Zwischenablage kopiert!
The following example shows how to troubleshoot an SSHD service failing to start by using the following command-line assistant features:
- 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 previous 2 commands. 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 my assistant understands that you are asking for more details on what is the error.
The command-line assistant takes some time to process the request, and provide several possible solutions. In the example, you can use the suggestion to run the
journalctl -xeucommand, so that you can usesshd.serviceto check the log files.
Run that
journalctlcommand. Add the tail command to get the last 30 lines, pipe that output into the command-line assistant, and add a query to understand the error.$ journalctl -xeu sshd.service | tail -n 30 | c “here are the logs, please help me understand this"The command-line assistant checks the log files and indicates some potential issues. typing error in the
configfile.Ask 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?”Use the command suggested by the command-line assistant.
Run the command suggested by the command-line assistant. For example:
$ sed -i s/Porrt/Port/g /etc/ssh/sshd_configThe output found a permission denied error to edit that file. Rerun the previous command as a sudo user.
$ sudo sed -i s/Porrt/Port/g /etc/ssh/sshd_configRestart the SSHD service and check the status of the SSHD.
$ sudo systemctl restart sshd $ sudo systemctl status sshd
5.2. Using the command-line assistant to troubleshoot SELinux issues Link kopierenLink in die Zwischenablage kopiert!
The following example provides steps to troubleshoot an SELinux problem with 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_64Show the
httpd.conffile content.$ sudo cat /etc/httpd/conf/httpd.conf # This is the main Apache HTTP server configuration file. It contains the # configuration directives that give the server its instructions. # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information. # In particular, see<URL:http://httpd.apache.org/docs/2.4/mod/directives.html> # for a discussion of each configuration directive.Query all
httpdqpackages:$ sudo rpm -qa httpdqIdentify 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"One of the suggestions from the assistant is to query audit logs by using the
ausearchtool, and use theAVCandUSER_AVCvalues for the message type parameter. For that, run the following command:$ sudo ausearch -m AVC,USER_AVC -ts recentAsk the command-line assistant about the
selinux httpdport:$ c “selinux httpd port"The assistant advises to use 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 semage 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 getenforce Enforcing $ setenforce 0 $ sudo systemctl restart httpd $ sudo systemctl status httpd $ 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 htppd $ 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 semage port -a -t http_port_t -p tcp 12345
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.
Chapter 6. Troubleshooting the command-line assistant powered by RHEL Lightspeed Link kopierenLink in die Zwischenablage kopiert!
Diagnose and resolve issues when installing and using the command-line assistant powered by RHEL Lightspeed. Note that this is not an exhaustive list.
Could not find the TLS certificate file, invalid path: /etc/pki/consumer/cert.pem
When you ask a question to the command-line assistant and the assistant fails because the TLS certificate file cannot be found because of an invalid path, it could mean that your system is not registered.
To resolve the error, ensure that you register the system. Follow the steps:
Check if the system is registered:
# subscription-manager identity
If the system is not registered, use the following command to register the system:
# subscription-manager register --username <username> --password <password>
Communication error with the server
When you try to run the c command on your system, it fails with the following error:
🙁 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 resolve the error, restart the command-line assistant daemon (clad) and rerun the c command:
$ systemctl restart clad
$ c “<Your_question>"
Warning when attaching file
When you run the c command and try to attach a file, you might receive a warning about the size limit.
"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."
This happens because the assistant has a 2KB limit for the client. Starting with RHEL 9.7, the context limit is 32KB.
Clad is not reloading the updated certificate correctly
When you try to run clad as a non-root user, clad does not reload the updated certificate correctly. The certs under /etc/pki/consumer need to be owned by root, because it must access a file that is readable only by root.
To resolve the error, change the key.pem permission to root and run the clad commands as root.
$ sudo ls -l /etc/pki/consumer/
$ sudo chown $(whoami):$(id -gn) /etc/pki/consumer/${KEY_NAME}
Chapter 7. Appendix: Modifying the configuration of the command-line assistant Link kopierenLink in die Zwischenablage kopiert!
The command-line assistant daemon (clad) is the core of the command-line assistant powered by RHEL Lightspeed that manages the communication with the Red Hat Lightspeed services, such as user history management, among other services. The clad is a dbus activated daemon. Any interaction with the command-line assistant, for example, by entering a c command, activates the daemon.
You can modify the command-line assistant configuration, for example, if you use a proxy, or connect to a different database. Note that these configurations are optional.
7.1. Setting up a proxy configuration Link kopierenLink in die Zwischenablage kopiert!
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 cladNoteYou 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>"
Managing databases with the command-line assistant daemon
To store information and give you access to your history database, by default, command-line assistant daemon (clad) uses an unencrypted SQLite database. You can install and connect to a different database backend, such as PostgreSQL or MySQL. Clad does not include these databases by default to avoid bringing unwanted dependencies to your system.
7.2. Changing the default database in the configuration file Link kopierenLink in die Zwischenablage kopiert!
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
7.3. Connecting to your database by using the stored systemd-creds passwords Link kopierenLink in die Zwischenablage kopiert!
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"NoteIf 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, enter:
$ 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 restart clad
Chapter 8. Frequently asked questions about user data security Link kopierenLink in die Zwischenablage kopiert!
What system information can the command-line assistant directly access?
The command-line assistant cannot directly access information from your system. For example, if you ask the command-line assistant a question such as "how much free memory does this system have?", the command-line assistant cannot directly gather this information from the system. Instead, the command-line assistant can help you find a command 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.
Command line-assistant logs and stores complete transcripts of conversations that users have with the command-line assistant. 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 backend.
- The command-line assistant searches for relevant knowledge related to your query.
- The command-line assistant takes your query, relevant knowledge, and other instructions and sends 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 so that you can have access to your chat history. Those interactions are also logged on the service, and may be used to improve Red Hat’s products or services.