Convert input text into a valid Centreon Query Language request
Project description
txt2cql
txt2cql
is a command-line tool designed to convert input text into a valid Centreon Query Language (CQL) request. The generated CQL is automatically copied to your clipboard, ready to be pasted into the research bar of the resource status page in Centreon.
Installation
Installing pipx
From their documentation:
On macOS:
brew install pipx
pipx ensurepath
sudo pipx ensurepath --global # optional to allow pipx actions in global scope. See "Global installation" section below.
On Linux:
Ubuntu 23.04 or above
sudo apt update
sudo apt install pipx
pipx ensurepath
sudo pipx ensurepath --global # optional to allow pipx actions in global scope. See "Global installation" section below.
Fedora:
sudo dnf install pipx
pipx ensurepath
sudo pipx ensurepath --global # optional to allow pipx actions in global scope. See "Global installation" section below.
Using pip on other distributions:
python3 -m pip install --user pipx
python3 -m pipx ensurepath
sudo pipx ensurepath --global # optional to allow pipx actions in global scope. See "Global installation" section below.
On Windows:
Install via Scoop:
scoop install pipx
pipx ensurepath
Install via pip (requires pip 19.0 or later)
# If you installed python using Microsoft Store, replace `py` with `python3` in the next line.
py -m pip install --user pipx
py -m pipx ensurepath
It is possible (even most likely) the above finishes with a WARNING looking similar to this:
WARNING: The script pipx.exe is installed in `<USER folder>\AppData\Roaming\Python\Python3x\Scripts` which is not on PATH
If so, go to the mentioned folder, allowing you to run the pipx executable directly. Enter the following line (even if you did not get the warning):
.\pipx.exe ensurepath
This will add both the above mentioned path and the %USERPROFILE%.local\bin folder to your search path. Restart your terminal session and verify pipx does run.
Installing txt2cql
pipx install git+https://github.com/CentreonLabs/txt2cql
Export OpenAI API key
For the tool to work, you need to export your OpenAI API key as an environment variable. You can do this by adding the following line to your shell configuration file (e.g., ~/.bashrc
, ~/.zshrc
, etc.):
export OPENAI_API_KEY="your-api-key"
Usage
txt2cql all ping services for all linux hosts
> s.description:ping h.name:linux
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file txt2cql-0.1.0.tar.gz
.
File metadata
- Download URL: txt2cql-0.1.0.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.9.19 Darwin/23.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5c13275bc9d5b0254eff0ac820425d59947b50945032f0d12f7a4f6147a645c |
|
MD5 | 2e212cb985caf9c5b6e879be2147489b |
|
BLAKE2b-256 | 8b24321ab83a709f52db73dcc89dd9c1a6574a7c058115e940a46547d41ed6ad |
File details
Details for the file txt2cql-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: txt2cql-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.9.19 Darwin/23.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8843fae8ca7bb0dfc388d70915075759d916804f850714d0360f87a999ee88bd |
|
MD5 | 1878aa3a8697e9b16cb10b304c49d78d |
|
BLAKE2b-256 | c72a02b6e1cc35156bec65c1638f62a7781ffd8f21712b78dda96d450209d7cb |