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 RHEL 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" }
    Copy to Clipboard
  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>"}
    Copy to Clipboard
  4. After making the changes, restart clad for the changes to be effective:

    $ sudo systemctl restart clad
    Copy to Clipboard
    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>"
    Copy to Clipboard

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
      Copy to Clipboard
    • To install PostgreSQL, enter:

      # dnf install python3-psycopg2
      Copy to Clipboard
  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"
    Copy to Clipboard
  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>"
      Copy to Clipboard
  5. After changing the database type, restart the clad daemon to apply the changes:

    $ sudo systemctl restart clad
    Copy to Clipboard

7.3. Connecting to your database by using the stored systemd-creds passwords

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"
    Copy to Clipboard
    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
      Copy to Clipboard
    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
      Copy to Clipboard
  4. After updating the database credentials, reload systemd and restart the clad daemon to apply the changes:

    $ sudo systemctl restart clad
    Copy to Clipboard
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat