CLI tool for endoflife.date API - Check EOL dates and support lifecycles
Project description
EOL CLI
A powerful command-line interface for the endoflife.date API. Query end-of-life dates and support lifecycles for various products directly from your terminal.
Features
- ๐ Search Products: List and search all products tracked by endoflife.date
- ๐ฆ Product Details: Get detailed information about specific products
- ๐ท๏ธ Categories & Tags: Filter products by categories and tags
- ๐ Identifiers: Query products by CPE, PURL, and other identifiers
- ๐ Rich Output: Beautiful terminal output with tables and colors
- ๐พ JSON Export: Export data in JSON format for further processing
- ๐ Fast & Modular: Built with Click and designed for extensibility
Installation
From PyPI (recommended)
pip install eol-cli
From Source
git clone https://github.com/seifreed/eol-cli.git
cd eol-cli
pip install -e .
Development Installation
git clone https://github.com/seifreed/eol-cli.git
cd eol-cli
pip install -e ".[dev]"
Quick Start
# List all available products
eol-cli products list
# Get details about a specific product
eol-cli products get ubuntu
# Get latest release information
eol-cli products release ubuntu latest
# List products by category
eol-cli categories get os
# Search products by tag
eol-cli tags get linux
# Export data as JSON
eol-cli products get ubuntu --json
Usage
Products
# List all products
eol-cli products list
# List all products with full details
eol-cli products list --full
# Get a specific product (shows only releases table by default)
eol-cli products get <product-name>
# Get multiple products (comma-separated)
eol-cli products get <product1>,<product2>,<product3>
# Get all product details (info, links, identifiers, releases)
eol-cli products get <product-name> --all
# Get a specific release cycle
eol-cli products release <product-name> <release-cycle>
# Get the latest release cycle
eol-cli products release <product-name> latest
# Export as JSON
eol-cli products get ubuntu --json
Categories
# List all categories
eol-cli categories list
# Get products in a category
eol-cli categories get <category-name>
Tags
# List all tags
eol-cli tags list
# Get products with a specific tag
eol-cli tags get <tag-name>
Identifiers
# List all identifier types
eol-cli identifiers list
# Get identifiers by type
eol-cli identifiers get <identifier-type>
API Information
# Get API index
eol-cli index
Output Formats
Rich Terminal Output (Default)
By default, the CLI uses Rich to display beautiful, formatted output in your terminal with:
- Color-coded information
- Formatted tables
- Pretty-printed data structures
JSON Output
Use the --json flag to get machine-readable JSON output:
eol-cli products get ubuntu --json
This is useful for:
- Piping to other tools (jq, etc.)
- Scripting and automation
- Integration with other systems
Examples
Check if Ubuntu 20.04 is EOL
eol-cli products release ubuntu 20.04
Find all Linux distributions
eol-cli tags get linux
Export all products data
eol-cli products list --full --json > products.json
Check Python versions
eol-cli products get python
Compare Multiple Products
# Check multiple products at once
eol-cli products get python,nodejs,ruby
# Export multiple products to JSON
eol-cli products get ubuntu,debian,alpine-linux --json > linux_distros.json
# Compare with XML output
eol-cli products get apache,nginx --xml
Configuration
The CLI uses sensible defaults and requires no configuration. It connects to:
- API Base URL:
https://endoflife.date/api/v1
Development
Setup Development Environment
# Clone the repository
git clone https://github.com/seifreed/eol-cli.git
cd eol-cli
# Create virtual environment (Python 3.14 recommended)
python3.14 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode with dev dependencies
pip install -e ".[dev]"
Running Tests
The project includes comprehensive unit tests with 99% code coverage (176 tests, all using real API calls):
# Run all tests
pytest
# Run with coverage report
pytest --cov=eol_cli --cov-report=term-missing
# Run with HTML coverage report
pytest --cov=eol_cli --cov-report=html
# Open htmlcov/index.html in your browser
# Run specific test files
pytest tests/test_api_client.py
pytest tests/test_cli_commands.py
pytest tests/test_formatters.py
# Run tests in parallel (faster)
pytest -n auto
Test Structure
- test_api_client.py: Tests for API client functionality (26 tests)
- test_cli_commands.py: Tests for CLI commands (47 tests)
- test_formatters.py: Tests for JSON, XML, and Rich formatters (27 tests)
- test_command_error_handling.py: Tests for error handling and validation (27 tests)
- test_edge_cases.py: Tests for edge cases and complex scenarios (26 tests)
- test_rich_formatter_edge_cases.py: Tests for Rich formatter edge cases (30 tests)
All tests use real API calls to endoflife.date (no mocks or fake data) to ensure accurate behavior.
Code Formatting
# Format code with Black
black eol_cli/
# Lint with Ruff
ruff check eol_cli/
Project Structure
eol-cli/
โโโ eol_cli/
โ โโโ __init__.py
โ โโโ cli.py # Main CLI entry point
โ โโโ api/
โ โ โโโ __init__.py
โ โ โโโ client.py # API client
โ โโโ commands/
โ โ โโโ __init__.py
โ โ โโโ products.py # Product commands
โ โ โโโ categories.py # Category commands
โ โ โโโ tags.py # Tag commands
โ โ โโโ identifiers.py # Identifier commands
โ โ โโโ index.py # Index command
โ โโโ formatters/
โ โโโ __init__.py
โ โโโ json_formatter.py # JSON output
โ โโโ rich_formatter.py # Rich terminal output
โโโ tests/
โโโ eol-cli.py # Wrapper script
โโโ pyproject.toml
โโโ setup.py
โโโ README.md
โโโ LICENSE
โโโ .gitignore
Testing
The project maintains a 99.83% code coverage with comprehensive testing:
Test Statistics
- 176 tests - All passing โ
- 99.83% code coverage (592/593 lines)
- Real API calls - No mocks or fake data
- 2,075 lines of test code
Test Suite Overview
| Test File | Tests | Description |
|---|---|---|
test_api_client.py |
26 | API client functionality and error handling |
test_cli_commands.py |
47 | CLI command execution and validation |
test_formatters.py |
27 | JSON, XML, and Rich output formatters |
test_command_error_handling.py |
27 | Error handling and exception paths |
test_edge_cases.py |
26 | Edge cases and complex scenarios |
test_rich_formatter_edge_cases.py |
30 | Rich formatter edge cases |
Running Tests
# Run all tests
pytest
# Run with coverage report
pytest --cov=eol_cli --cov-report=term-missing
# Run with HTML coverage report
pytest --cov=eol_cli --cov-report=html
# Open htmlcov/index.html in your browser
# Run specific test file
pytest tests/test_api_client.py
For detailed testing documentation, see TESTING.md.
API Coverage
This CLI covers all endpoints from the endoflife.date API v1.2.0:
- โ
Index (
/) - โ
Products (
/products,/products/full,/products/{product}) - โ
Product Releases (
/products/{product}/releases/{release},/products/{product}/releases/latest) - โ
Categories (
/categories,/categories/{category}) - โ
Tags (
/tags,/tags/{tag}) - โ
Identifiers (
/identifiers,/identifiers/{type})
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Marc Rivero (@seifreed)
- Email: mriverolopez@gmail.com
- GitHub: @seifreed
Support
If you find this project useful, consider supporting its development:
Your support helps maintain and improve this project! โ
Acknowledgments
- endoflife.date for providing the excellent API
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eol_cli-0.1.0.tar.gz.
File metadata
- Download URL: eol_cli-0.1.0.tar.gz
- Upload date:
- Size: 29.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf244875134f49ae7ff4806cf4510187e3de623615f8e7664a2914f86670845a
|
|
| MD5 |
062617e08195d0157220e4e69c9389b4
|
|
| BLAKE2b-256 |
b0df86e4d34c3fd99a9bf5f668e18c589a046a8aa1f8d99507ed3c413f34c6b0
|
File details
Details for the file eol_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: eol_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
965c44d05e32f53204862f9e427962dd0a23068754f68c8989a06d82d84a1de6
|
|
| MD5 |
7df352d71cbe9550e21679a5197a7e44
|
|
| BLAKE2b-256 |
f02344111c58425e13b4bb74439930e64cb2e4888370e97e3e1d1c33eb2ca672
|