Installation
Prerequisites
- Python 3.14 or newer — grapicli uses features introduced in Python 3.14.
Check your version with
python3 --version.
Install from PyPI (recommended)
No need to clone the repository for normal usage. Install directly from PyPI into a dedicated virtual environment.
1. Create a virtual environment
python3.14 -m venv .venv
source .venv/bin/activate # macOS / Linux
# .venv\Scripts\activate # Windows
Your shell prompt will show (.venv) to confirm the environment is active.
Managing multiple Python versions with pyenv
If Python 3.14 is not your system default, install and select it with pyenv:
2. Install grapicli
3. Verify the installation
You should see the help output listing the search command and its options.
Configuration
grapicli reads credentials from a .env file in your current working directory when you run the command.
Create .env with the following variables:
Finding your API token
- Log in to your Graylog web interface.
- Navigate to System → Users and Teams → Edit Profile → API Tokens.
- Create a new token and copy the value into your
.envfile.
Warning
Never commit your .env file to version control. Add it to .gitignore:
Upgrading
To upgrade to the latest version:
Development installation
If you want to contribute or run the test suite, install from source using Poetry:
This adds:
| Tool | Purpose |
|---|---|
pytest |
Test runner |
pytest-cov |
Coverage reporting |
requests-mock |
HTTP mocking in tests |
mkdocs |
Documentation site generator |
mkdocs-material |
Material theme for MkDocs |
Run tests:
Serve docs locally: