Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 7. Appendix: Modifying the configuration of the command-line assistant


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

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

  1. Access the proxy configuration by opening the /etc/xdg/command-line-assistant/config.toml configuration file.
  2. Locate and change the following block in the config.toml file :

    # Backend settings for communicating with the external API.
    [backend]
    ...
    # proxies = { http = "http://example-host:8002", https = "https://example-host:8002" }
  3. Uncomment the proxies key and define your http or https proxy host:

    [backend]
    …
    # For a https proxy host
    proxies = { https = "https://<your-https-proxy-host:1234>"}
  4. After making the changes, restart clad for the changes to be effective:

    $ sudo systemctl restart clad
    Note

    You can use the http value and https key control if the http or https traffic from clad is 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

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

  1. Install the database of your choice:

    • To install MySQL, enter:

      # dnf install python3-PyMySQL
    • To install PostgreSQL, enter:

      # dnf install python3-psycopg2
  2. Access your database configuration file at /etc/xdg/command-line-assistant/config.toml.
  3. Locate and comment out the default configuration. For example:

     [database]
        # type = "sqlite"
        # connection_string = "/var/lib/command-line-assistant/history.db"
  4. Configure the database of your choice. The following information is also available in /etc/xdg/command-line-assistant/config.toml.

    1. Set the database type, where <db_type> can be mysql or postgresql.
    2. Set the database details.

       type = <db_type>
       host = "<hostname_or_ip_address>"
       port = "5432"
       username = "<database_user_name>"
       password = "<password>"
       database = "<database_name>"
  5. After changing the database type, restart the clad daemon 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

  1. Access your database configuration file at /etc/xdg/command-line-assistant/config.toml.
  2. Remove the username and password parameters from the [database] section, for example:

    [database]
    type = "postgresql"
    host = "localhost"
    port = "5432"
    database = "history"
    Note

    If you leave the username and password in the configuration file, these credentials take precedence over the systemd-creds tool.

  3. Generate encrypted credentials for your username or password. The following example uses systemd-ask-password commands. The name must follow the schema of database-username and database-password, otherwise, clad does not load the credentials properly.

    1. 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>.conf
    2. To 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
  4. After updating the database credentials, reload systemd and restart the clad daemon to apply the changes:

    $ sudo systemctl restart clad
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2026 Red Hat
Retour au début