A powerful, cross-platform Python application for creating ClickUp tasks directly from email URLs with AI-powered field population using Google Gemini.
- π Email URL Input: Paste an email URL (Gmail, Outlook, etc.) to create a task
- π§ Email Extraction: Automatically extract email content, metadata, and attachments
- π€ AI Summaries: Optional Google Gemini AI integration for intelligent email analysis
- π― Smart Field Population: Automatically populate ClickUp custom fields based on email content
- π Secure Authentication: Multiple authentication methods including 1Password integration
- π¨ Beautiful UI: Rich console interfaces with panels, prompts, and styled output
- π Interactive Preview: Review and confirm task details before creation
- π Cross-Platform: Works on Windows, macOS, and Linux
- β‘ Modern Architecture: Clean, modular design following SOLID principles
- Python 3.11 or higher
- ClickUp API token
- Optional: 1Password CLI or SDK for secure credential management
- Optional: Google Gemini API key for AI email analysis
- Optional: Gmail/Outlook API credentials for email extraction
-
Clone the repository:
git clone https://github.com/J-MaFf/clickup_task_creator.git cd clickup_task_creator -
Create virtual environment:
python -m venv .venv
-
Activate virtual environment:
On Windows:
.venv\Scripts\Activate.ps1
On macOS/Linux:
source .venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Set up your credentials (choose one method):
- Command line:
python main.py --api-key YOUR_CLICKUP_API_KEY --gemini-api-key YOUR_GEMINI_KEY - Environment variables:
export CLICKUP_API_KEY=YOUR_KEYandexport GEMINI_API_KEY=YOUR_KEY - 1Password: Store in 1Password with reference
op://Home Server/ClickUp personal API token/credential
- Command line:
# Run with interactive prompts
python main.py
# Create task from specific email URL
python main.py --email-url "https://mail.google.com/mail/u/0/#inbox/..."
# Enable AI analysis
python main.py --email-url "..." --ai-summary
# Interactive mode with preview before creation
python main.py --email-url "..." --interactive
# Specify target workspace, space, and list
python main.py --workspace "MyWorkspace" --space "MySpace" --list "Tasks"- Install deps via
pip install -r requirements.txt - Run the creator with
python main.py - Override defaults with CLI flags:
--email-url,--api-key,--gemini-api-key,--workspace,--space,--list,--ai-summary,--interactive - Authentication falls back in this order: CLI flag β env var β 1Password SDK β 1Password CLI β manual prompt
- Logging comes from
logger_config.setup_logging; passuse_rich=Falsefor plain output or alog_filepath to persist logs
| Option | Description | Default |
|---|---|---|
--email-url |
Email URL to process | Prompted if not specified |
--api-key |
ClickUp API key | From environment or 1Password |
--gemini-api-key |
Google Gemini API key | From 1Password or environment |
--workspace |
Workspace name | Prompted if not specified |
--space |
Space name | Prompted if not specified |
--list |
List name | Prompted if not specified |
--ai-summary |
Enable AI email analysis | Prompted if not specified |
--interactive |
Show preview before creation | False |
--email-platform |
Email platform: GMAIL, OUTLOOK |
Auto-detect from URL |
clickup_task_creator/
βββ main.py # CLI entry, venv handoff, config assembly, auth chain
βββ config.py # Config dataclass, enums, EmailContent/EmailAnalysis
βββ auth.py # 1Password SDK/CLI loader with structured logging
βββ api_client.py # ClickUp API client (GET, POST, PUT with 30s timeout)
βββ email_client.py # Email extraction protocol & platform implementations
βββ ai_summary.py # Gemini analysis with retry/backoff and graceful fallback
βββ task_creator.py # Main workflow, TaskBuilder, field mapping
βββ mappers.py # Email field extraction, custom field builders
βββ logger_config.py # Rich-enhanced logging setup
βββ version.py # Version metadata
βββ requirements.txt # Dependency manifest
βββ PLAN.md # Detailed development plan
βββ CHANGELOG.md # Version history
βββ tests/ # Unit and integration tests
βββ test_config.py
βββ test_auth.py
βββ test_email_client.py
βββ test_api_client.py
βββ test_ai_summary.py
βββ test_task_creator.py
βββ test_main.py
main.py: BuildsClickUpTaskConfig, orchestrates auth fallback, and manages CLI interaction.ClickUpTaskConfig&EmailContent: Enum-backed config and structured data classes for configuration and email data.ClickUpTaskCreator: Orchestrates the complete workflow: email extraction β AI analysis β task creation.EmailClientprotocol: Extensible interface for email platform implementations (Gmail, Outlook, etc.).TaskBuilder: Constructs ClickUp API payloads with intelligent field mapping from email data.ai_summary.analyze_email: Talks to Google Gemini (gemini-2.5-flash-lite), parses structured JSON output, and falls back gracefully.logger_config.setup_logging: Installs Rich tracebacks and optional file logging.
Optional Google Gemini AI integration provides:
- Intelligent email analysis and summarization
- Automatic title suggestion from email content
- Priority level extraction
- Due date detection from email text
- Key action items identification
- Automatic rate limiting and retry logic
- Graceful fallback if AI is unavailable
Enable AI analysis:
python main.py --ai-summary --gemini-api-key YOUR_KEYImplementation details:
- Uses
gemini-2.5-flash-litevia the officialgoogle-generativeaiSDK - Retries up to three times on 429s, parsing
retryDelayhints when available - Falls back to basic email parsing when the SDK is missing or key is unavailable
- Returns structured
EmailAnalysiswith confidence scores
requests>=2.25.0- HTTP client for ClickUp API and email extractionrich>=14.0.0- Beautiful console interfacesgoogle-generativeai>=0.8.0- Google Gemini AI integration
onepassword-sdk>=0.3.1- Secure credential managementgoogle-auth>=2.0.0- Gmail API authenticationbeautifulsoup4>=4.9.0- Email web scraping fallbackselenium>=4.0.0- Browser-based email extraction fallback
User Input (Email URL)
β
[Email Client] β Extract email content
β
[AI Summary] β Analyze email (if enabled)
β
[Task Builder] β Build ClickUp task payload
β
[Interactive Preview] (if enabled) β User confirms
β
[ClickUp API Client] β POST task to ClickUp
β
Return task ID and link
Store in 1Password for reuse:
- Reference:
op://Home Server/ClickUp personal API token/credential
Retrieve in priority order:
--api-keyCLI argumentCLICKUP_API_KEYenvironment variable- 1Password SDK (requires
OP_SERVICE_ACCOUNT_TOKEN) - 1Password CLI (requires
opcommand) - Manual prompt
Store in 1Password:
- Reference:
op://Home Server/nftoo3gsi3wpx7z5bdmcsvr7p4/credential
Retrieve same priority as ClickUp key, or set GEMINI_API_KEY environment variable.
Authentication Errors:
- Verify your ClickUp API key is valid
- Check 1Password integration setup
- Ensure environment variables are set correctly
Email Extraction Fails:
- Verify email URL is correct and accessible
- Check email platform support (Gmail, Outlook)
- Enable fallback web scraping if API unavailable
AI Analysis Unavailable:
- Check Gemini API key is valid
- Verify internet connectivity
- Check rate limits (AI summaries auto-retry with backoff)
Task Creation Fails:
- Verify custom field names match ClickUp schema
- Check workspace/space/list names exist
- Ensure user has permissions to create tasks
Enable detailed logging:
python main.py --log-level DEBUG --log-file debug.logRun unit tests:
pytest tests/Run with coverage:
pytest tests/ --cov=. --cov-report=html- Create client class in
email_client.pyimplementingEmailClientprotocol - Add
EmailPlatformenum value inconfig.py - Implement URL parsing and content extraction
- Update factory/router logic
- Add tests in
tests/test_email_client.py
- Define in
config.pyunderCUSTOM_FIELD_MAPPINGS - Implement extraction logic in
mappers.py - Validate field type matches ClickUp schema
- Test with sample emails
- Update prompt in
ai_summary.py - Adjust
EmailAnalysisdataclass if new fields needed - Update
TaskBuilderto handle new fields - Test with various email formats
- Fork the repository
- Create a feature branch:
git checkout -b feat/new-feature - Follow the existing code style and architecture patterns
- Add tests for new functionality
- Update documentation as needed
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Rich for beautiful console output
- Uses 1Password SDK for secure credential management
- Powered by Google Gemini AI for intelligent email analysis
- Integrates with ClickUp API v2 for task management
Made with β€οΈ for productivity and beautiful code