Drupal Tip of the Day
Display one random tip from the pre-generated static database.
Installation
pip install drupaltools-tip-generator
# Global install
pipx install drupaltools-tip-generator
First run auto-creates ~/.drupaltools/tip-generator/ with a default config.json, .env template, and tips/ directory.
Instructions
- Get the command options:
drupaltools-tip-generator -h
- Run this command to get a random tip:
drupaltools-tip-generator --random-tip
Display the output exactly as returned (includes the tip text and any code blocks).
Optionally filter by category:
drupaltools-tip-generator --random-tip --tip-category core-service
- After the tip, add:
Want to explore this further or get another tip?
Available Categories
The categories are taken from the ~/.drupaltools/tip-generator/config.json file.
Use --tip-category <name> to filter by one of these folder names. Examples:
| Folder | Description |
|---|---|
| case-study | Drupal showcases |
| code-example | Code examples |
| composer-trick | Composer tips |
| concept-explanation | Drupal concepts explained |
| core-bash-commands | Core CLI commands |
etc...
Database Management
If you need to generate new tips, add API keys to ~/.drupaltools/tip-generator/.env first:
# Generate tips for a specific category
drupaltools-tip-generator -c 35 -n 5 -p openai
# Generate for all categories
drupaltools-tip-generator -c all -n 3 -p openai
# List all available category IDs
drupaltools-tip-generator --list-categories
# List categories with existing tips
drupaltools-tip-generator --list-existing
# Validate generated tips
drupaltools-tip-generator --validate --validate-all
Supported providers: anthropic, openai, openrouter