CLI tool for adding calendar events
Project description
ccal
A CLI tool that turns natural language text or images into calendar events. Powered by LLMs.
Features
- Text input — describe an event in plain language, ccal parses it into structured fields
- Image input — extract text from screenshots/photos via OCR, then parse
- Multi-LLM support — works with OpenAI, Anthropic, Gemini, OpenRouter, Deepseek, Groq, Mistral, and more (via litellm)
- ICS export — generate standard
.icsfiles importable by any calendar app - Google Calendar sync — create events directly on Google Calendar via API
- Apple Calendar sync — add events via AppleScript (macOS only, auto-fallback to ICS on other platforms)
- Secure key storage — API keys stored in your system keyring, never in plain text
- Geolocation — auto-detect timezone and location for accurate event scheduling
- Stdin support — pipe text from other commands
Requirements
- Python 3.12+
- uv (recommended) or pip
- Tesseract OCR (for image input)
Installation
git clone https://github.com/your-username/ccal.git
cd ccal
uv sync
Quick Start
1. Setup
ccal setup
This will walk you through configuring:
- LLM provider and model
- API key (stored securely in system keyring)
- Default output method (ICS file, Google Calendar, or Apple Calendar)
- Google Calendar setup, including client type, auth mode, credentials location, and Calendar ID
2. Add an event
From text:
ccal add "Team meeting tomorrow at 3pm in Conference Room A"
From an image:
ccal add flyer.png
From stdin:
echo "Lunch with Alice Friday noon" | ccal add
With options:
ccal add "Dinner Friday 7pm at Luigi's" -o google # sync to Google Calendar
ccal add "Weekly standup Mon 9am" -o apple # add to Apple Calendar (macOS)
ccal add "Weekly standup Mon 9am" -o ics # export as .ics file
ccal add "会议明天下午两点" -m anthropic/claude-sonnet-4-20250514 # use a specific model
ccal add screenshot.png -l chi_sim # OCR with Chinese language
ccal add "Demo at 2pm" -y # skip confirmation
ccal add "Demo at 2pm" --json # output as JSON
3. Parse only (no save)
ccal parse "Workshop next Wednesday 10am-12pm, Room 301"
ccal parse "下周一上午10点团队周会" --json
4. View config
ccal config
Commands
| Command | Description |
|---|---|
ccal add [text|image] |
Parse input and create a calendar event |
ccal parse [text|image] |
Parse and display event fields without saving |
ccal setup |
Interactive configuration wizard |
ccal config |
Show current configuration and platform info |
ccal add options
| Option | Description |
|---|---|
-o, --output |
Output method: ics, google, or apple |
-p, --provider |
LLM provider name |
-m, --model |
LLM model (e.g. openai/gpt-4o) |
-y, --yes |
Skip confirmation, output directly |
-l, --language |
OCR language (e.g. chi_sim, eng+chi_sim) |
--json |
Output parsed event as JSON |
Platform Support
| Feature | macOS | Linux | Windows |
|---|---|---|---|
| ICS export | ✅ | ✅ | ✅ |
| Google Calendar | ✅ | ✅ | ✅ |
| Apple Calendar | ✅ | ❌ fallback to ICS | ❌ fallback to ICS |
Configuration
Config is stored at ~/.config/ccal/config.toml. API keys are stored in your system's native keyring (macOS Keychain / Linux Secret Service / Windows Credential Locker).
For Google Calendar integration, ccal uses two different local files:
google_credentials.json: the OAuth client credentials JSON downloaded from Google Cloud Console. This contains the client id and client secret. Keep this file around after setup.google_token_*.json: the cached login token created after the first successful authorization. The access token inside can expire and refresh automatically, so you usually do not need to touch it. ccal picks the cache file based on the current credentials path and auth mode.
During ccal setup, place the credentials JSON in the configured directory, or point setup directly at the JSON file. The setup tutorial also explains:
Desktop appvsTVs and Limited Input devicesExternalvsInternalTestingstatus andTest users- how to find a Google Calendar ID
- setup-time validation of the selected Calendar ID
You can also configure Google Calendar during ccal setup through the dedicated middle step, even if your default output is not Google.
Project Structure
src/
├── main.py # CLI entry point (Typer)
├── config.py # Configuration & keyring management
├── models/
│ ├── model.py # CalendarEvent Pydantic model
│ └── llm.py # LLM parsing via litellm
├── input/
│ ├── ocr.py # Image text extraction (pytesseract)
│ └── geo.py # IP-based geolocation for timezone
└── connections/
├── google_calendar.py # Google Calendar API integration
├── apple_calendar.py # Apple Calendar via AppleScript (macOS)
└── ics.py # ICS file export
License
MIT
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 ccal-0.1.4.tar.gz.
File metadata
- Download URL: ccal-0.1.4.tar.gz
- Upload date:
- Size: 180.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3b56ad446d03095c6ec33ba15000f3878efc1263e9256c63204117dc46ace36
|
|
| MD5 |
c68593375f32a2fc103474242583523b
|
|
| BLAKE2b-256 |
4159bdb0e47ac0c6e289991a2642dbb125a89c32fdb867476c4eb1017db0337b
|
Provenance
The following attestation bundles were made for ccal-0.1.4.tar.gz:
Publisher:
publish.yml on Q1ngX1/ccal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ccal-0.1.4.tar.gz -
Subject digest:
a3b56ad446d03095c6ec33ba15000f3878efc1263e9256c63204117dc46ace36 - Sigstore transparency entry: 1324350326
- Sigstore integration time:
-
Permalink:
Q1ngX1/ccal@d7a9055f4b9cc877447f1676d5fffc60d21bd686 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/Q1ngX1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d7a9055f4b9cc877447f1676d5fffc60d21bd686 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ccal-0.1.4-py3-none-any.whl.
File metadata
- Download URL: ccal-0.1.4-py3-none-any.whl
- Upload date:
- Size: 27.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17358f4a6c95641b82fdd71f6b3a71c87b5cbafea8a5b40ab427df1edb723cae
|
|
| MD5 |
9f778b765f217ee9a0327db3bda4ea98
|
|
| BLAKE2b-256 |
978593637cca08c08785f3d14046c30c6be06223d7b0327c4edf040df68d42c2
|
Provenance
The following attestation bundles were made for ccal-0.1.4-py3-none-any.whl:
Publisher:
publish.yml on Q1ngX1/ccal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ccal-0.1.4-py3-none-any.whl -
Subject digest:
17358f4a6c95641b82fdd71f6b3a71c87b5cbafea8a5b40ab427df1edb723cae - Sigstore transparency entry: 1324350372
- Sigstore integration time:
-
Permalink:
Q1ngX1/ccal@d7a9055f4b9cc877447f1676d5fffc60d21bd686 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/Q1ngX1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d7a9055f4b9cc877447f1676d5fffc60d21bd686 -
Trigger Event:
push
-
Statement type: